Unsupported value: 'reasoning_effort' does not support 'minimal' with this model...
🚨 错误信息
Unsupported value: 'reasoning_effort' does not support 'minimal' with this model. Supported values are: 'none', 'low', 'medium', 'high', and 'xhigh'.
🤖 AI解决方案
错误分析
1. 错误翻译
原文:Unsupported value: 'reasoning_effort' does not support 'minimal' with this model. Supported values are: 'none', 'low', 'medium', 'high', and 'xhigh'.
译文:不支持的值:当前模型不支持 'reasoning_effort' 参数设置为 'minimal'。支持的值为:'none', 'low', 'medium', 'high', 和 'xhigh'。
2. 原因分析
这是一个参数值验证错误。您在调用AI模型API时,给reasoning_effort 参数传递了一个无效值 'minimal',而当前模型只接受指定的几个枚举值。
根本原因:使用了不支持的参数值。可能是:
- 文档版本不匹配,使用了过时的参数值
- 模型不支持此参数级别的推理努力度设置
- 参数拼写错误或使用了错误的常量
3. 解决方案
修改 reasoning_effort 参数值为支持的值之一:
# 修复前(错误代码):
response = client.chat.completions.create(
model="gpt-4-turbo",
messages=messages,
reasoning_effort="minimal" # ❌ 不支持的值
)
# 修复后(正确代码):
response = client.chat.completions.create(
model="gpt-4-turbo",
messages=messages,
reasoning_effort="medium" # ✅ 使用支持的值
# 可选的其他有效值:"none", "low", "medium", "high", "xhigh"
)
4. ️ 预防措施
# 示例:使用枚举(如果库支持)
from openai import ReasoningEffort # 假设有这样的枚举
response = client.chat.completions.create(
model="gpt-4-turbo",
messages=messages,
reasoning_effort=ReasoningEffort.MEDIUM # 类型安全
)
reasoning_effort 参数