From 5d639bdc854a3c3fdc4f825ac9b31cce0e2d259a Mon Sep 17 00:00:00 2001 From: irfanpena Date: Thu, 27 Jun 2024 10:26:45 +0700 Subject: [PATCH] Update the URL and API desc --- cortex-js/src/app.ts | 11 +++++++++-- .../infrastructure/controllers/models.controller.ts | 4 +++- .../infrastructure/dtos/common/common-response.dto.ts | 2 +- .../src/infrastructure/dtos/engines/engines.dto.ts | 6 +++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/cortex-js/src/app.ts b/cortex-js/src/app.ts index 9eb1d8d70..fd0db7123 100644 --- a/cortex-js/src/app.ts +++ b/cortex-js/src/app.ts @@ -63,10 +63,17 @@ export const getApp = async () => { ) .addTag( 'Events', - 'Endpoints for observing Cortex statuses through event notifications.', + 'Endpoints for observing Cortex statuses through event notifications.', + ) + .addTag( + 'Configurations', + "Endpoints for customizing the Cortex's configurations.", + ) + .addTag( + 'Engines', + 'Endpoints for managing the available engines within Cortex.', ) .addServer('http://localhost:1337') - .addServer('http://localhost:1337/v1') .build(); const document = SwaggerModule.createDocument(app, config); diff --git a/cortex-js/src/infrastructure/controllers/models.controller.ts b/cortex-js/src/infrastructure/controllers/models.controller.ts index 6d42e4733..7f2077525 100644 --- a/cortex-js/src/infrastructure/controllers/models.controller.ts +++ b/cortex-js/src/infrastructure/controllers/models.controller.ts @@ -115,6 +115,8 @@ export class ModelsController { } @ApiOperation({ + summary: 'Abort model download', + description: 'Abort the model download operation.', parameters: [ { in: 'path', @@ -136,7 +138,7 @@ export class ModelsController { type: DownloadModelResponseDto, }) @ApiOperation({ - summary: 'Pulls a remote model and download it', + summary: 'Download a remote model', description: 'Pulls a remote model template from cortex hub or huggingface and downloads it.', }) diff --git a/cortex-js/src/infrastructure/dtos/common/common-response.dto.ts b/cortex-js/src/infrastructure/dtos/common/common-response.dto.ts index a98d1b56f..dd60f4892 100644 --- a/cortex-js/src/infrastructure/dtos/common/common-response.dto.ts +++ b/cortex-js/src/infrastructure/dtos/common/common-response.dto.ts @@ -3,7 +3,7 @@ import { IsString } from 'class-validator'; export class CommonResponseDto { @ApiProperty({ - description: 'The success or error message', + description: 'The response success or error message.', }) @IsString() message: string; diff --git a/cortex-js/src/infrastructure/dtos/engines/engines.dto.ts b/cortex-js/src/infrastructure/dtos/engines/engines.dto.ts index d222c15d1..4a1e67902 100644 --- a/cortex-js/src/infrastructure/dtos/engines/engines.dto.ts +++ b/cortex-js/src/infrastructure/dtos/engines/engines.dto.ts @@ -16,7 +16,7 @@ export class EngineDto implements Partial { @ApiProperty({ type: String, example: 'Cortex', - description: 'The display name of the engine', + description: 'The display name of the engine.', }) @IsString() @IsOptional() @@ -25,7 +25,7 @@ export class EngineDto implements Partial { @ApiProperty({ type: String, example: 'Cortex engine', - description: 'The description of the engine', + description: 'The description of the engine.', }) @IsString() @IsOptional() @@ -34,7 +34,7 @@ export class EngineDto implements Partial { @ApiProperty({ type: String, example: '0.0.1', - description: 'The version of the engine', + description: 'The version of the engine.', }) @IsString() @IsOptional()