兼容responses

This commit is contained in:
Sirius
2026-08-20 14:32:30 +08:00
parent d84b6f863d
commit b03d47c891
3 changed files with 64 additions and 9 deletions
+3 -1
View File
@@ -231,7 +231,9 @@ Chat Completions 和 Responses 共用 Command Code NDJSON 执行层。服务终
- `tool_choice`
- `parallel_tool_calls`
`input` 可以是字符串,也可以是 item 数组。message 支持 `system``developer``user``assistant` 角色、字符串 content,以及 `input_text``output_text``input_image``input_file` part。工具轮次还支持 `function_call``function_call_output` item,分别携带 `call_id`、工具名、`arguments` 和工具执行结果 `output`
为兼容 DeepSeek Harness、OpenAI Node.js SDK 等 Responses 客户端,接口还会接受但不实际应用这些字段:`prompt_cache_key``prompt_cache_retention``prompt_cache_options``max_output_tokens``temperature``top_p``service_tier``stream_options``include``reasoning.generate_summary``reasoning.summary`。请求显式提供这些字段时,服务终端会输出警告,HTTP 响应的 `X-Command-Code-Ignored-Parameters` 会列出未实际应用的顶层字段
`input` 可以是字符串,也可以是 item 数组。message 支持 `system``developer``user``assistant` 角色、字符串 content,以及 `input_text``output_text``input_image``input_file` part。历史 message 常见的 `id``status``phase` 和 output_text 的 `annotations` 也会被接受,但只用于兼容客户端回放,不会写入本地响应存储。工具轮次还支持 `function_call``function_call_output` item,分别携带 `call_id`、工具名、`arguments` 和工具执行结果 `output`
`input_image.image_url` 与 Chat 一样只接受图片 data URL`file_id`、远程 URL、`file://`、本地路径和 low/high detail 不支持。`input_file` 只接受 `file_data``filename`,其中 `file_data` 可以是严格 base64 或带受支持文本 MIME 的 base64 data URL;解码结果必须是无 NUL 的 UTF-8 文本。`file_url``file_id`、PDF、Office 和其他二进制会返回带准确字段路径的 400。