Fix deepseek v4 reasoning inject thoughts (#5527)

* Fix deepseek v4 injectReasoning error
resolves #5509

* comment
This commit is contained in:
Timothy Carambat 2026-04-24 15:40:05 -07:00 committed by GitHub
parent bde72505ff
commit 7ead0449f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,8 +54,20 @@ class DeepSeekProvider extends InheritMultiple([Provider, UnTooled]) {
return rest; return rest;
} }
/**
* Check if the model is a thinking model
* because we need to inject reasoning content into the messages
* or else the DeepSeek API will return an error for specific models.
* There is no official way to predetect if a model will require this
* so we have to hardcode the list of thinking models.
* @returns {boolean}
*/
get #isThinkingModel() { get #isThinkingModel() {
return this.model === "deepseek-reasoner"; return [
"deepseek-reasoner",
"deepseek-v4-flash",
"deepseek-v4-pro",
].includes(this.model);
} }
get #tooledOptions() { get #tooledOptions() {