Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit b21ef85

Browse files
irfanpenaVan-QA
authored andcommitted
API: Added the description
1 parent e421676 commit b21ef85

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

cortex-js/src/infrastructure/controllers/events.controller.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { DownloadManagerService } from '@/download-manager/download-manager.serv
1313
import { ModelsUsecases } from '@/usecases/models/models.usecases';
1414
import { Controller, Sse } from '@nestjs/common';
1515
import { EventEmitter2 } from '@nestjs/event-emitter';
16-
import { ApiTags } from '@nestjs/swagger';
16+
import { ApiOperation, ApiTags } from '@nestjs/swagger';
1717
import {
1818
Observable,
1919
combineLatest,
@@ -34,6 +34,10 @@ export class EventsController {
3434
private readonly eventEmitter: EventEmitter2,
3535
) {}
3636

37+
@ApiOperation({
38+
summary: 'Get download status',
39+
description: "Retrieves the model's download status.",
40+
})
3741
@Sse('download')
3842
downloadEvent(): Observable<DownloadStateEvent> {
3943
const latestDownloadState$: Observable<DownloadStateEvent> = of({
@@ -60,6 +64,10 @@ export class EventsController {
6064
).pipe();
6165
}
6266

67+
@ApiOperation({
68+
summary: 'Get model status',
69+
description: 'Retrieves all the available model statuses within Cortex.',
70+
})
6371
@Sse('model')
6472
modelEvent(): Observable<ModelStatusAndEvent> {
6573
const latestModelStatus$: Observable<Record<ModelId, ModelStatus>> = of(

cortex-js/src/infrastructure/controllers/process.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class ProcessController {
88

99
@ApiOperation({
1010
summary: 'Terminate service',
11-
description: 'Terminate service endpoint',
11+
description: 'Terminates the Cortex API endpoint server for the detached mode.',
1212
})
1313
@Delete()
1414
async delete() {

cortex-js/src/infrastructure/controllers/status.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export class StatusController {
77
constructor() {}
88

99
@ApiOperation({
10-
summary: 'Health check',
11-
description: 'Health check endpoint.',
10+
summary: "Get health status",
11+
description: "Retrieves the health status of your Cortex's system.",
1212
})
1313
@HttpCode(200)
1414
@ApiResponse({

cortex-js/src/main.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ async function bootstrap() {
5858
'Embeddings',
5959
'Endpoint for creating and retrieving embedding vectors from text inputs using specified models.',
6060
)
61+
.addTag(
62+
'Status',
63+
"Endpoint for actively querying the health status of the Cortex.",
64+
)
65+
.addTag(
66+
'Processes',
67+
'Endpoint for terminating the Cortex API server processes.',
68+
)
69+
.addTag(
70+
'Events',
71+
'Endpoints for observing Cortex statuses through event notifications.',
72+
)
6173
.addServer('http://localhost:1337')
6274
.addServer('http://localhost:1337/v1')
6375
.build();

0 commit comments

Comments
 (0)