From c821b4c319e72dae45cfd769b21808a1cc505887 Mon Sep 17 00:00:00 2001 From: irfanpena Date: Mon, 29 Jul 2024 13:13:48 +0700 Subject: [PATCH 1/2] Update the api desc --- cortex-js/package.json | 2 +- cortex-js/src/app.ts | 20 ++++--------------- .../controllers/engines.controller.ts | 2 +- .../controllers/models.controller.ts | 4 ++-- .../controllers/system.controller.ts | 4 ++-- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/cortex-js/package.json b/cortex-js/package.json index 55d0752c3..bc02ad45f 100644 --- a/cortex-js/package.json +++ b/cortex-js/package.json @@ -37,6 +37,7 @@ "build:dev:linux": "chmod +x ./dist/src/command.js" }, "dependencies": { + "@cortexso/cortex.js": "^0.1.3", "@huggingface/gguf": "^0.1.5", "@huggingface/hub": "^0.15.1", "@nestjs/axios": "^3.0.2", @@ -55,7 +56,6 @@ "class-validator": "^0.14.1", "cli-progress": "^3.12.0", "cortex-cpp": "0.4.34", - "@cortexso/cortex.js": "^0.1.3", "cpu-instructions": "^0.0.11", "decompress": "^4.2.1", "js-yaml": "^4.1.0", diff --git a/cortex-js/src/app.ts b/cortex-js/src/app.ts index 24cc24358..2f493325a 100644 --- a/cortex-js/src/app.ts +++ b/cortex-js/src/app.ts @@ -57,26 +57,14 @@ export const getApp = async () => { '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.', - ) - .addTag( - 'Configurations', - "Endpoints for customizing the Cortex's configurations.", - ) .addTag( 'Engines', 'Endpoints for managing the available engines within Cortex.', ) + .addTag( + 'System', + 'Endpoints for stopping the Cortex API server and retrieving the Cortex status.', + ) .addServer('http://localhost:1337') .build(); const document = SwaggerModule.createDocument(app, config); diff --git a/cortex-js/src/infrastructure/controllers/engines.controller.ts b/cortex-js/src/infrastructure/controllers/engines.controller.ts index 4d14e73ec..ab0db5a40 100644 --- a/cortex-js/src/infrastructure/controllers/engines.controller.ts +++ b/cortex-js/src/infrastructure/controllers/engines.controller.ts @@ -92,7 +92,7 @@ export class EnginesController { type: CommonResponseDto, }) @ApiOperation({ - summary: 'Update the engine', + summary: 'Update an engine', description: 'Updates the engine with configurations.', }) @ApiParam({ diff --git a/cortex-js/src/infrastructure/controllers/models.controller.ts b/cortex-js/src/infrastructure/controllers/models.controller.ts index 6287bcc5a..0aa6a87c5 100644 --- a/cortex-js/src/infrastructure/controllers/models.controller.ts +++ b/cortex-js/src/infrastructure/controllers/models.controller.ts @@ -120,9 +120,9 @@ export class ModelsController { type: CommonResponseDto, }) @ApiOperation({ - summary: 'Download a remote model', + summary: 'Pull a model', description: - 'Pulls a remote model template from cortex hub or huggingface and downloads it.', + 'Pulls a model from cortex hub or huggingface and downloads it.', }) @ApiParam({ name: 'modelId', diff --git a/cortex-js/src/infrastructure/controllers/system.controller.ts b/cortex-js/src/infrastructure/controllers/system.controller.ts index 43524b450..f4d73eed3 100644 --- a/cortex-js/src/infrastructure/controllers/system.controller.ts +++ b/cortex-js/src/infrastructure/controllers/system.controller.ts @@ -42,8 +42,8 @@ export class SystemController { ) {} @ApiOperation({ - summary: 'Terminate api server', - description: 'Terminates the Cortex API endpoint server for the detached mode.', + summary: 'Stop api server', + description: 'Stops the Cortex API endpoint server for the detached mode.', }) @Delete() async delete() { From d3dd4ea7e6c9a6c88634a03a0f6672f515206662 Mon Sep 17 00:00:00 2001 From: irfanpena Date: Mon, 29 Jul 2024 13:32:36 +0700 Subject: [PATCH 2/2] update per comment --- cortex-js/src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cortex-js/src/app.ts b/cortex-js/src/app.ts index 2f493325a..c8c81cee4 100644 --- a/cortex-js/src/app.ts +++ b/cortex-js/src/app.ts @@ -63,7 +63,7 @@ export const getApp = async () => { ) .addTag( 'System', - 'Endpoints for stopping the Cortex API server and retrieving the Cortex status.', + 'Endpoints for stopping the Cortex API server, checking its status, and fetching system events.', ) .addServer('http://localhost:1337') .build();