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

View File

@@ -54,8 +54,20 @@ class DeepSeekProvider extends InheritMultiple([Provider, UnTooled]) {
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() {
return this.model === "deepseek-reasoner";
return [
"deepseek-reasoner",
"deepseek-v4-flash",
"deepseek-v4-pro",
].includes(this.model);
}
get #tooledOptions() {