文本生成
Qwen3系列Plus模型,实现思考模式和非思考模式的有效融合,可在对话中切换模式。推理能力显著超过QwQ、通用能力显著超过Qwen2.5-Plus,达到同规模业界SOTA水平。
字段名 | 字段类型 | 是否必传 | 字段默认值 | 字段说明 |
|---|---|---|---|---|
| model | string | 否 | 当前实例模型名 | 模型名称,SDK 内部会自动设置为当前实例的 modelName |
| messages | Array<{ role: "system"|"user"|"assistant"; content: string }> | 是 | - | 对话消息数组,支持多轮对话 |
| messages.role | "system" | "user" | "assistant" | 是 | - | 消息角色 |
| messages.content | string | 是 | - | 文本内容(问题、指令或上下文) |
| platform_tools | Array<object> | 否 | 平台工具列表(函数/工具调用) | |
| knowledge_base | Array<object> | 否 | 知识库列表(检索增强) |
说明:
非流式响应(DoGenerateOutput,标准格式):
字段名 | 字段类型 | 是否必传 | 字段默认值 | 字段说明 |
|---|---|---|---|---|
| id | string | 否 | - | 请求/响应 ID |
| object | string | 否 | - | 对象类型,一般为 chat.completion |
| created | number | 否 | - | 时间戳(秒) |
| model | string | 否 | - | 实际使用的模型名 |
| log_id | string | 否 | - | 日志跟踪 ID |
| error | string | 否 | "" | 错误信息 |
| code | number | 否 | 0 | 错误码 |
| choices | Array<{ index: number; message: { id: string; role: "assistant"|"user"; type: string; content: string; reasoning_content: string }; finish_reason: string }> | 否 | - | 生成结果列表 |
| usage | { prompt_tokens: number; completion_tokens: number; knowledge_tokens: number; reasoning_tokens: number; total_tokens: number } | 否 | - | Token 统计信息 |
流式响应(BaseDoStreamOutputChunk,标准格式):
字段名 | 字段类型 | 是否必传 | 字段默认值 | 字段说明 |
|---|---|---|---|---|
| id | string | 否 | - | 同上 |
| object | string | 否 | chat.completion.chunk | 流片段对象类型 |
| created | number | 否 | - | 时间戳(秒) |
| model | string | 否 | - | 模型名 |
| log_id | string | 否 | - | 日志跟踪 ID |
| error | string | 否 | "" | 错误信息 |
| code | number | 否 | 0 | 错误码 |
| choices | Array<{ index: number; message: { id: string; role: "assistant"; type: string; content: string; reasoning_content: string }; finish_reason: string|null }> | 否 | - | 生成的增量内容 |
| usage | 同上 | 否 | - | 一般在最后一个片段返回 |
{
"messages": [
{ "role": "system", "content": "你是一个有用的AI助手。" },
{ "role": "user", "content": "请帮我写一篇关于人工智能的文章" }
],
"max_tokens": 1000,
"temperature": 0.7,
"top_p": 1.0,
"frequency_penalty": 0,
"presence_penalty": 0,
"stream": true,
"knowledge_base": [],
"enable_thinking": false,
"enable_search": false
}