聊天补全
授权
请求体模式: application/json必需
model 必需 | |
Temperature (数字) 或 Temperature (null) (Temperature) 要使用的采样温度,我们建议在 0.0 到 0.7 之间。较高的值(例如 0.7)会使输出更随机,而较低的值(例如 0.2)会使其更集中和确定。我们通常建议更改此参数或 | |
top_p | number (Top P) [ 0 .. 1 ] 默认值: 1 核采样,模型考虑具有 |
Max Tokens (整数) 或 Max Tokens (null) (Max Tokens) 在补全中生成的最大 token 数量。您的提示 token 计数加上 | |
stream | boolean (流式) 默认值: false 是否流式返回部分进度。如果设置,token 可用时将作为仅数据服务器端事件发送,流将以 data: [DONE] 消息终止。否则,服务器将保持请求打开直到超时或完成,响应将包含完整的 JSON 结果。 |
Stop (字符串) 或 Stop 数组 (字符串) (Stop) 如果检测到此 token 则停止生成。或者在提供数组时检测到这些 token 中的一个 | |
Random Seed (整数) 或 Random Seed (null) (Random Seed) 用于随机采样的种子。如果设置,不同的调用将生成确定的结果。 | |
必需 | Array of any (消息) 要生成补全的提示,编码为包含 role 和 content 的字典列表。 |
object (响应格式) | |
Tools 数组 (对象) 或 Tools (null) (工具) | |
ToolChoice (对象) 或 ToolChoiceEnum (字符串) (工具选择) 默认值: "auto" | |
presence_penalty | number (存在惩罚) [ -2 .. 2 ] 默认值: 0 presence_penalty 决定模型对单词或短语重复的惩罚程度。较高的存在惩罚鼓励模型使用更广泛的单词和短语,使输出更加多样化和富有创意。 |
frequency_penalty | number (频率惩罚) [ -2 .. 2 ] 默认值: 0 frequency_penalty 根据单词在生成文本中的频率来惩罚单词的重复。较高的频率惩罚阻止模型重复在输出中已频繁出现的单词,促进多样性并减少重复。 |
N (整数) 或 N (null) (N) 每个请求返回的补全数量,输入 token 只计费一次。 | |
object (预测) 默认值: {"type":"content","content":""} 允许用户指定预期结果,通过利用已知或可预测的内容来优化响应时间。这种方法对于以最小改动更新文本文档或代码文件特别有效,可减少延迟同时保持高质量结果。 | |
parallel_tool_calls | boolean (并行工具调用) 默认值: true |
safe_prompt | boolean 默认值: false 是否在所有对话前注入安全提示。 |
响应
请求示例
- 负载
{- "model": "mistral-small-latest",
- "temperature": 1.5,
- "top_p": 1,
- "max_tokens": 0,
- "stream": false,
- "stop": "string",
- "random_seed": 0,
- "messages": [
- {
- "role": "user",
- "content": "Who is the best French painter? Answer in one short sentence."
}
], - "response_format": {
- "type": "text",
- "json_schema": {
- "name": "string",
- "description": "string",
- "schema": { },
- "strict": false
}
}, - "tools": [
- {
- "type": "function",
- "function": {
- "name": "string",
- "description": "",
- "strict": false,
- "parameters": { }
}
}
], - "tool_choice": "auto",
- "presence_penalty": 0,
- "frequency_penalty": 0,
- "n": 1,
- "prediction": {
- "type": "content",
- "content": ""
}, - "parallel_tool_calls": true,
- "safe_prompt": false
}
响应示例
- 200
- 422
{- "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
- "object": "chat.completion",
- "model": "mistral-small-latest",
- "usage": {
- "prompt_tokens": 16,
- "completion_tokens": 34,
- "total_tokens": 50
}, - "created": 1702256327,
- "choices": [
- {
- "index": 0,
- "message": {
- "content": "string",
- "tool_calls": [
- {
- "id": "null",
- "type": "function",
- "function": {
- "name": "string",
- "arguments": { }
}, - "index": 0
}
], - "prefix": false,
- "role": "assistant"
}, - "finish_reason": "stop"
}
]
}
Fim 补全
FIM 补全。
授权
请求体模式: application/json必需
model 必需 | string (模型) 默认值: "codestral-2405" 要使用的模型 ID。目前仅兼容
|
Temperature (数字) 或 Temperature (null) (Temperature) 要使用的采样温度,我们建议在 0.0 到 0.7 之间。较高的值(例如 0.7)会使输出更随机,而较低的值(例如 0.2)会使其更集中和确定。我们通常建议更改此参数或 | |
top_p | number (Top P) [ 0 .. 1 ] 默认值: 1 核采样,模型考虑具有 |
Max Tokens (整数) 或 Max Tokens (null) (Max Tokens) 在补全中生成的最大 token 数量。您的提示 token 计数加上 | |
stream | boolean (流式) 默认值: false 是否流式返回部分进度。如果设置,token 可用时将作为仅数据服务器端事件发送,流将以 data: [DONE] 消息终止。否则,服务器将保持请求打开直到超时或完成,响应将包含完整的 JSON 结果。 |
Stop (字符串) 或 Stop 数组 (字符串) (Stop) 如果检测到此 token 则停止生成。或者在提供数组时检测到这些 token 中的一个 | |
Random Seed (整数) 或 Random Seed (null) (Random Seed) 用于随机采样的种子。如果设置,不同的调用将生成确定的结果。 | |
prompt 必需 | string (提示) 要补全的文本/代码。 |
Suffix (字符串) 或 Suffix (null) (后缀) 默认值: "" 可选的文本/代码,为模型添加更多上下文。当给定 | |
Min Tokens (整数) 或 Min Tokens (null) (最小 Token 数) 在补全中生成的最小 token 数量。 |
响应
请求示例
- 负载
{- "model": "codestral-2405",
- "temperature": 1.5,
- "top_p": 1,
- "max_tokens": 0,
- "stream": false,
- "stop": "string",
- "random_seed": 0,
- "prompt": "def",
- "suffix": "return a+b",
- "min_tokens": 0
}
响应示例
- 200
- 422
{- "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
- "object": "chat.completion",
- "model": "codestral-latest",
- "usage": {
- "prompt_tokens": 16,
- "completion_tokens": 34,
- "total_tokens": 50
}, - "created": 1702256327,
- "choices": [
- {
- "index": 0,
- "message": {
- "content": "string",
- "tool_calls": [
- {
- "id": "null",
- "type": "function",
- "function": {
- "name": "string",
- "arguments": { }
}, - "index": 0
}
], - "prefix": false,
- "role": "assistant"
}, - "finish_reason": "stop"
}
]
}
Agent 补全
授权
请求体模式: application/json必需
Max Tokens (整数) 或 Max Tokens (null) (Max Tokens) 在补全中生成的最大 token 数量。您的提示 token 计数加上 | |
stream | boolean (流式) 默认值: false 是否流式返回部分进度。如果设置,token 可用时将作为仅数据服务器端事件发送,流将以 data: [DONE] 消息终止。否则,服务器将保持请求打开直到超时或完成,响应将包含完整的 JSON 结果。 |
Stop (字符串) 或 Stop 数组 (字符串) (Stop) 如果检测到此 token 则停止生成。或者在提供数组时检测到这些 token 中的一个 | |
Random Seed (整数) 或 Random Seed (null) (Random Seed) 用于随机采样的种子。如果设置,不同的调用将生成确定的结果。 | |
必需 | Array of any (消息) 要生成补全的提示,编码为包含 role 和 content 的字典列表。 |
object (响应格式) | |
Tools 数组 (对象) 或 Tools (null) (工具) | |
ToolChoice (对象) 或 ToolChoiceEnum (字符串) (工具选择) 默认值: "auto" | |
presence_penalty | number (存在惩罚) [ -2 .. 2 ] 默认值: 0 presence_penalty 决定模型对单词或短语重复的惩罚程度。较高的存在惩罚鼓励模型使用更广泛的单词和短语,使输出更加多样化和富有创意。 |
frequency_penalty | number (频率惩罚) [ -2 .. 2 ] 默认值: 0 frequency_penalty 根据单词在生成文本中的频率来惩罚单词的重复。较高的频率惩罚阻止模型重复在输出中已频繁出现的单词,促进多样性并减少重复。 |
N (整数) 或 N (null) (N) 每个请求返回的补全数量,输入 token 只计费一次。 | |
object (预测) 默认值: {"type":"content","content":""} 允许用户指定预期结果,通过利用已知或可预测的内容来优化响应时间。这种方法对于以最小改动更新文本文档或代码文件特别有效,可减少延迟同时保持高质量结果。 | |
parallel_tool_calls | boolean (并行工具调用) 默认值: true |
agent_id 必需 | string 用于此次补全的 Agent ID。 |
响应
请求示例
- 负载
{- "max_tokens": 0,
- "stream": false,
- "stop": "string",
- "random_seed": 0,
- "messages": [
- {
- "role": "user",
- "content": "Who is the best French painter? Answer in one short sentence."
}
], - "response_format": {
- "type": "text",
- "json_schema": {
- "name": "string",
- "description": "string",
- "schema": { },
- "strict": false
}
}, - "tools": [
- {
- "type": "function",
- "function": {
- "name": "string",
- "description": "",
- "strict": false,
- "parameters": { }
}
}
], - "tool_choice": "auto",
- "presence_penalty": 0,
- "frequency_penalty": 0,
- "n": 1,
- "prediction": {
- "type": "content",
- "content": ""
}, - "parallel_tool_calls": true,
- "agent_id": "string"
}
响应示例
- 200
- 422
{- "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
- "object": "chat.completion",
- "model": "mistral-small-latest",
- "usage": {
- "prompt_tokens": 16,
- "completion_tokens": 34,
- "total_tokens": 50
}, - "created": 1702256327,
- "choices": [
- {
- "index": 0,
- "message": {
- "content": "string",
- "tool_calls": [
- {
- "id": "null",
- "type": "function",
- "function": {
- "name": "string",
- "arguments": { }
}, - "index": 0
}
], - "prefix": false,
- "role": "assistant"
}, - "finish_reason": "stop"
}
]
}
嵌入
嵌入
授权
请求体模式: application/json必需
model 必需 | string (模型) 要使用的模型 ID。 |
必需 | Input (字符串) 或 Input 数组 (字符串) (输入) 要嵌入的文本。 |
响应
请求示例
- 负载
{- "model": "mistral-embed",
- "input": [
- "Embed this sentence.",
- "As well as this one."
]
}
响应示例
- 200
- 422
{- "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
- "object": "chat.completion",
- "model": "mistral-small-latest",
- "usage": {
- "prompt_tokens": 16,
- "completion_tokens": 34,
- "total_tokens": 50
}, - "data": [
- {
- "object": "embedding",
- "embedding": [
- 0.1,
- 0.2,
- 0.3
], - "index": 0
}
]
}
内容审核
授权
请求体模式: application/json必需
model 必需 | string (模型) 要使用的模型 ID。 |
必需 | Input (字符串) 或 Input 数组 (字符串) (输入) 要分类的文本。 |
响应
请求示例
- 负载
{- "model": "string",
- "input": "string"
}
响应示例
- 200
- 422
{- "id": "mod-e5cc70bb28c444948073e77776eb30ef",
- "model": "string",
- "results": [
- {
- "categories": {
- "property1": true,
- "property2": true
}, - "category_scores": {
- "property1": 0,
- "property2": 0
}
}
]
}
聊天内容审核
授权
请求体模式: application/json必需
必需 | Input 数组 (any) 或 Input 数组 (any) (输入) 要分类的聊天内容 |
model 必需 | string (模型) |
响应
请求示例
- 负载
{- "input": [
- {
- "content": "string",
- "role": "system"
}
], - "model": "string"
}
响应示例
- 200
- 422
{- "id": "mod-e5cc70bb28c444948073e77776eb30ef",
- "model": "string",
- "results": [
- {
- "categories": {
- "property1": true,
- "property2": true
}, - "category_scores": {
- "property1": 0,
- "property2": 0
}
}
]
}
分类
授权
请求体模式: application/json必需
model 必需 | string (模型) 要使用的模型 ID。 |
必需 | Input (字符串) 或 Input 数组 (字符串) (输入) 要分类的文本。 |
响应
请求示例
- 负载
{- "model": "string",
- "input": "string"
}
响应示例
- 200
- 422
{- "id": "mod-e5cc70bb28c444948073e77776eb30ef",
- "model": "string",
- "results": [
- {
- "property1": {
- "scores": {
- "property1": 0,
- "property2": 0
}
}, - "property2": {
- "scores": {
- "property1": 0,
- "property2": 0
}
}
}
]
}
聊天分类
授权
请求体模式: application/json必需
model 必需 | string (模型) |
必需 | InstructRequest (对象) 或 ChatClassificationRequestInputs 数组 (对象) (ChatClassificationRequestInputs) 要分类的聊天内容 |
响应
请求示例
- 负载
{- "model": "string",
- "input": {
- "messages": [
- {
- "content": "string",
- "role": "system"
}
]
}
}
响应示例
- 200
- 422
{- "id": "mod-e5cc70bb28c444948073e77776eb30ef",
- "model": "string",
- "results": [
- {
- "property1": {
- "scores": {
- "property1": 0,
- "property2": 0
}
}, - "property2": {
- "scores": {
- "property1": 0,
- "property2": 0
}
}
}
]
}
上传文件
上传一个可在各种端点使用的文件。
单个文件最大大小为 512 MB。微调 API 仅支持 .jsonl 文件。
如果您需要增加这些存储限制,请联系我们。
授权
请求体模式: multipart/form-data必需
file 必需 | string <binary> (文件) 要上传的文件对象(非文件名)。要上传文件并指定自定义文件名,您的请求应按如下格式设置
否则,您可以保留原始文件名
|
purpose | string (文件用途) 枚举: "fine-tune" "batch" "ocr" |
响应
响应示例
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f09",
- "object": "file",
- "bytes": 13000,
- "created_at": 1716963433,
- "filename": "files_upload.jsonl",
- "purpose": "fine-tune",
- "sample_type": "pretrain",
- "num_lines": 0,
- "source": "upload"
}
列出文件
返回属于用户组织的文件列表。
授权
query参数
page | integer (页码) 默认值: 0 |
page_size | integer (页面大小) 默认值: 100 |
Sample Type 数组 (字符串) 或 Sample Type (null) (样本类型) | |
Source 数组 (字符串) 或 Source (null) (来源) | |
Search (字符串) 或 Search (null) (搜索) | |
FilePurpose (字符串) 或 null |
响应
响应示例
- 200
{- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f09",
- "object": "file",
- "bytes": 13000,
- "created_at": 1716963433,
- "filename": "files_upload.jsonl",
- "purpose": "fine-tune",
- "sample_type": "pretrain",
- "num_lines": 0,
- "source": "upload"
}
], - "object": "string",
- "total": 0
}
响应示例
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f09",
- "object": "file",
- "bytes": 13000,
- "created_at": 1716963433,
- "filename": "files_upload.jsonl",
- "purpose": "fine-tune",
- "sample_type": "pretrain",
- "num_lines": 0,
- "source": "upload",
- "deleted": true
}
获取微调任务
获取您的组织和用户的微调任务列表。
授权
query参数
page | integer (页码) 默认值: 0 要返回的结果页码。 |
page_size | integer (页面大小) 默认值: 100 每页返回的项目数量。 |
Model (字符串) 或 Model (null) (模型) 用于微调的模型名称,用于过滤。设置后,不显示其他结果。 | |
Created After (字符串) 或 Created After (null) (创建时间之后) 用于过滤的日期/时间。设置后,不显示之前创建时间的结果。 | |
Created Before (字符串) 或 Created Before (null) (创建时间之前) | |
created_by_me | boolean (由我创建) 默认值: false 设置后,只返回 API 调用者创建的任务结果。不显示其他结果。 |
Status (字符串) 或 Status (null) (状态) 用于过滤的当前任务状态。设置后,不显示其他结果。 | |
Wandb Project (字符串) 或 Wandb Project (null) (Wandb Project) 用于过滤的 Weights and Biases 项目。设置后,不显示其他结果。 | |
Wandb Name (字符串) 或 Wandb Name (null) (Wandb 名称) 用于过滤的 Weight and Biases 运行名称。设置后,不显示其他结果。 | |
Suffix (字符串) 或 Suffix (null) (后缀) 用于过滤的模型后缀。设置后,不显示其他结果。 |
响应
响应示例
- 200
{- "data": [ ],
- "object": "list",
- "total": 0
}
创建微调任务
创建一个新的微调任务,它将排队等待处理。
授权
query参数
Dry Run (boolean) 或 Dry Run (null) (Dry Run)
|
请求体模式: application/json必需
model 必需 | string (可微调模型) 枚举: "open-mistral-7b" "mistral-small-latest" "codestral-latest" "mistral-large-latest" "open-mistral-nemo" "ministral-3b-latest" "ministral-8b-latest" 要微调的模型名称。 |
Array of objects (训练文件) 默认值: [] | |
Validation Files 数组 (字符串) 或 Validation Files (null) (验证文件) 包含包含验证数据的已上传文件 ID 的列表。如果您提供这些文件,数据将用于在微调期间定期生成验证指标。在获取正在运行的微调任务状态时,可以在 | |
Suffix (字符串) 或 Suffix (null) (后缀) 将添加到您的微调模型名称的字符串。例如,后缀为 "my-great-model" 将生成如下模型名称: | |
Integrations 数组 (any) 或 Integrations (null) (集成) 要为您的微调任务启用的集成列表。 | |
auto_start | boolean (自动启动) 此字段将在未来版本中成为必需项。 |
invalid_sample_skip_percentage | number (无效样本跳过百分比) [ 0 .. 0.5 ] 默认值: 0 |
FineTuneableModelType (字符串) 或 null | |
必需 | CompletionTrainingParametersIn (对象) 或 ClassifierTrainingParametersIn (对象) (超参数) |
Repositories 数组 (any) 或 Repositories (null) (存储库) | |
Classifier Targets 数组 (对象) 或 Classifier Targets (null) (分类器目标) |
响应
请求示例
- 负载
{- "model": "open-mistral-7b",
- "training_files": [ ],
- "validation_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "api_key": "stringstringstringstringstringstringstri",
- "run_name": "string"
}
], - "auto_start": true,
- "invalid_sample_skip_percentage": 0,
- "job_type": "completion",
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "seq_len": 100,
- "fim_ratio": 0.9
}, - "repositories": [
- {
- "type": "github",
- "name": "string",
- "owner": "string",
- "ref": "string",
- "weight": 1,
- "token": "string"
}
], - "classifier_targets": [
- {
- "name": "string",
- "labels": [
- "string"
], - "weight": 1,
- "loss_function": "single_class"
}
]
}
响应示例
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "auto_start": true,
- "model": "open-mistral-7b",
- "status": "QUEUED",
- "created_at": 0,
- "modified_at": 0,
- "training_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "validation_files": [ ],
- "object": "job",
- "fine_tuned_model": "string",
- "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "run_name": "string",
- "url": "string"
}
], - "trained_tokens": 0,
- "metadata": {
- "expected_duration_seconds": 0,
- "cost": 0,
- "cost_currency": "string",
- "train_tokens_per_step": 0,
- "train_tokens": 0,
- "data_tokens": 0,
- "estimated_start_time": 0
}, - "job_type": "completion",
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "seq_len": 100,
- "fim_ratio": 0.9
}, - "repositories": [ ]
}
响应示例
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "auto_start": true,
- "model": "open-mistral-7b",
- "status": "QUEUED",
- "created_at": 0,
- "modified_at": 0,
- "training_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "validation_files": [ ],
- "object": "job",
- "fine_tuned_model": "string",
- "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "run_name": "string",
- "url": "string"
}
], - "trained_tokens": 0,
- "metadata": {
- "expected_duration_seconds": 0,
- "cost": 0,
- "cost_currency": "string",
- "train_tokens_per_step": 0,
- "train_tokens": 0,
- "data_tokens": 0,
- "estimated_start_time": 0
}, - "job_type": "classifier",
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "seq_len": 100
}, - "events": [ ],
- "checkpoints": [ ],
- "classifier_targets": [
- {
- "name": "string",
- "labels": [
- "string"
], - "weight": 0,
- "loss_function": "single_class"
}
]
}
响应示例
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "auto_start": true,
- "model": "open-mistral-7b",
- "status": "QUEUED",
- "created_at": 0,
- "modified_at": 0,
- "training_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "validation_files": [ ],
- "object": "job",
- "fine_tuned_model": "string",
- "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "run_name": "string",
- "url": "string"
}
], - "trained_tokens": 0,
- "metadata": {
- "expected_duration_seconds": 0,
- "cost": 0,
- "cost_currency": "string",
- "train_tokens_per_step": 0,
- "train_tokens": 0,
- "data_tokens": 0,
- "estimated_start_time": 0
}, - "job_type": "classifier",
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "seq_len": 100
}, - "events": [ ],
- "checkpoints": [ ],
- "classifier_targets": [
- {
- "name": "string",
- "labels": [
- "string"
], - "weight": 0,
- "loss_function": "single_class"
}
]
}
响应示例
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "auto_start": true,
- "model": "open-mistral-7b",
- "status": "QUEUED",
- "created_at": 0,
- "modified_at": 0,
- "training_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "validation_files": [ ],
- "object": "job",
- "fine_tuned_model": "string",
- "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "run_name": "string",
- "url": "string"
}
], - "trained_tokens": 0,
- "metadata": {
- "expected_duration_seconds": 0,
- "cost": 0,
- "cost_currency": "string",
- "train_tokens_per_step": 0,
- "train_tokens": 0,
- "data_tokens": 0,
- "estimated_start_time": 0
}, - "job_type": "classifier",
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "seq_len": 100
}, - "events": [ ],
- "checkpoints": [ ],
- "classifier_targets": [
- {
- "name": "string",
- "labels": [
- "string"
], - "weight": 0,
- "loss_function": "single_class"
}
]
}
响应示例
- 200
- 422
{- "object": "list",
- "data": [
- {
- "id": "string",
- "object": "model",
- "created": 0,
- "owned_by": "mistralai",
- "capabilities": {
- "completion_chat": true,
- "completion_fim": false,
- "function_calling": true,
- "fine_tuning": false,
- "vision": false
}, - "name": "string",
- "description": "string",
- "max_context_length": 32768,
- "aliases": [ ],
- "deprecation": "2019-08-24T14:15:22Z",
- "default_model_temperature": 0,
- "type": "base"
}
]
}
获取模型
获取模型信息。
授权
path参数
model_id 必需 | string (模型 Id) 示例: ft:open-mistral-7b:587a6b29:20240514:7e773925 要获取的模型 ID。 |
响应
响应示例
- 200
- 422
{- "id": "string",
- "object": "model",
- "created": 0,
- "owned_by": "mistralai",
- "capabilities": {
- "completion_chat": true,
- "completion_fim": false,
- "function_calling": true,
- "fine_tuning": false,
- "vision": false
}, - "name": "string",
- "description": "string",
- "max_context_length": 32768,
- "aliases": [ ],
- "deprecation": "2019-08-24T14:15:22Z",
- "default_model_temperature": 0,
- "type": "base"
}
更新微调模型
更新模型名称或描述。
授权
path参数
model_id 必需 | string (模型 Id) 示例: ft:open-mistral-7b:587a6b29:20240514:7e773925 要更新的模型 ID。 |
请求体模式: application/json必需
Name (字符串) 或 Name (null) (名称) | |
Description (字符串) 或 Description (null) (描述) |
响应
请求示例
- 负载
{- "name": "string",
- "description": "string"
}
响应示例
- 200
{- "id": "string",
- "object": "model",
- "created": 0,
- "owned_by": "string",
- "root": "string",
- "archived": true,
- "name": "string",
- "description": "string",
- "capabilities": {
- "completion_chat": true,
- "completion_fim": false,
- "function_calling": false,
- "fine_tuning": false,
- "classification": false
}, - "max_context_length": 32768,
- "aliases": [ ],
- "job": "4bbaedb0-902b-4b27-8218-8f40d3470a54",
- "classifier_targets": [
- {
- "name": "string",
- "labels": [
- "string"
], - "weight": 0,
- "loss_function": "single_class"
}
], - "model_type": "classifier"
}
获取批量任务
获取您的组织和用户的批量任务列表。
授权
query参数
page | integer (页码) 默认值: 0 |
page_size | integer (页面大小) 默认值: 100 |
Model (字符串) 或 Model (null) (模型) | |
Metadata (对象) 或 Metadata (null) (元数据) | |
Created After (字符串) 或 Created After (null) (创建时间之后) | |
created_by_me | boolean (由我创建) 默认值: false |
Status 数组 (字符串) 或 Status (null) (状态) |
响应
响应示例
- 200
{- "data": [ ],
- "object": "list",
- "total": 0
}
创建批量任务
创建一个新的批量任务,它将排队等待处理。
授权
请求体模式: application/json必需
input_files 必需 | Array of strings <uuid> (输入文件) [ items <uuid > ] |
endpoint 必需 | string (ApiEndpoint) 枚举: "/v1/chat/completions" "/v1/embeddings" "/v1/fim/completions" "/v1/moderations" "/v1/chat/moderations" |
model 必需 | string (模型) |
Metadata (对象) 或 Metadata (null) (元数据) | |
timeout_hours | integer (超时小时) 默认值: 24 |
响应
请求示例
- 负载
{- "input_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "endpoint": "/v1/chat/completions",
- "model": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "timeout_hours": 24
}
响应示例
- 200
{- "id": "string",
- "object": "batch",
- "input_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "metadata": { },
- "endpoint": "string",
- "model": "string",
- "output_file": "c7c9cb17-f818-4ee3-85de-0d2f8954882c",
- "error_file": "6b79e6a4-c3aa-4da1-8fb4-9e2520d26bfa",
- "errors": [
- {
- "message": "string",
- "count": 1
}
], - "status": "QUEUED",
- "created_at": 0,
- "total_requests": 0,
- "completed_requests": 0,
- "succeeded_requests": 0,
- "failed_requests": 0,
- "started_at": 0,
- "completed_at": 0
}
响应示例
- 200
{- "id": "string",
- "object": "batch",
- "input_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "metadata": { },
- "endpoint": "string",
- "model": "string",
- "output_file": "c7c9cb17-f818-4ee3-85de-0d2f8954882c",
- "error_file": "6b79e6a4-c3aa-4da1-8fb4-9e2520d26bfa",
- "errors": [
- {
- "message": "string",
- "count": 1
}
], - "status": "QUEUED",
- "created_at": 0,
- "total_requests": 0,
- "completed_requests": 0,
- "succeeded_requests": 0,
- "failed_requests": 0,
- "started_at": 0,
- "completed_at": 0
}
响应示例
- 200
{- "id": "string",
- "object": "batch",
- "input_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "metadata": { },
- "endpoint": "string",
- "model": "string",
- "output_file": "c7c9cb17-f818-4ee3-85de-0d2f8954882c",
- "error_file": "6b79e6a4-c3aa-4da1-8fb4-9e2520d26bfa",
- "errors": [
- {
- "message": "string",
- "count": 1
}
], - "status": "QUEUED",
- "created_at": 0,
- "total_requests": 0,
- "completed_requests": 0,
- "succeeded_requests": 0,
- "failed_requests": 0,
- "started_at": 0,
- "completed_at": 0
}
OCR
授权
请求体模式: application/json必需
必需 | Model (字符串) 或 Model (null) (模型) |
id | string (Id) |
必需 | DocumentURLChunk (对象) 或 ImageURLChunk (对象) (文档) 要运行 OCR 的文档 |
Pages 数组 (整数) 或 Pages (null) (页码) 用户希望以各种格式处理的特定页码:单个数字、范围或两者的列表。从 0 开始。 | |
Include Image Base64 (boolean) 或 Include Image Base64 (null) (包含图像 Base64) 响应中包含图像 URL | |
Image Limit (整数) 或 Image Limit (null) (图像限制) 最大提取图像数 | |
Image Min Size (整数) 或 Image Min Size (null) (最小图像大小) 要提取图像的最小高度和宽度 |
响应
请求示例
- 负载
{- "model": "string",
- "id": "string",
- "document": {
- "document_url": "string",
- "document_name": "string",
- "type": "document_url"
}, - "pages": [
- 0
], - "include_image_base64": true,
- "image_limit": 0,
- "image_min_size": 0
}
响应示例
- 200
- 422
{- "pages": [
- {
- "index": 0,
- "markdown": "string",
- "images": [
- {
- "id": "string",
- "top_left_x": 0,
- "top_left_y": 0,
- "bottom_right_x": 0,
- "bottom_right_y": 0,
- "image_base64": "string"
}
], - "dimensions": {
- "dpi": 0,
- "height": 0,
- "width": 0
}
}
], - "model": "string",
- "usage_info": {
- "pages_processed": 0,
- "doc_size_bytes": 0
}
}