mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Omit reasoning params for non-reasoning models (#2932)
This commit is contained in:
parent
cb29e9d56f
commit
c8b5cdf7b2
2 changed files with 7 additions and 1 deletions
5
.changeset/khaki-months-float.md
Normal file
5
.changeset/khaki-months-float.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"roo-cline": patch
|
||||
---
|
||||
|
||||
Omit reasoning params for non-reasoning models
|
||||
|
|
@ -9,6 +9,7 @@ import {
|
|||
openRouterDefaultModelInfo,
|
||||
PROMPT_CACHING_MODELS,
|
||||
OPTIONAL_PROMPT_CACHING_MODELS,
|
||||
REASONING_MODELS,
|
||||
} from "../../shared/api"
|
||||
import { convertToOpenAiMessages } from "../transform/openai-format"
|
||||
import { ApiStreamChunk } from "../transform/stream"
|
||||
|
|
@ -147,7 +148,7 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
|
|||
}),
|
||||
// This way, the transforms field will only be included in the parameters when openRouterUseMiddleOutTransform is true.
|
||||
...((this.options.openRouterUseMiddleOutTransform ?? true) && { transforms: ["middle-out"] }),
|
||||
...(reasoningEffort && { reasoning: { effort: reasoningEffort } }),
|
||||
...(REASONING_MODELS.has(modelId) && reasoningEffort && { reasoning: { effort: reasoningEffort } }),
|
||||
}
|
||||
|
||||
const stream = await this.client.chat.completions.create(completionParams)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue