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

Commit bd8968a

Browse files
authored
Update the URL and API desc (#785)
1 parent cc5d7ce commit bd8968a

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

cortex-js/src/app.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,17 @@ export const getApp = async () => {
6363
)
6464
.addTag(
6565
'Events',
66-
'Endpoints for observing Cortex statuses through event notifications.',
66+
'Endpoints for observing Cortex statuses through event notifications.',
67+
)
68+
.addTag(
69+
'Configurations',
70+
"Endpoints for customizing the Cortex's configurations.",
71+
)
72+
.addTag(
73+
'Engines',
74+
'Endpoints for managing the available engines within Cortex.',
6775
)
6876
.addServer('http://localhost:1337')
69-
.addServer('http://localhost:1337/v1')
7077
.build();
7178
const document = SwaggerModule.createDocument(app, config);
7279

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class ChatController {
1212

1313
@ApiOperation({
1414
summary: 'Create chat completion',
15-
description: 'Creates a model response for the given conversation.',
15+
description: 'Creates a model response for the given conversation. The following parameters are not working for the `TensorRT-LLM` engine:\n- `frequency_penalty`\n- `presence_penalty`\n- `top_p`',
1616
})
1717
@HttpCode(200)
1818
@ApiResponse({

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ export class ModelsController {
115115
}
116116

117117
@ApiOperation({
118+
summary: 'Abort model download',
119+
description: 'Abort the model download operation.',
118120
parameters: [
119121
{
120122
in: 'path',
@@ -136,7 +138,7 @@ export class ModelsController {
136138
type: DownloadModelResponseDto,
137139
})
138140
@ApiOperation({
139-
summary: 'Pulls a remote model and download it',
141+
summary: 'Download a remote model',
140142
description:
141143
'Pulls a remote model template from cortex hub or huggingface and downloads it.',
142144
})

cortex-js/src/infrastructure/dtos/chat/chat-completion-message.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { IsString } from 'class-validator';
22
import { ApiProperty } from '@nestjs/swagger';
33

44
export class ChatCompletionMessage {
5-
@ApiProperty({ description: 'The Content of the chat message.' })
5+
@ApiProperty({ description: 'The Content of the chat message.', })
66
@IsString()
77
content: string;
88

cortex-js/src/infrastructure/dtos/chat/create-chat-completion.dto.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ export class CreateChatCompletionDto {
2222

2323
@ApiProperty({
2424
description: 'The unique identifier of the model.',
25+
example: 'gpt-4',
2526
})
2627
@IsString()
2728
model: string;
2829

2930
@ApiProperty({
3031
description:
3132
'Determines the format for output generation. If set to `true`, the output is generated continuously, allowing for real-time streaming of responses. If set to `false`, the output is delivered in a single JSON file.',
33+
example: true,
3234
})
3335
@IsOptional()
3436
@IsBoolean()
@@ -37,6 +39,7 @@ export class CreateChatCompletionDto {
3739
@ApiProperty({
3840
description:
3941
'Sets the upper limit on the number of tokens the model can generate in a single output.',
42+
example: 4096,
4043
})
4144
@IsOptional()
4245
@IsNumber()
@@ -45,6 +48,7 @@ export class CreateChatCompletionDto {
4548
@ApiProperty({
4649
description:
4750
'Defines specific tokens or phrases that signal the model to stop producing further output.',
51+
example: ["End"],
4852
})
4953
@IsOptional()
5054
@IsArray()
@@ -53,6 +57,7 @@ export class CreateChatCompletionDto {
5357
@ApiProperty({
5458
description:
5559
'Modifies the likelihood of the model repeating the same words or phrases within a single output.',
60+
example: 0.2,
5661
})
5762
@IsOptional()
5863
@IsNumber()
@@ -61,20 +66,23 @@ export class CreateChatCompletionDto {
6166
@ApiProperty({
6267
description:
6368
'Reduces the likelihood of repeating tokens, promoting novelty in the output.',
69+
example: 0.6,
6470
})
6571
@IsOptional()
6672
@IsNumber()
6773
presence_penalty?: number;
6874

6975
@ApiProperty({
7076
description: "Influences the randomness of the model's output.",
77+
example: 0.8,
7178
})
7279
@IsOptional()
7380
@IsNumber()
7481
temperature?: number;
7582

7683
@ApiProperty({
7784
description: 'Sets probability threshold for more relevant outputs.',
85+
example: 0.95,
7886
})
7987
@IsOptional()
8088
@IsNumber()

cortex-js/src/infrastructure/dtos/common/common-response.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { IsString } from 'class-validator';
33

44
export class CommonResponseDto {
55
@ApiProperty({
6-
description: 'The success or error message',
6+
description: 'The response success or error message.',
77
})
88
@IsString()
99
message: string;

cortex-js/src/infrastructure/dtos/engines/engines.dto.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class EngineDto implements Partial<Extension> {
1616
@ApiProperty({
1717
type: String,
1818
example: 'Cortex',
19-
description: 'The display name of the engine',
19+
description: 'The display name of the engine.',
2020
})
2121
@IsString()
2222
@IsOptional()
@@ -25,7 +25,7 @@ export class EngineDto implements Partial<Extension> {
2525
@ApiProperty({
2626
type: String,
2727
example: 'Cortex engine',
28-
description: 'The description of the engine',
28+
description: 'The description of the engine.',
2929
})
3030
@IsString()
3131
@IsOptional()
@@ -34,7 +34,7 @@ export class EngineDto implements Partial<Extension> {
3434
@ApiProperty({
3535
type: String,
3636
example: '0.0.1',
37-
description: 'The version of the engine',
37+
description: 'The version of the engine.',
3838
})
3939
@IsString()
4040
@IsOptional()

0 commit comments

Comments
 (0)