fix(ai): use correct DeepSeek API format to disable thinking

This commit is contained in:
lexmin0412 authored and GitHub committed 2026-07-09 18:12:05 +08:00
1 parent 87efe469a4
commit f590a727a0
1 file changed
+5
+5
View File
@@ -1976,6 +1976,11 @@ async fn stream_openai_with_tools(
});
set_chat_completion_token_limit(&mut body, &request.config, request.max_tokens.unwrap_or(4096));
// DeepSeek API requires {"thinking": {"type": "disabled"}} to disable thinking
if !request.config.enable_thinking && matches!(request.config.provider, AiProvider::Deepseek) {
body["thinking"] = json!({ "type": "disabled" });
}
let res = client
.post(resolve_endpoint(&request.config))
.headers(headers)