常见问题¶
本文档整理用户常见问题及解答。
通用问题¶
接口相关问题¶
LiteLLM 调用本站接口时 reasoning_effort 参数无效怎么办?¶
使用 LiteLLM 平台调用本站接口时,如果在顶层使用 reasoning_effort 参数开启思考模式无效,建议将 reasoning_effort 放在 extra_body 中传递,这样会并入请求体正确发送。
方式一:顶层使用 reasoning_effort(LiteLLM 中可能无法正确传递)
from litellm import completion
# 顶层传参可能无法正确传递至本站接口
response = completion(
model="openai/gpt-4o",
api_base="https://api-cs-al.naci-tech.com/v1",
api_key="your-api-key",
messages=[{"role": "user", "content": "请分析一下 9.11 和 9.8 哪个更大?"}],
reasoning_effort="medium", # 顶层传参可能无效
)
print(response.choices[0].message.content)
方式二:使用 extra_body 传递(推荐,不生效时尝试)
from litellm import completion
# 通过 extra_body 传递,可正确发送至本站接口
response = completion(
model="openai/gpt-4o",
api_base="https://api-cs-al.naci-tech.com/v1",
api_key="your-api-key",
messages=[{"role": "user", "content": "请分析一下 9.11 和 9.8 哪个更大?"}],
extra_body={"reasoning_effort": "medium"},
)
print(response.choices[0].message.content)