mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 03:00:29 +00:00
Fix reasoning disabled by default for all providers
Previously, when reasoning was not specified, some providers like Gemini
with 'dynamic thinking' enabled by default would still use thinking.
Now explicitly sets thinkingEnabled: false (Anthropic) and
thinking: { enabled: false } (Google) when reasoning is undefined.
Closes #180
This commit is contained in:
parent
82dceb22e1
commit
fbda78bfb3
3 changed files with 14 additions and 2 deletions
|
|
@ -133,7 +133,10 @@ function mapOptionsForApi<TApi extends Api>(
|
|||
|
||||
switch (model.api) {
|
||||
case "anthropic-messages": {
|
||||
if (!options?.reasoning) return base satisfies AnthropicOptions;
|
||||
// Explicitly disable thinking when reasoning is not specified
|
||||
if (!options?.reasoning) {
|
||||
return { ...base, thinkingEnabled: false } satisfies AnthropicOptions;
|
||||
}
|
||||
|
||||
const anthropicBudgets = {
|
||||
minimal: 1024,
|
||||
|
|
@ -162,7 +165,11 @@ function mapOptionsForApi<TApi extends Api>(
|
|||
} satisfies OpenAIResponsesOptions;
|
||||
|
||||
case "google-generative-ai": {
|
||||
if (!options?.reasoning) return base as any;
|
||||
// Explicitly disable thinking when reasoning is not specified
|
||||
// This is needed because Gemini has "dynamic thinking" enabled by default
|
||||
if (!options?.reasoning) {
|
||||
return { ...base, thinking: { enabled: false } } satisfies GoogleOptions;
|
||||
}
|
||||
|
||||
const googleModel = model as Model<"google-generative-ai">;
|
||||
const effort = clampReasoning(options.reasoning)!;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue