diff --git a/cortex-js/src/infrastructure/controllers/events.controller.ts b/cortex-js/src/infrastructure/controllers/events.controller.ts index 1de23af20..123bb7374 100644 --- a/cortex-js/src/infrastructure/controllers/events.controller.ts +++ b/cortex-js/src/infrastructure/controllers/events.controller.ts @@ -13,7 +13,7 @@ import { DownloadManagerService } from '@/infrastructure/services/download-manag import { ModelsUsecases } from '@/usecases/models/models.usecases'; import { Controller, Sse } from '@nestjs/common'; import { EventEmitter2 } from '@nestjs/event-emitter'; -import { ApiTags } from '@nestjs/swagger'; +import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { Observable, combineLatest, @@ -34,6 +34,10 @@ export class EventsController { private readonly eventEmitter: EventEmitter2, ) {} + @ApiOperation({ + summary: 'Get download status', + description: "Retrieves the model's download status.", + }) @Sse('download') downloadEvent(): Observable { const latestDownloadState$: Observable = of({ @@ -60,6 +64,10 @@ export class EventsController { ).pipe(); } + @ApiOperation({ + summary: 'Get model status', + description: 'Retrieves all the available model statuses within Cortex.', + }) @Sse('model') modelEvent(): Observable { const latestModelStatus$: Observable> = of( diff --git a/cortex-js/src/infrastructure/controllers/process.controller.ts b/cortex-js/src/infrastructure/controllers/process.controller.ts index 7c8a932a7..eaf3823ad 100644 --- a/cortex-js/src/infrastructure/controllers/process.controller.ts +++ b/cortex-js/src/infrastructure/controllers/process.controller.ts @@ -8,7 +8,7 @@ export class ProcessController { @ApiOperation({ summary: 'Terminate service', - description: 'Terminate service endpoint', + description: 'Terminates the Cortex API endpoint server for the detached mode.', }) @Delete() async delete() { diff --git a/cortex-js/src/infrastructure/controllers/status.controller.ts b/cortex-js/src/infrastructure/controllers/status.controller.ts index 80116d9ea..c79b9515b 100644 --- a/cortex-js/src/infrastructure/controllers/status.controller.ts +++ b/cortex-js/src/infrastructure/controllers/status.controller.ts @@ -7,8 +7,8 @@ export class StatusController { constructor() {} @ApiOperation({ - summary: 'Health check', - description: 'Health check endpoint.', + summary: "Get health status", + description: "Retrieves the health status of the Cortex's API endpoint server.", }) @HttpCode(200) @ApiResponse({ diff --git a/cortex-js/src/main.ts b/cortex-js/src/main.ts index ac3c0d243..31deded13 100644 --- a/cortex-js/src/main.ts +++ b/cortex-js/src/main.ts @@ -58,6 +58,18 @@ async function bootstrap() { 'Embeddings', 'Endpoint for creating and retrieving embedding vectors from text inputs using specified models.', ) + .addTag( + 'Status', + "Endpoint for actively querying the health status of the Cortex's API server.", + ) + .addTag( + 'Processes', + 'Endpoint for terminating the Cortex API server processes.', + ) + .addTag( + 'Events', + 'Endpoints for observing Cortex statuses through event notifications.', + ) .addServer('http://localhost:1337') .addServer('http://localhost:1337/v1') .build();