Response 对象
创建模型响应或查询模型响应后,模型会返回一个 Response 对象。本文为您介绍 Response 对象包含的详细参数。
说明
Response 对象包含模型的输出内容,包括模型回答、思维链(如果启用了深度思考模式)以及工具调用信息。
基础字段
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | 本次请求的唯一标识。 |
| object | string | 对象类型,固定为 response。 |
| created_at | integer | 本次请求创建时间的 Unix 时间戳(秒)。 |
| model | string | 本次请求实际使用的模型名称和版本。 |
| status | string | 生成响应的状态。可选值:
|
请求配置字段
| 字段 | 类型 | 说明 |
|---|---|---|
| instructions | string/null | 在模型上下文中插入一条系统(或开发者)消息,作为首项。当与 previous_response_id 一起使用时,前一响应中的指令不会延续到下一响应。 |
| previous_response_id | string/null | 本次请求时传入的历史响应 ID。 |
| max_output_tokens | integer/null | 可生成的最大 token 数上限,不包括思考 token。 |
| temperature | float/null | 采样温度。 |
| top_p | float/null | 核采样概率阈值。 |
功能控制字段
| 字段 | 类型 | 说明 |
|---|---|---|
| thinking | object/null | 是否开启深度思考模式。包含 type 字段,取值范围:
|
| store | boolean | 是否存储生成的模型响应,以便后续通过 API 检索。
true |
| caching | object | 是否开启缓存。包含 type 字段,取值范围:
|
| expire_at | integer/null | 存储的有效期,Unix 时间戳(秒)。 |
| service_tier | string | 本次请求是否使用了 TPM 保障包。
|
输出字段
output
模型的输出消息列表,包含模型响应本次请求生成的回答、思维链、工具调用。
类型:array
输出项可以是以下类型之一:
模型回答(message)
模型回答,不包含思维链。
| 字段 | 类型 | 说明 |
|---|---|---|
| type | string | 输出消息的类型,固定为 message。 |
| id | string | 此回答的唯一标识。 |
| role | string | 输出信息的角色,固定为 assistant。 |
| status | string | 输出消息的状态。 |
| content | array | 输出消息的内容。 |
content 字段说明:
文本回答(output_text)
| 字段 | 类型 | 说明 |
|---|---|---|
| type | string | 模型回答的类型,固定为 output_text。 |
| text | string | 模型回答的文本内容。 |
示例:
JSON
{
"type": "message",
"id": "msg_001",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "融云 AI API 服务是一个强大的人工智能接口平台..."
}
]
}
模型思维链(reasoning)
本次请求,当触发深度思考时,模型会返回问题拆解的思维链内容。
| 字段 | 类型 | 说明 |
|---|---|---|
| type | string | 本输出对象的类型,固定为 reasoning。 |
| id | string | 本思维链消息的唯一标识。 |
| status | string | 本次思维链内容返回的状态。 |
| summary | array | 思维链内容。 |
summary 字段说明:
| 字段 | 类型 | 说明 |
|---|---|---|
| type | string | 对象的类型,固定为 summary_text。 |
| text | string | 思维链内容的文本部分。 |
示例:
JSON
{
"type": "reasoning",
"id": "reason_001",
"status": "completed",
"summary": [
{
"type": "summary_text",
"text": "用户询问融云 AI API 的主要功能,需要系统性地介绍其核心能力。首先应该说明这是一个 AI 服务平台,然后列举主要功能模块,包括多模型支持、工具调用、多轮对话等特性..."
}
]
}
工具调用(function_call)
本次请求,模型根据信息认为需要调用的工具信息以及对应参数。
| 字段 | 类型 | 说明 |
|---|---|---|
| type | string | 工具调用的类型,固定为 function_call。 |
| id | string | 本次输出的唯一标识。 |
| call_id | string | 本次工具调用信息的唯一 ID。 |
| name | string | 要运行的函数的名称。 |
| arguments | string | 要传递给函数的参数,格式为 JSON 字符串。 |
| status | string | 此时消息返回的状态。 |
示例:
JSON
{
"type": "function_call",
"id": "call_001",
"call_id": "call_abc123",
"name": "get_weather",
"arguments": "{\"city\":\"北京\"}",
"status": "completed"
}