mirror of
https://github.com/Mintplex-Labs/anything-llm
synced 2026-04-25 17:15:37 +02:00
Fix deepseek v4 reasoning inject thoughts (#5527)
* Fix deepseek v4 injectReasoning error resolves #5509 * comment
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user