From 71eb2319853cdbdb727869c1ad5edd0ed926dbca Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 21 Jan 2025 15:22:44 +0000 Subject: [PATCH] Update version to v0.0.111 --- .gitignore | 3 + docs/capabilities/function-calling.mdx | 4 +- docs/capabilities/predicted-outputs.md | 150 +++++ openapi.yaml | 750 +++++++++++++------------ version.txt | 2 +- 5 files changed, 558 insertions(+), 351 deletions(-) create mode 100644 docs/capabilities/predicted-outputs.md diff --git a/.gitignore b/.gitignore index a732180..53db751 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# VSCode settings +.vscode/ + # Logs logs *.log diff --git a/docs/capabilities/function-calling.mdx b/docs/capabilities/function-calling.mdx index 3ff4996..1d451c6 100644 --- a/docs/capabilities/function-calling.mdx +++ b/docs/capabilities/function-calling.mdx @@ -16,11 +16,11 @@ Function calling allows Mistral models to connect to external tools. By integrat Currently, function calling is available for the following models: - Mistral Large - Mistral Small -- Codestral 22B +- Codestral - Ministral 8B - Ministral 3B - Pixtral 12B -- Mixtral 8x22B +- Pixtral Large - Mistral Nemo diff --git a/docs/capabilities/predicted-outputs.md b/docs/capabilities/predicted-outputs.md new file mode 100644 index 0000000..62f4c8c --- /dev/null +++ b/docs/capabilities/predicted-outputs.md @@ -0,0 +1,150 @@ +--- +id: predicted-outputs +title: Predicted outputs +sidebar_position: 2.92 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + +Predicted Outputs optimizes response time by leveraging known or predictable content. +This approach minimizes latency while maintaining high output quality. In tasks such as editing large texts, modifying code, or generating template-based responses, significant portions of the output are often predetermined. By predefining these expected parts with Predicted Outputs, models can allocate more computational resources to the unpredictable elements, improving overall efficiency. + +## Example: Code modification + +Predicted Outputs shine in scenarios where you need to regenerate text documents or code files with minor modifications. The key parameter introduced is the `prediction` parameter, which enables users to define predicted outputs. For example, imagine you want your model to update the model used in a fine-tuning job. You can include the code snippet you'd like to modify as both the user prompt and the predicted output. + + + +```python +import os +from mistralai import Mistral + +api_key = os.environ["MISTRAL_API_KEY"] +model = "mistral-large-latest" + +client = Mistral(api_key=api_key) + +code = """ +created_jobs = client.fine_tuning.jobs.create( + model="open-mistral-7b", + training_files=[{"file_id": ultrachat_chunk_train.id, "weight": 1}], + validation_files=[ultrachat_chunk_eval.id], + hyperparameters={ + "training_steps": 10, + "learning_rate":0.0001 + }, + auto_start=False +) +""" + +prompt = "Change the model name from open-mistral-7b to open-mistral-nemo. Respond only with code, no explanation, no formatting." + +chat_response = client.chat.complete( + model= model, + messages = [ + { + "role": "user", + "content": prompt, + }, + { + "role": "user", + "content": code + }, + ], + prediction = { + "type": "content", + "content": code + } +) +print(chat_response.choices[0].message.content) +``` + + + + +```typescript +import { Mistral } from '@mistralai/mistralai'; + +const apiKey = process.env.MISTRAL_API_KEY; + +const client = new Mistral({apiKey: apiKey}); + +const code = ` +created_jobs = client.fine_tuning.jobs.create( + model="open-mistral-7b", + training_files=[{"file_id": ultrachat_chunk_train.id, "weight": 1}], + validation_files=[ultrachat_chunk_eval.id], + hyperparameters={ + "training_steps": 10, + "learning_rate":0.0001 + }, + auto_start=False +) +`.trim(); + +const prompt = `Change the model name from open-mistral-7b to open-mistral-nemo. Respond only with code, no explanation, no formatting.`; + +const chatResponse = await client.chat.complete({ + model: "mistral-large-latest", + messages: [ + { + role: 'user', + content: prompt + }, + { + role: "user", + content: code + }, + ], + prediction: { + type: "content", + content: code + }, +}); + +console.log('Chat:', chatResponse.choices[0].message.content); +``` + + + +```bash +curl --location "https://api.mistral.ai/v1/chat/completions" \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --header "Authorization: Bearer $MISTRAL_API_KEY" \ + --data '{ + "model": "mistral-large-latest", + "messages": [ + {"role": "user", "content": "Change the model name from open-mistral-7b to open-mistral-nemo. Respond only with code, no explanation, no formatting."}, + {"role": "user", "content": "$CODE"} + ], + "prediction": { + "type": "content", + "content": "$CODE" + } + }' +``` + + + + +## FAQ + +### Which model supports predicted outputs? +As of now, `codestral-2501` and `mistral-large-2411` support predicted outputs. + +### How does predicted outputs affect pricing? +Currently, predicted outputs do not impact pricing. + +### Which parameters are not supported when using Predicted Outputs? +`n` (number of completions to return for each request) is not supported when using predicted outputs. + +### Does the Position of Certain Sentences or Words in the Prediction Matter? +No, the placement of sentences or words in your prediction does not affect its effectiveness. Predictions can appear anywhere within the generated response and still help reduce the API's output latency. + + + + + + diff --git a/openapi.yaml b/openapi.yaml index a423bf7..1010372 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -10,18 +10,18 @@ paths: description: List all models available to the user. operationId: list_models_v1_models_get responses: - "200": + '200': description: Successful Response content: application/json: schema: - $ref: "#/components/schemas/ModelList" - "422": + $ref: '#/components/schemas/ModelList' + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - models /v1/models/{model_id}: @@ -39,26 +39,26 @@ paths: example: "ft:open-mistral-7b:587a6b29:20240514:7e773925" description: The ID of the model to retrieve. responses: - "200": + '200': description: Successful Response content: application/json: schema: oneOf: - - $ref: "#/components/schemas/BaseModelCard" - - $ref: "#/components/schemas/FTModelCard" + - $ref: '#/components/schemas/BaseModelCard' + - $ref: '#/components/schemas/FTModelCard' discriminator: propertyName: type mapping: - base: "#/components/schemas/BaseModelCard" - fine-tuned: "#/components/schemas/FTModelCard" + base: '#/components/schemas/BaseModelCard' + fine-tuned: '#/components/schemas/FTModelCard' title: Response Retrieve Model V1 Models Model Id Get - "422": + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - models delete: @@ -75,18 +75,18 @@ paths: example: "ft:open-mistral-7b:587a6b29:20240514:7e773925" description: The ID of the model to delete. responses: - "200": + '200': description: Successful Response content: application/json: schema: - $ref: "#/components/schemas/DeleteModelOut" - "422": + $ref: '#/components/schemas/DeleteModelOut' + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - models /v1/files: @@ -94,19 +94,19 @@ paths: operationId: files_api_routes_upload_file summary: Upload File responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/UploadFileOut" - description: "Upload a file that can be used across various endpoints. + $ref: '#/components/schemas/UploadFileOut' + description: 'Upload a file that can be used across various endpoints. The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files. - Please contact us if you need to increase these storage limits." + Please contact us if you need to increase these storage limits.' requestBody: content: multipart/form-data: @@ -114,19 +114,13 @@ paths: title: MultiPartBodyParams type: object properties: - purpose: - allOf: - - enum: - - fine-tune - - batch - title: FilePurpose - type: string - default: fine-tune file: format: binary title: File type: string description: "The File object (not file name) to be uploaded.\n To upload a file and specify a custom file name you should format your request as such:\n ```bash\n file=@path/to/your/file.jsonl;filename=custom_name.jsonl\n ```\n Otherwise, you can just keep the original file name:\n ```bash\n file=@path/to/your/file.jsonl\n ```" + purpose: + $ref: "#/components/schemas/FilePurpose" required: - file required: true @@ -155,9 +149,9 @@ paths: schema: anyOf: - items: - $ref: "#/components/schemas/SampleType" + $ref: '#/components/schemas/SampleType' type: array - - type: "null" + - type: 'null' title: Sample Type required: false - in: query @@ -165,9 +159,9 @@ paths: schema: anyOf: - items: - $ref: "#/components/schemas/Source" + $ref: '#/components/schemas/Source' type: array - - type: "null" + - type: 'null' title: Source required: false - in: query @@ -175,7 +169,7 @@ paths: schema: anyOf: - type: string - - type: "null" + - type: 'null' title: Search required: false - in: query @@ -183,15 +177,15 @@ paths: schema: anyOf: - $ref: "#/components/schemas/FilePurpose" - - type: "null" + - type: 'null' required: false responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/ListFilesOut" + $ref: '#/components/schemas/ListFilesOut' description: Returns a list of files that belong to the user's organization. tags: - files @@ -207,12 +201,12 @@ paths: type: string required: true responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/RetrieveFileOut" + $ref: '#/components/schemas/RetrieveFileOut' description: Returns information about a specific file. tags: - files @@ -227,12 +221,12 @@ paths: type: string required: true responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/DeleteFileOut" + $ref: '#/components/schemas/DeleteFileOut' description: Delete a file. tags: - files @@ -248,7 +242,7 @@ paths: type: string required: true responses: - "200": + '200': description: OK content: application/octet-stream: @@ -258,6 +252,35 @@ paths: description: Download a file tags: - files + /v1/files/{file_id}/url: + get: + operationId: files_api_routes_get_signed_url + summary: Get Signed Url + parameters: + - in: path + name: file_id + schema: + title: File Id + type: string + required: true + - in: query + name: expiry + schema: + default: 24 + description: Number of hours before the url becomes invalid. Defaults to 24h + title: Expiry + type: integer + required: false + description: Number of hours before the url becomes invalid. Defaults to 24h + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FileSignedURL' + tags: + - files /v1/fine_tuning/jobs: get: operationId: jobs_api_routes_fine_tuning_get_fine_tuning_jobs @@ -284,7 +307,7 @@ paths: schema: anyOf: - type: string - - type: "null" + - type: 'null' title: Model required: false description: The model name used for fine-tuning to filter on. When set, the other results are not displayed. @@ -294,7 +317,7 @@ paths: anyOf: - format: date-time type: string - - type: "null" + - type: 'null' title: Created After required: false description: The date/time to filter on. When set, the results for previous creation times are not displayed. @@ -322,7 +345,7 @@ paths: - CANCELLED - CANCELLATION_REQUESTED type: string - - type: "null" + - type: 'null' title: Status required: false description: The current job state to filter on. When set, the other results are not displayed. @@ -331,7 +354,7 @@ paths: schema: anyOf: - type: string - - type: "null" + - type: 'null' title: Wandb Project required: false description: The Weights and Biases project to filter on. When set, the other results are not displayed. @@ -340,7 +363,7 @@ paths: schema: anyOf: - type: string - - type: "null" + - type: 'null' title: Wandb Name required: false description: The Weight and Biases run name to filter on. When set, the other results are not displayed. @@ -349,17 +372,17 @@ paths: schema: anyOf: - type: string - - type: "null" + - type: 'null' title: Suffix required: false description: The model suffix to filter on. When set, the other results are not displayed. responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/JobsOut" + $ref: '#/components/schemas/JobsOut' description: Get a list of fine-tuning jobs for your organization and user. tags: - fine-tuning @@ -372,7 +395,7 @@ paths: schema: anyOf: - type: boolean - - type: "null" + - type: 'null' title: Dry Run required: false description: | @@ -381,21 +404,21 @@ paths: * Otherwise, the job is started and the query returns the job ID along with some of the input parameters (see `JobOut` response). responses: - "200": + '200': description: OK content: application/json: schema: anyOf: - - $ref: "#/components/schemas/JobOut" - - $ref: "#/components/schemas/LegacyJobMetadataOut" + - $ref: '#/components/schemas/JobOut' + - $ref: '#/components/schemas/LegacyJobMetadataOut' title: Response description: Create a new fine-tuning job, it will be queued for processing. requestBody: content: application/json: schema: - $ref: "#/components/schemas/JobIn" + $ref: '#/components/schemas/JobIn' required: true tags: - fine-tuning @@ -413,12 +436,12 @@ paths: required: true description: The ID of the job to analyse. responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/DetailedJobOut" + $ref: '#/components/schemas/DetailedJobOut' description: Get a fine-tuned job details by its UUID. tags: - fine-tuning @@ -436,12 +459,12 @@ paths: required: true description: The ID of the job to cancel. responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/DetailedJobOut" + $ref: '#/components/schemas/DetailedJobOut' description: Request the cancellation of a fine tuning job. tags: - fine-tuning @@ -458,12 +481,12 @@ paths: type: string required: true responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/DetailedJobOut" + $ref: '#/components/schemas/DetailedJobOut' description: Request the start of a validated fine tuning job. tags: - fine-tuning @@ -481,18 +504,18 @@ paths: example: "ft:open-mistral-7b:587a6b29:20240514:7e773925" description: The ID of the model to update. responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/FTModelOut" + $ref: '#/components/schemas/FTModelOut' description: Update a model name or description. requestBody: content: application/json: schema: - $ref: "#/components/schemas/UpdateFTModelIn" + $ref: '#/components/schemas/UpdateFTModelIn' required: true tags: - models @@ -510,12 +533,12 @@ paths: example: "ft:open-mistral-7b:587a6b29:20240514:7e773925" description: The ID of the model to archive. responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/ArchiveFTModelOut" + $ref: '#/components/schemas/ArchiveFTModelOut' description: Archive a fine-tuned model. tags: - models @@ -532,12 +555,12 @@ paths: example: "ft:open-mistral-7b:587a6b29:20240514:7e773925" description: The ID of the model to unarchive. responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/UnarchiveFTModelOut" + $ref: '#/components/schemas/UnarchiveFTModelOut' description: Un-archive a fine-tuned model. tags: - models @@ -565,7 +588,7 @@ paths: schema: anyOf: - type: string - - type: "null" + - type: 'null' title: Model required: false - in: query @@ -574,7 +597,7 @@ paths: anyOf: - type: object additionalProperties: true - - type: "null" + - type: 'null' title: Metadata required: false - in: query @@ -583,7 +606,7 @@ paths: anyOf: - format: date-time type: string - - type: "null" + - type: 'null' title: Created After required: false - in: query @@ -597,16 +620,16 @@ paths: name: status schema: anyOf: - - $ref: "#/components/schemas/BatchJobStatus" - - type: "null" + - $ref: '#/components/schemas/BatchJobStatus' + - type: 'null' required: false responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/BatchJobsOut" + $ref: '#/components/schemas/BatchJobsOut' description: Get a list of batch jobs for your organization and user. tags: - batch @@ -614,18 +637,18 @@ paths: operationId: jobs_api_routes_batch_create_batch_job summary: Create Batch Job responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/BatchJobOut" + $ref: '#/components/schemas/BatchJobOut' description: Create a new batch job, it will be queued for processing. requestBody: content: application/json: schema: - $ref: "#/components/schemas/BatchJobIn" + $ref: '#/components/schemas/BatchJobIn' required: true tags: - batch @@ -642,12 +665,12 @@ paths: type: string required: true responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/BatchJobOut" + $ref: '#/components/schemas/BatchJobOut' description: Get a batch job details by its UUID. tags: - batch @@ -664,12 +687,12 @@ paths: type: string required: true responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/BatchJobOut" + $ref: '#/components/schemas/BatchJobOut' description: Request the cancellation of a batch job. tags: - batch @@ -682,22 +705,22 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ChatCompletionRequest" + $ref: '#/components/schemas/ChatCompletionRequest' responses: - "200": + '200': description: Successful Response content: application/json: - schema: { $ref: "#/components/schemas/ChatCompletionResponse" } + schema: {$ref: "#/components/schemas/ChatCompletionResponse"} text/event-stream: schema: $ref: "#/components/schemas/CompletionEvent" - "422": + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - chat /v1/fim/completions: @@ -710,22 +733,22 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/FIMCompletionRequest" + $ref: '#/components/schemas/FIMCompletionRequest' responses: - "200": + '200': description: Successful Response content: application/json: - schema: { $ref: "#/components/schemas/FIMCompletionResponse" } + schema: {$ref: "#/components/schemas/FIMCompletionResponse"} text/event-stream: schema: $ref: "#/components/schemas/CompletionEvent" - "422": + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - fim /v1/agents/completions: @@ -737,44 +760,44 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/AgentsCompletionRequest" + $ref: '#/components/schemas/AgentsCompletionRequest' responses: - "200": + '200': description: Successful Response content: application/json: - schema: { $ref: "#/components/schemas/ChatCompletionResponse" } - "422": + schema: {$ref: "#/components/schemas/ChatCompletionResponse"} + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - agents /v1/embeddings: post: summary: Embeddings - description: "Embeddings" + description: 'Embeddings' operationId: embeddings_v1_embeddings_post requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/EmbeddingRequest" + $ref: '#/components/schemas/EmbeddingRequest' responses: - "200": + '200': description: Successful Response content: application/json: - schema: { $ref: "#/components/schemas/EmbeddingResponse" } - "422": + schema: {$ref: "#/components/schemas/EmbeddingResponse"} + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - embeddings /v1/moderations: @@ -786,19 +809,19 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ClassificationRequest" + $ref: '#/components/schemas/ClassificationRequest' responses: - "200": + '200': description: Successful Response content: application/json: - schema: { $ref: "#/components/schemas/ClassificationResponse" } - "422": + schema: {$ref: "#/components/schemas/ClassificationResponse"} + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - classifiers /v1/chat/moderations: @@ -810,19 +833,19 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ChatClassificationRequest" + $ref: '#/components/schemas/ChatClassificationRequest' responses: - "200": + '200': description: Successful Response content: application/json: - schema: { $ref: "#/components/schemas/ClassificationResponse" } - "422": + schema: {$ref: "#/components/schemas/ClassificationResponse"} + '422': description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' tags: - classifiers components: @@ -844,16 +867,16 @@ components: title: Owned By default: mistralai capabilities: - $ref: "#/components/schemas/ModelCapabilities" + $ref: '#/components/schemas/ModelCapabilities' name: anyOf: - type: string - - type: "null" + - type: 'null' title: Name description: anyOf: - type: string - - type: "null" + - type: 'null' title: Description max_context_length: type: integer @@ -869,12 +892,12 @@ components: anyOf: - type: string format: date-time - - type: "null" + - type: 'null' title: Deprecation default_model_temperature: anyOf: - type: number - - type: "null" + - type: 'null' title: Default Model Temperature type: type: string @@ -929,16 +952,16 @@ components: title: Owned By default: mistralai capabilities: - $ref: "#/components/schemas/ModelCapabilities" + $ref: '#/components/schemas/ModelCapabilities' name: anyOf: - type: string - - type: "null" + - type: 'null' title: Name description: anyOf: - type: string - - type: "null" + - type: 'null' title: Description max_context_length: type: integer @@ -954,12 +977,12 @@ components: anyOf: - type: string format: date-time - - type: "null" + - type: 'null' title: Deprecation default_model_temperature: anyOf: - type: number - - type: "null" + - type: 'null' title: Default Model Temperature type: type: string @@ -990,7 +1013,7 @@ components: properties: detail: items: - $ref: "#/components/schemas/ValidationError" + $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object @@ -1028,13 +1051,13 @@ components: data: items: oneOf: - - $ref: "#/components/schemas/BaseModelCard" - - $ref: "#/components/schemas/FTModelCard" + - $ref: '#/components/schemas/BaseModelCard' + - $ref: '#/components/schemas/FTModelCard' discriminator: propertyName: type mapping: - base: "#/components/schemas/BaseModelCard" - fine-tuned: "#/components/schemas/FTModelCard" + base: '#/components/schemas/BaseModelCard' + fine-tuned: '#/components/schemas/FTModelCard' type: array title: Data type: object @@ -1061,20 +1084,20 @@ components: - type title: ValidationError FilePurpose: + title: FilePurpose + type: string enum: - fine-tune - batch - title: FilePurpose - type: string SampleType: + title: SampleType + type: string enum: - pretrain - instruct - batch_request - batch_result - batch_error - title: SampleType - type: string Source: enum: - upload @@ -1116,19 +1139,19 @@ components: examples: - files_upload.jsonl purpose: - $ref: "#/components/schemas/FilePurpose" + $ref: '#/components/schemas/FilePurpose' description: The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. examples: - fine-tune sample_type: - $ref: "#/components/schemas/SampleType" + $ref: '#/components/schemas/SampleType' num_lines: anyOf: - type: integer - - type: "null" + - type: 'null' title: Num Lines source: - $ref: "#/components/schemas/Source" + $ref: '#/components/schemas/Source' required: - id - object @@ -1174,19 +1197,19 @@ components: examples: - files_upload.jsonl purpose: - $ref: "#/components/schemas/FilePurpose" + $ref: '#/components/schemas/FilePurpose' description: The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. examples: - fine-tune sample_type: - $ref: "#/components/schemas/SampleType" + $ref: '#/components/schemas/SampleType' num_lines: anyOf: - type: integer - - type: "null" + - type: 'null' title: Num Lines source: - $ref: "#/components/schemas/Source" + $ref: '#/components/schemas/Source' required: - id - object @@ -1202,7 +1225,7 @@ components: properties: data: items: - $ref: "#/components/schemas/FileSchema" + $ref: '#/components/schemas/FileSchema' title: Data type: array object: @@ -1251,19 +1274,19 @@ components: examples: - files_upload.jsonl purpose: - $ref: "#/components/schemas/FilePurpose" + $ref: '#/components/schemas/FilePurpose' description: The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. examples: - fine-tune sample_type: - $ref: "#/components/schemas/SampleType" + $ref: '#/components/schemas/SampleType' num_lines: anyOf: - type: integer - - type: "null" + - type: 'null' title: Num Lines source: - $ref: "#/components/schemas/Source" + $ref: '#/components/schemas/Source' deleted: title: Deleted type: boolean @@ -1306,6 +1329,15 @@ components: - deleted title: DeleteFileOut type: object + FileSignedURL: + properties: + url: + title: Url + type: string + required: + - url + title: FileSignedURL + type: object FineTuneableModel: enum: - open-mistral-7b @@ -1313,6 +1345,7 @@ components: - codestral-latest - mistral-large-latest - open-mistral-nemo + - ministral-3b-latest title: FineTuneableModel type: string description: The name of the model to fine-tune. @@ -1334,7 +1367,7 @@ components: ref: anyOf: - type: string - - type: "null" + - type: 'null' title: Ref weight: default: 1.0 @@ -1357,37 +1390,37 @@ components: expected_duration_seconds: anyOf: - type: integer - - type: "null" + - type: 'null' title: Expected Duration Seconds cost: anyOf: - type: number - - type: "null" + - type: 'null' title: Cost cost_currency: anyOf: - type: string - - type: "null" + - type: 'null' title: Cost Currency train_tokens_per_step: anyOf: - type: integer - - type: "null" + - type: 'null' title: Train Tokens Per Step train_tokens: anyOf: - type: integer - - type: "null" + - type: 'null' title: Train Tokens data_tokens: anyOf: - type: integer - - type: "null" + - type: 'null' title: Data Tokens estimated_start_time: anyOf: - type: integer - - type: "null" + - type: 'null' title: Estimated Start Time title: JobMetadataOut type: object @@ -1402,9 +1435,9 @@ components: title: Auto Start type: boolean hyperparameters: - $ref: "#/components/schemas/TrainingParameters" + $ref: '#/components/schemas/TrainingParameters' model: - $ref: "#/components/schemas/FineTuneableModel" + $ref: '#/components/schemas/FineTuneableModel' status: enum: - QUEUED @@ -1445,7 +1478,7 @@ components: format: uuid type: string type: array - - type: "null" + - type: 'null' default: [] title: Validation Files description: A list containing the IDs of uploaded files that contain validation data. @@ -1460,13 +1493,13 @@ components: fine_tuned_model: anyOf: - type: string - - type: "null" + - type: 'null' title: Fine Tuned Model description: The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. suffix: anyOf: - type: string - - type: "null" + - type: 'null' title: Suffix description: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. integrations: @@ -1474,18 +1507,18 @@ components: - items: discriminator: mapping: - wandb: "#/components/schemas/WandbIntegrationOut" + wandb: '#/components/schemas/WandbIntegrationOut' propertyName: type oneOf: - - $ref: "#/components/schemas/WandbIntegrationOut" + - $ref: '#/components/schemas/WandbIntegrationOut' type: array - - type: "null" + - type: 'null' title: Integrations description: A list of integrations enabled for your fine-tuning job. trained_tokens: anyOf: - type: integer - - type: "null" + - type: 'null' title: Trained Tokens description: Total number of tokens trained. repositories: @@ -1493,17 +1526,16 @@ components: items: discriminator: mapping: - github: "#/components/schemas/GithubRepositoryOut" + github: '#/components/schemas/GithubRepositoryOut' propertyName: type oneOf: - - $ref: "#/components/schemas/GithubRepositoryOut" - maxItems: 20 + - $ref: '#/components/schemas/GithubRepositoryOut' title: Repositories type: array metadata: anyOf: - - $ref: "#/components/schemas/JobMetadataOut" - - type: "null" + - $ref: '#/components/schemas/JobMetadataOut' + - type: 'null' required: - id - auto_start @@ -1521,7 +1553,7 @@ components: data: default: [] items: - $ref: "#/components/schemas/JobOut" + $ref: '#/components/schemas/JobOut' title: Data type: array object: @@ -1544,7 +1576,7 @@ components: anyOf: - minimum: 1 type: integer - - type: "null" + - type: 'null' title: Training Steps learning_rate: default: 0.0001 @@ -1557,7 +1589,7 @@ components: - maximum: 1 minimum: 0 type: number - - type: "null" + - type: 'null' default: 0.1 title: Weight Decay warmup_fraction: @@ -1565,28 +1597,28 @@ components: - maximum: 1 minimum: 0 type: number - - type: "null" + - type: 'null' default: 0.05 title: Warmup Fraction epochs: anyOf: - exclusiveMinimum: 0 type: number - - type: "null" + - type: 'null' title: Epochs fim_ratio: anyOf: - maximum: 1 minimum: 0 type: number - - type: "null" + - type: 'null' default: 0.9 title: Fim Ratio seq_len: anyOf: - minimum: 100 type: integer - - type: "null" + - type: 'null' title: Seq Len title: TrainingParameters type: object @@ -1606,13 +1638,13 @@ components: name: anyOf: - type: string - - type: "null" + - type: 'null' title: Name description: A display name to set for the run. If not set, will use the job ID as the name. run_name: anyOf: - type: string - - type: "null" + - type: 'null' title: Run Name required: - project @@ -1623,7 +1655,7 @@ components: expected_duration_seconds: anyOf: - type: integer - - type: "null" + - type: 'null' title: Expected Duration Seconds description: The approximated time (in seconds) for the fine-tuning process to complete. examples: @@ -1631,7 +1663,7 @@ components: cost: anyOf: - type: number - - type: "null" + - type: 'null' title: Cost description: The cost of the fine-tuning job. examples: @@ -1639,7 +1671,7 @@ components: cost_currency: anyOf: - type: string - - type: "null" + - type: 'null' title: Cost Currency description: The currency used for the fine-tuning job cost. examples: @@ -1647,7 +1679,7 @@ components: train_tokens_per_step: anyOf: - type: integer - - type: "null" + - type: 'null' title: Train Tokens Per Step description: The number of tokens consumed by one training step. examples: @@ -1655,7 +1687,7 @@ components: train_tokens: anyOf: - type: integer - - type: "null" + - type: 'null' title: Train Tokens description: The total number of tokens used during the fine-tuning process. examples: @@ -1663,7 +1695,7 @@ components: data_tokens: anyOf: - type: integer - - type: "null" + - type: 'null' title: Data Tokens description: The total number of tokens in the training dataset. examples: @@ -1671,7 +1703,7 @@ components: estimated_start_time: anyOf: - type: integer - - type: "null" + - type: 'null' title: Estimated Start Time deprecated: default: true @@ -1683,7 +1715,7 @@ components: epochs: anyOf: - type: number - - type: "null" + - type: 'null' title: Epochs description: The number of complete passes through the entire training dataset. examples: @@ -1691,7 +1723,7 @@ components: training_steps: anyOf: - type: integer - - type: "null" + - type: 'null' title: Training Steps description: The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. examples: @@ -1725,7 +1757,7 @@ components: ref: anyOf: - type: string - - type: "null" + - type: 'null' title: Ref weight: default: 1.0 @@ -1744,11 +1776,11 @@ components: JobIn: properties: model: - $ref: "#/components/schemas/FineTuneableModel" + $ref: '#/components/schemas/FineTuneableModel' training_files: default: [] items: - $ref: "#/components/schemas/TrainingFile" + $ref: '#/components/schemas/TrainingFile' title: Training Files type: array validation_files: @@ -1757,16 +1789,16 @@ components: format: uuid type: string type: array - - type: "null" + - type: 'null' title: Validation Files description: "A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files." hyperparameters: - $ref: "#/components/schemas/TrainingParametersIn" + $ref: '#/components/schemas/TrainingParametersIn' suffix: anyOf: - maxLength: 18 type: string - - type: "null" + - type: 'null' title: Suffix description: 'A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...`' integrations: @@ -1774,12 +1806,12 @@ components: - items: discriminator: mapping: - wandb: "#/components/schemas/WandbIntegration" + wandb: '#/components/schemas/WandbIntegration' propertyName: type oneOf: - - $ref: "#/components/schemas/WandbIntegration" + - $ref: '#/components/schemas/WandbIntegration' type: array - - type: "null" + - type: 'null' title: Integrations description: A list of integrations to enable for your fine-tuning job. repositories: @@ -1787,10 +1819,11 @@ components: items: discriminator: mapping: - github: "#/components/schemas/GithubRepositoryIn" + github: '#/components/schemas/GithubRepositoryIn' propertyName: type oneOf: - - $ref: "#/components/schemas/GithubRepositoryIn" + - $ref: '#/components/schemas/GithubRepositoryIn' + maxItems: 50 title: Repositories type: array auto_start: @@ -1823,7 +1856,7 @@ components: anyOf: - minimum: 1 type: integer - - type: "null" + - type: 'null' title: Training Steps description: "The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset." learning_rate: @@ -1838,7 +1871,7 @@ components: - maximum: 1 minimum: 0 type: number - - type: "null" + - type: 'null' default: 0.1 title: Weight Decay description: "(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large." @@ -1847,7 +1880,7 @@ components: - maximum: 1 minimum: 0 type: number - - type: "null" + - type: 'null' default: 0.05 title: Warmup Fraction description: "(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)" @@ -1855,21 +1888,21 @@ components: anyOf: - exclusiveMinimum: 0 type: number - - type: "null" + - type: 'null' title: Epochs fim_ratio: anyOf: - maximum: 1 minimum: 0 type: number - - type: "null" + - type: 'null' default: 0.9 title: Fim Ratio seq_len: anyOf: - minimum: 100 type: integer - - type: "null" + - type: 'null' title: Seq Len title: TrainingParametersIn type: object @@ -1890,7 +1923,7 @@ components: name: anyOf: - type: string - - type: "null" + - type: 'null' title: Name description: A display name to set for the run. If not set, will use the job ID as the name. api_key: @@ -1902,7 +1935,7 @@ components: run_name: anyOf: - type: string - - type: "null" + - type: 'null' title: Run Name required: - project @@ -1912,7 +1945,7 @@ components: CheckpointOut: properties: metrics: - $ref: "#/components/schemas/MetricOut" + $ref: '#/components/schemas/MetricOut' step_number: title: Step Number type: integer @@ -1939,9 +1972,9 @@ components: title: Auto Start type: boolean hyperparameters: - $ref: "#/components/schemas/TrainingParameters" + $ref: '#/components/schemas/TrainingParameters' model: - $ref: "#/components/schemas/FineTuneableModel" + $ref: '#/components/schemas/FineTuneableModel' status: enum: - QUEUED @@ -1977,7 +2010,7 @@ components: format: uuid type: string type: array - - type: "null" + - type: 'null' default: [] title: Validation Files object: @@ -1990,57 +2023,56 @@ components: fine_tuned_model: anyOf: - type: string - - type: "null" + - type: 'null' title: Fine Tuned Model suffix: anyOf: - type: string - - type: "null" + - type: 'null' title: Suffix integrations: anyOf: - items: discriminator: mapping: - wandb: "#/components/schemas/WandbIntegrationOut" + wandb: '#/components/schemas/WandbIntegrationOut' propertyName: type oneOf: - - $ref: "#/components/schemas/WandbIntegrationOut" + - $ref: '#/components/schemas/WandbIntegrationOut' type: array - - type: "null" + - type: 'null' title: Integrations trained_tokens: anyOf: - type: integer - - type: "null" + - type: 'null' title: Trained Tokens repositories: default: [] items: discriminator: mapping: - github: "#/components/schemas/GithubRepositoryOut" + github: '#/components/schemas/GithubRepositoryOut' propertyName: type oneOf: - - $ref: "#/components/schemas/GithubRepositoryOut" - maxItems: 20 + - $ref: '#/components/schemas/GithubRepositoryOut' title: Repositories type: array metadata: anyOf: - - $ref: "#/components/schemas/JobMetadataOut" - - type: "null" + - $ref: '#/components/schemas/JobMetadataOut' + - type: 'null' events: default: [] items: - $ref: "#/components/schemas/EventOut" + $ref: '#/components/schemas/EventOut' title: Events type: array description: "Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here." checkpoints: default: [] items: - $ref: "#/components/schemas/CheckpointOut" + $ref: '#/components/schemas/CheckpointOut' title: Checkpoints type: array required: @@ -2065,7 +2097,7 @@ components: anyOf: - type: object additionalProperties: true - - type: "null" + - type: 'null' title: Data created_at: title: Created At @@ -2081,17 +2113,17 @@ components: train_loss: anyOf: - type: number - - type: "null" + - type: 'null' title: Train Loss valid_loss: anyOf: - type: number - - type: "null" + - type: 'null' title: Valid Loss valid_mean_token_accuracy: anyOf: - type: number - - type: "null" + - type: 'null' title: Valid Mean Token Accuracy title: MetricOut type: object @@ -2143,15 +2175,15 @@ components: name: anyOf: - type: string - - type: "null" + - type: 'null' title: Name description: anyOf: - type: string - - type: "null" + - type: 'null' title: Description capabilities: - $ref: "#/components/schemas/FTModelCapabilitiesOut" + $ref: '#/components/schemas/FTModelCapabilitiesOut' max_context_length: default: 32768 title: Max Context Length @@ -2181,12 +2213,12 @@ components: name: anyOf: - type: string - - type: "null" + - type: 'null' title: Name description: anyOf: - type: string - - type: "null" + - type: 'null' title: Description title: UpdateFTModelIn type: object @@ -2276,7 +2308,7 @@ components: anyOf: - type: object additionalProperties: true - - type: "null" + - type: 'null' title: Metadata endpoint: title: Endpoint @@ -2288,21 +2320,21 @@ components: anyOf: - format: uuid type: string - - type: "null" + - type: 'null' title: Output File error_file: anyOf: - format: uuid type: string - - type: "null" + - type: 'null' title: Error File errors: items: - $ref: "#/components/schemas/BatchError" + $ref: '#/components/schemas/BatchError' title: Errors type: array status: - $ref: "#/components/schemas/BatchJobStatus" + $ref: '#/components/schemas/BatchJobStatus' created_at: title: Created At type: integer @@ -2321,12 +2353,12 @@ components: started_at: anyOf: - type: integer - - type: "null" + - type: 'null' title: Started At completed_at: anyOf: - type: integer - - type: "null" + - type: 'null' title: Completed At required: - id @@ -2347,7 +2379,7 @@ components: data: default: [] items: - $ref: "#/components/schemas/BatchJobOut" + $ref: '#/components/schemas/BatchJobOut' title: Data type: array object: @@ -2365,13 +2397,14 @@ components: title: BatchJobsOut type: object ApiEndpoint: + title: ApiEndpoint + type: string enum: - /v1/chat/completions - /v1/embeddings - /v1/fim/completions - /v1/moderations - title: ApiEndpoint - type: string + - /v1/chat/moderations BatchJobIn: properties: input_files: @@ -2381,7 +2414,7 @@ components: title: Input Files type: array endpoint: - $ref: "#/components/schemas/ApiEndpoint" + $ref: '#/components/schemas/ApiEndpoint' model: title: Model type: string @@ -2392,7 +2425,7 @@ components: minLength: 1 type: string type: object - - type: "null" + - type: 'null' title: Metadata timeout_hours: default: 24 @@ -2417,9 +2450,9 @@ components: tool_calls: anyOf: - items: - $ref: "#/components/schemas/ToolCall" + $ref: '#/components/schemas/ToolCall' type: array - - type: "null" + - type: 'null' title: Tool Calls prefix: type: boolean @@ -2439,7 +2472,7 @@ components: model: anyOf: - type: string - - type: "null" + - type: 'null' title: Model description: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. examples: @@ -2449,7 +2482,7 @@ components: - type: number maximum: 1.5 minimum: 0 - - type: "null" + - type: 'null' title: Temperature description: "What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value." top_p: @@ -2463,7 +2496,7 @@ components: anyOf: - type: integer minimum: 0 - - type: "null" + - type: 'null' title: Max Tokens description: "The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length." stream: @@ -2483,46 +2516,41 @@ components: anyOf: - type: integer minimum: 0 - - type: "null" + - type: 'null' title: Random Seed description: The seed to use for random sampling. If set, different calls will generate deterministic results. messages: items: oneOf: - - $ref: "#/components/schemas/SystemMessage" - - $ref: "#/components/schemas/UserMessage" - - $ref: "#/components/schemas/AssistantMessage" - - $ref: "#/components/schemas/ToolMessage" + - $ref: '#/components/schemas/SystemMessage' + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/AssistantMessage' + - $ref: '#/components/schemas/ToolMessage' discriminator: propertyName: role mapping: - assistant: "#/components/schemas/AssistantMessage" - system: "#/components/schemas/SystemMessage" - tool: "#/components/schemas/ToolMessage" - user: "#/components/schemas/UserMessage" + assistant: '#/components/schemas/AssistantMessage' + system: '#/components/schemas/SystemMessage' + tool: '#/components/schemas/ToolMessage' + user: '#/components/schemas/UserMessage' type: array title: Messages description: The prompt(s) to generate completions for, encoded as a list of dict with role and content. examples: - - [ - { - "role": "user", - "content": "Who is the best French painter? Answer in one short sentence.", - }, - ] + - [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}] response_format: - $ref: "#/components/schemas/ResponseFormat" + $ref: '#/components/schemas/ResponseFormat' tools: anyOf: - items: - $ref: "#/components/schemas/Tool" + $ref: '#/components/schemas/Tool' type: array - - type: "null" + - type: 'null' title: Tools tool_choice: anyOf: - - $ref: "#/components/schemas/ToolChoice" - - $ref: "#/components/schemas/ToolChoiceEnum" + - $ref: '#/components/schemas/ToolChoice' + - $ref: '#/components/schemas/ToolChoiceEnum' title: Tool Choice default: auto presence_penalty: @@ -2543,9 +2571,15 @@ components: anyOf: - type: integer minimum: 1 - - type: "null" + - type: 'null' title: N description: Number of completions to return for each request, input tokens are only billed once. + prediction: + $ref: '#/components/schemas/Prediction' + default: + type: content + content: '' + description: "Enable users to specify expected results, optimizing response times by leveraging known or predictable content. This approach is especially effective for updating text documents or code files with minimal changes, reducing latency while maintaining high-quality results." safe_prompt: type: boolean description: Whether to inject a safety prompt before all conversations. @@ -2561,7 +2595,7 @@ components: model: anyOf: - type: string - - type: "null" + - type: 'null' title: Model default: codestral-2405 description: "ID of the model to use. Only compatible for now with:\n - `codestral-2405`\n - `codestral-latest`" @@ -2572,7 +2606,7 @@ components: - type: number maximum: 1.5 minimum: 0 - - type: "null" + - type: 'null' title: Temperature description: "What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value." top_p: @@ -2586,7 +2620,7 @@ components: anyOf: - type: integer minimum: 0 - - type: "null" + - type: 'null' title: Max Tokens description: "The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length." stream: @@ -2606,7 +2640,7 @@ components: anyOf: - type: integer minimum: 0 - - type: "null" + - type: 'null' title: Random Seed description: The seed to use for random sampling. If set, different calls will generate deterministic results. prompt: @@ -2618,9 +2652,9 @@ components: suffix: anyOf: - type: string - - type: "null" + - type: 'null' title: Suffix - default: "" + default: '' description: "Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`." examples: - return a+b @@ -2628,7 +2662,7 @@ components: anyOf: - type: integer minimum: 0 - - type: "null" + - type: 'null' title: Min Tokens description: The minimum number of tokens to generate in the completion. additionalProperties: false @@ -2645,7 +2679,11 @@ components: description: type: string title: Description - default: "" + default: '' + strict: + type: boolean + title: Strict + default: false parameters: type: object title: Parameters @@ -2701,38 +2739,52 @@ components: title: ImageURL ImageURLChunk: properties: + image_url: + anyOf: + - $ref: '#/components/schemas/ImageURL' + - type: string + title: Image Url type: type: string enum: - image_url - const: image_url title: Type default: image_url - image_url: - anyOf: - - $ref: "#/components/schemas/ImageURL" - - type: string - title: Image Url additionalProperties: false type: object required: - image_url title: ImageURLChunk description: '{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0' - ReferenceChunk: + Prediction: properties: type: type: string enum: - - reference - const: reference + - content + const: content title: Type - default: reference + default: content + content: + type: string + title: Content + default: '' + additionalProperties: false + type: object + title: Prediction + ReferenceChunk: + properties: reference_ids: items: type: integer type: array title: Reference Ids + type: + type: string + enum: + - reference + title: Type + default: reference additionalProperties: false type: object required: @@ -2741,25 +2793,25 @@ components: ResponseFormat: properties: type: - $ref: "#/components/schemas/ResponseFormats" + $ref: '#/components/schemas/ResponseFormats' default: text additionalProperties: false type: object title: ResponseFormat ResponseFormats: type: string + title: ResponseFormats + description: 'An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.' enum: - text - json_object - title: ResponseFormats - description: 'An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.' SystemMessage: properties: content: anyOf: - type: string - items: - $ref: "#/components/schemas/TextChunk" + $ref: '#/components/schemas/TextChunk' type: array title: Content role: @@ -2774,16 +2826,15 @@ components: title: SystemMessage TextChunk: properties: + text: + type: string + title: Text type: type: string enum: - text - const: text title: Type default: text - text: - type: string - title: Text additionalProperties: false type: object required: @@ -2792,10 +2843,10 @@ components: Tool: properties: type: - $ref: "#/components/schemas/ToolTypes" + $ref: '#/components/schemas/ToolTypes' default: function function: - $ref: "#/components/schemas/Function" + $ref: '#/components/schemas/Function' additionalProperties: false type: object required: @@ -2806,12 +2857,16 @@ components: id: type: string title: Id - default: "null" + default: 'null' type: - $ref: "#/components/schemas/ToolTypes" + $ref: '#/components/schemas/ToolTypes' default: function function: - $ref: "#/components/schemas/FunctionCall" + $ref: '#/components/schemas/FunctionCall' + index: + type: integer + title: Index + default: 0 additionalProperties: false type: object required: @@ -2820,10 +2875,10 @@ components: ToolChoice: properties: type: - $ref: "#/components/schemas/ToolTypes" + $ref: '#/components/schemas/ToolTypes' default: function function: - $ref: "#/components/schemas/FunctionName" + $ref: '#/components/schemas/FunctionName' additionalProperties: false type: object required: @@ -2851,12 +2906,12 @@ components: tool_call_id: anyOf: - type: string - - type: "null" + - type: 'null' title: Tool Call Id name: anyOf: - type: string - - type: "null" + - type: 'null' title: Name role: type: string @@ -2900,7 +2955,7 @@ components: anyOf: - type: integer minimum: 0 - - type: "null" + - type: 'null' title: Max Tokens description: "The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length." stream: @@ -2920,46 +2975,41 @@ components: anyOf: - type: integer minimum: 0 - - type: "null" + - type: 'null' title: Random Seed description: The seed to use for random sampling. If set, different calls will generate deterministic results. messages: items: oneOf: - - $ref: "#/components/schemas/SystemMessage" - - $ref: "#/components/schemas/UserMessage" - - $ref: "#/components/schemas/AssistantMessage" - - $ref: "#/components/schemas/ToolMessage" + - $ref: '#/components/schemas/SystemMessage' + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/AssistantMessage' + - $ref: '#/components/schemas/ToolMessage' discriminator: propertyName: role mapping: - assistant: "#/components/schemas/AssistantMessage" - system: "#/components/schemas/SystemMessage" - tool: "#/components/schemas/ToolMessage" - user: "#/components/schemas/UserMessage" + assistant: '#/components/schemas/AssistantMessage' + system: '#/components/schemas/SystemMessage' + tool: '#/components/schemas/ToolMessage' + user: '#/components/schemas/UserMessage' type: array title: Messages description: The prompt(s) to generate completions for, encoded as a list of dict with role and content. examples: - - [ - { - "role": "user", - "content": "Who is the best French painter? Answer in one short sentence.", - }, - ] + - [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}] response_format: - $ref: "#/components/schemas/ResponseFormat" + $ref: '#/components/schemas/ResponseFormat' tools: anyOf: - items: - $ref: "#/components/schemas/Tool" + $ref: '#/components/schemas/Tool' type: array - - type: "null" + - type: 'null' title: Tools tool_choice: anyOf: - - $ref: "#/components/schemas/ToolChoice" - - $ref: "#/components/schemas/ToolChoiceEnum" + - $ref: '#/components/schemas/ToolChoice' + - $ref: '#/components/schemas/ToolChoiceEnum' title: Tool Choice default: auto presence_penalty: @@ -2980,9 +3030,15 @@ components: anyOf: - type: integer minimum: 1 - - type: "null" + - type: 'null' title: N description: Number of completions to return for each request, input tokens are only billed once. + prediction: + $ref: '#/components/schemas/Prediction' + default: + type: content + content: '' + description: "Enable users to specify expected results, optimizing response times by leveraging known or predictable content. This approach is especially effective for updating text documents or code files with minimal changes, reducing latency while maintaining high-quality results." agent_id: type: string description: The ID of the agent to use for this completion. @@ -2994,13 +3050,15 @@ components: title: AgentsCompletionRequest ContentChunk: oneOf: - - $ref: "#/components/schemas/TextChunk" + - $ref: '#/components/schemas/TextChunk' - $ref: "#/components/schemas/ImageURLChunk" + - $ref: "#/components/schemas/ReferenceChunk" discriminator: propertyName: type mapping: image_url: "#/components/schemas/ImageURLChunk" text: "#/components/schemas/TextChunk" + reference: "#/components/schemas/ReferenceChunk" title: ContentChunk EmbeddingRequest: properties: @@ -3021,7 +3079,7 @@ components: encoding_format: anyOf: - type: string - - type: "null" + - type: 'null' title: Encoding Format description: The format to return the embeddings in. default: float @@ -3037,32 +3095,32 @@ components: anyOf: - items: oneOf: - - $ref: "#/components/schemas/SystemMessage" - - $ref: "#/components/schemas/UserMessage" - - $ref: "#/components/schemas/AssistantMessage" - - $ref: "#/components/schemas/ToolMessage" + - $ref: '#/components/schemas/SystemMessage' + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/AssistantMessage' + - $ref: '#/components/schemas/ToolMessage' discriminator: propertyName: role mapping: - assistant: "#/components/schemas/AssistantMessage" - system: "#/components/schemas/SystemMessage" - tool: "#/components/schemas/ToolMessage" - user: "#/components/schemas/UserMessage" + assistant: '#/components/schemas/AssistantMessage' + system: '#/components/schemas/SystemMessage' + tool: '#/components/schemas/ToolMessage' + user: '#/components/schemas/UserMessage' type: array - items: items: oneOf: - - $ref: "#/components/schemas/SystemMessage" - - $ref: "#/components/schemas/UserMessage" - - $ref: "#/components/schemas/AssistantMessage" - - $ref: "#/components/schemas/ToolMessage" + - $ref: '#/components/schemas/SystemMessage' + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/AssistantMessage' + - $ref: '#/components/schemas/ToolMessage' discriminator: propertyName: role mapping: - assistant: "#/components/schemas/AssistantMessage" - system: "#/components/schemas/SystemMessage" - tool: "#/components/schemas/ToolMessage" - user: "#/components/schemas/UserMessage" + assistant: '#/components/schemas/AssistantMessage' + system: '#/components/schemas/SystemMessage' + tool: '#/components/schemas/ToolMessage' + user: '#/components/schemas/UserMessage' type: array type: array title: Input @@ -3070,7 +3128,7 @@ components: model: anyOf: - type: string - - type: "null" + - type: 'null' title: Model additionalProperties: false type: object @@ -3091,7 +3149,7 @@ components: model: anyOf: - type: string - - type: "null" + - type: 'null' title: Model additionalProperties: false type: object @@ -3221,11 +3279,7 @@ components: index: type: integer example: 0 - example: - [ - { "object": "embedding", "embedding": [0.1, 0.2, 0.3], "index": 0 }, - { "object": "embedding", "embedding": [0.4, 0.5, 0.6], "index": 1 }, - ] + examples: [{"object": "embedding", "embedding": [0.1, 0.2, 0.3], "index": 0}, {"object": "embedding", "embedding": [0.4, 0.5, 0.6], "index": 1}] EmbeddingResponse: allOf: - $ref: "#/components/schemas/ResponseBase" diff --git a/version.txt b/version.txt index d1993ec..c8fe2be 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.0.111 +v0.0.15