Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class ChatCompletionMessage {

@ApiProperty({
description: 'The role of the entity in the chat completion.',
example: 'user'
})
role: 'user' | 'assistant';
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class CreateChatCompletionDto {

@ApiProperty({
description: 'The unique identifier of the model.',
example: 'gpt-4',
example: 'mistral',
})
@IsString()
model: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ApiProperty } from '@nestjs/swagger';

export class CreateEmbeddingsDto {
@ApiProperty({
example: 'llama3',
example: 'mistral',
description: 'The name of the embedding model to be used.',
type: String,
})
Expand Down
21 changes: 11 additions & 10 deletions cortex-js/src/infrastructure/dtos/models/create-model.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import { ApiProperty, getSchemaPath } from '@nestjs/swagger';

export class CreateModelDto implements Partial<Model> {
// Cortex Meta
@ApiProperty({ description: 'The unique identifier of the model.' })
@ApiProperty({ description: 'The unique identifier of the model.', example: 'mistral' })
@IsString()
model: string;

@ApiProperty({ description: 'The name of the model.' })
@ApiProperty({ description: 'The name of the model.', example: 'mistral' })
@IsString()
name?: string;

@ApiProperty({
description: 'The URL sources from which the model downloaded or accessed.',
description: 'The URL sources from which the model downloaded or accessed.', example: ['https://huggingface.co/cortexso/mistral/tree/gguf'],
oneOf: [
{ type: 'array', items: { type: 'string' } },
{ $ref: getSchemaPath(ModelArtifactDto) },
Expand All @@ -33,15 +33,16 @@ export class CreateModelDto implements Partial<Model> {
// Model Input / Output Syntax
@ApiProperty({
description:
"A predefined text or framework that guides the AI model's response generation.",
"A predefined text or framework that guides the AI model's response generation.", example: `
You are an expert in {subject}. Provide a detailed and thorough explanation on the topic of {topic}.`
})
@IsOptional()
@IsString()
prompt_template?: string;

@ApiProperty({
description:
'Defines specific tokens or phrases that signal the model to stop producing further output.',
'Defines specific tokens or phrases that signal the model to stop producing further output.', example: ['End']
})
@IsOptional()
@IsArray()
Expand All @@ -58,38 +59,38 @@ export class CreateModelDto implements Partial<Model> {
max_tokens?: number;

@ApiProperty({
description: 'Sets probability threshold for more relevant outputs.',
description: 'Sets probability threshold for more relevant outputs.', example: 0.9
})
@IsOptional()
@IsNumber()
top_p?: number;

@ApiProperty({
description: "Influences the randomness of the model's output.",
description: "Influences the randomness of the model's output.", example: 0.7
})
@IsOptional()
@IsNumber()
temperature?: number;

@ApiProperty({
description:
'Modifies the likelihood of the model repeating the same words or phrases within a single output.',
'Modifies the likelihood of the model repeating the same words or phrases within a single output.', example: 0.5
})
@IsOptional()
@IsNumber()
frequency_penalty?: number;

@ApiProperty({
description:
'Reduces the likelihood of repeating tokens, promoting novelty in the output.',
'Reduces the likelihood of repeating tokens, promoting novelty in the output.', example: 0.6
})
@IsOptional()
@IsNumber()
presence_penalty?: number;

@ApiProperty({
description:
'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.',
'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.', example: true
})
@IsOptional()
@IsBoolean()
Expand Down
7 changes: 4 additions & 3 deletions cortex-js/src/infrastructure/dtos/models/model.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

export class ModelDto implements Partial<Model> {
@ApiProperty({
example: 'llama3',
example: 'mistral',
description:
'The model identifier, which can be referenced in the API endpoints.',
})
Expand All @@ -19,7 +19,7 @@ export class ModelDto implements Partial<Model> {

// Prompt Settings
@ApiProperty({
example: 'system\n{system_message}\nuser\n{prompt}\nassistant',
example: `You are an expert in {subject}. Provide a detailed and thorough explanation on the topic of {topic}.`,
description:
"A predefined text or framework that guides the AI model's response generation.",
})
Expand All @@ -28,7 +28,7 @@ export class ModelDto implements Partial<Model> {

@ApiProperty({
type: [String],
example: [],
example: ["End"],
description:
'Defines specific tokens or phrases that signal the model to stop producing further output.',
})
Expand Down Expand Up @@ -116,6 +116,7 @@ export class ModelDto implements Partial<Model> {

@ApiProperty({
description: 'The prompt to use for internal configuration',
example: "You are an assistant with expert knowledge in {subject}. Please provide a detailed and accurate response to the following query: {query}. Ensure that your response is clear, concise, and informative."
})
@IsOptional()
@IsString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class CreateThreadAssistantDto implements Assistant {
name: string;

@ApiProperty({
example: 'llama3',
example: 'mistral',
description: 'The model\'s unique identifier and settings.',
type: 'string',
})
Expand Down