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

Commit 38a4c81

Browse files
authored
Merge pull request #683 from janhq/pena-patch
api: Update the API description
2 parents 4763c1c + 86162f0 commit 38a4c81

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Cortex currently supports two inference engines:
3333

3434
Before installation, ensure that you have installed the following:
3535

36-
- **Node.js**: Required for running the installation.
36+
- **Node.js**: version 18 and above is required to run the installation.
3737
- **NPM**: Needed to manage packages.
3838
- **CPU Instruction Sets**: Available for download from the [Cortex GitHub Releases](https://github.com/janhq/cortex/releases) page.
3939

cortex-js/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Cortex
3232
### **Dependencies**
3333

3434
Before installation, ensure that you have installed the following:
35-
36-
- **Node.js**: Required for running the installation.
35+
- **Node.js**: version 18 and above is required to run the installation.
3736
- **NPM**: Needed to manage packages.
3837
- **CPU Instruction Sets**: Available for download from the [Cortex GitHub Releases](https://github.com/janhq/cortex/releases) page.
3938

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export class EmbeddingsController {
1010
constructor(private readonly chatService: ChatUsecases) {}
1111

1212
@ApiOperation({
13-
summary: 'Embedding vector for text',
14-
description: 'Creates an embedding vector representing the input text..',
13+
summary: 'Create embedding vector',
14+
description: 'Creates an embedding vector representing the input text.',
1515
})
1616
@HttpCode(200)
1717
@ApiResponse({

cortex-js/src/infrastructure/dtos/chat/embeddings-response.dto.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ import { UsageDto } from './usage.dto';
33

44
export class EmbeddingsResponseDto {
55
@ApiProperty({
6-
description: 'Result object type.',
6+
description: 'Type of the result object.',
77
type: String,
88
})
99
object: string;
1010

1111
@ApiProperty({
12-
description: 'ID of the model used for embeddings',
12+
description: 'Identifier of the model utilized for generating embeddings.',
1313
type: String,
1414
})
1515
model: string;
1616

1717
@ApiProperty({
18-
description: 'The embedding vector, which is a list of floats. ',
18+
description: 'The embedding vector represented as an array of floating-point numbers. ',
1919
type: [Number],
2020
})
2121
embedding: [number];
2222

2323
@ApiProperty({
24-
description: 'Returns prompt_tokens and total_tokens usage ',
24+
description: 'Details of token usage, including prompt_tokens and total_tokens.',
2525
type: UsageDto,
2626
})
2727
usage: UsageDto;

cortex-js/src/infrastructure/dtos/embeddings/embeddings-request.dto.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@ import { ApiProperty } from '@nestjs/swagger';
33

44
export class CreateEmbeddingsDto {
55
@ApiProperty({
6-
description: 'Embedding model',
6+
description: 'The name of the embedding model to be used.',
77
type: String,
88
})
99
model: string;
1010

1111
@ApiProperty({
1212
description:
13-
'Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays.',
13+
'The text or token array(s) to be embedded. This can be a single string, an array of strings, or an array of token arrays to embed multiple inputs in one request.',
1414
type: [String],
1515
})
1616
input: string | string[];
1717

1818
@ApiProperty({
1919
description:
20-
'Encoding format for the embeddings. Supported formats are float and int.',
20+
'Specifies the format for the embeddings. Supported formats include `float` and `int`. This field is optional.',
2121
type: String,
2222
})
2323
@Optional()
2424
encoding_format?: string;
2525

2626
@ApiProperty({
2727
description:
28-
'The number of dimensions the resulting output embeddings should have. Only supported in some models.',
28+
'Defines the number of dimensions for the output embeddings. This feature is supported by certain models only. This field is optional.',
2929
type: Number,
3030
})
3131
@Optional()

cortex-js/src/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ async function bootstrap() {
5353
'Threads',
5454
'These endpoints handle the creation, retrieval, updating, and deletion of conversation threads.',
5555
)
56+
.addTag(
57+
'Embeddings',
58+
'Endpoint for creating and retrieving embedding vectors from text inputs using specified models.',
59+
)
5660
.addServer('http://localhost:1337')
5761
.addServer('http://localhost:1337/v1')
5862
.build();

0 commit comments

Comments
 (0)