400 Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v...
错误信息
Prompt is too long · automatic compaction failed: API Error: 400 Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'. (request id: 20260917084945652595166c14228f5W2lvEm9S)
AI 解决方案
原文:Prompt is too long · automatic compaction failed: API Error: 400 Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.
译文:提示词过长 · 自动压缩失败:API 错误:400 在 /v1/chat/completions 接口中,gpt-5.6-sol 不支持带有 reasoning_effort 的功能工具。若要使用功能工具,请改用 /v1/responses 接口,或将 reasoning_effort 设为 'none'。
🎯 原因分析
该错误表明请求同时使用了功能工具(Function Tools)和推理强度(reasoning_effort)参数,而
gpt-5.6-sol 模型在 /v1/chat/completions 接口下不支持这种组合。API 服务端严格校验了参数兼容性,同时提示当前上下文过长,自动压缩机制未能生效。💡 解决方案
根据您的实际需求,二选一修复:
方案一:移除 reasoning_effort 参数(推荐在 /v1/chat/completions 中使用)
# 修复后的代码
response = client.chat.completions.create(
model="gpt-5.6-sol",
messages=messages,
tools=[...], # 保留功能工具
# 移除或注释掉 reasoning_effort 相关参数
)
方案二:改用 /v1/responses 接口(支持全功能)
# 修复后的代码
response = client.responses.create(
model="gpt-5.6-sol",
messages=messages,
tools=[...],
reasoning={"effort": "medium"}, # 按规范设置推理强度
)