@@ -35,7 +35,7 @@ import { stripSystemPromptCacheBoundary } from "../utils/system-prompt-cache-bou
3535import { describeToolResultMediaPlaceholder , extractToolResultText } from "./tool-result-text.js" ;
3636import { transformMessages } from "./transform-messages.js" ;
3737
38- type GoogleApiType = "google-generative-ai" | "google-vertex" ;
38+ export type GoogleApiType = "google-generative-ai" | "google-vertex" ;
3939
4040/**
4141 * Thinking level for Gemini 3 models.
@@ -48,9 +48,9 @@ export type GoogleThinkingLevel =
4848 | "MEDIUM"
4949 | "HIGH" ;
5050
51- type GoogleToolChoice = "auto" | "none" | "any" ;
51+ export type GoogleToolChoice = "auto" | "none" | "any" ;
5252
53- type GoogleThinkingOptions = {
53+ export type GoogleThinkingOptions = {
5454 enabled : boolean ;
5555 budgetTokens ?: number ;
5656 level ?: GoogleThinkingLevel ;
@@ -86,7 +86,7 @@ type ClampedGoogleThinkingLevel = Exclude<AgentThinkingLevel, "xhigh" | "max">;
8686 *
8787 * See: https://ai.google.dev/gemini-api/docs/thought-signatures
8888 */
89- function isThinkingPart ( part : Pick < Part , "thought" | "thoughtSignature" > ) : boolean {
89+ export function isThinkingPart ( part : Pick < Part , "thought" | "thoughtSignature" > ) : boolean {
9090 return part . thought === true ;
9191}
9292
@@ -557,8 +557,11 @@ export function buildGoogleSimpleThinking<T extends GoogleApiType>(
557557 }
558558
559559 const clampedReasoning = clampThinkingLevel ( model , options . reasoning ) ;
560+ if ( clampedReasoning === "off" ) {
561+ return { enabled : false } ;
562+ }
560563 const effort = (
561- clampedReasoning === "off" || clampedReasoning === " max" ? "high" : clampedReasoning
564+ clampedReasoning === "max" ? "high" : clampedReasoning
562565 ) as ClampedGoogleThinkingLevel ;
563566
564567 if (
@@ -615,11 +618,11 @@ export function isGemma4Model<T extends GoogleApiType>(model: Model<T>): boolean
615618 return / g e m m a - ? 4 / . test ( model . id . toLowerCase ( ) ) ;
616619}
617620
618- function isGemini3ProModel < T extends GoogleApiType > ( model : Model < T > ) : boolean {
621+ export function isGemini3ProModel < T extends GoogleApiType > ( model : Model < T > ) : boolean {
619622 return / g e m i n i - 3 (?: \. \d + ) ? - p r o / . test ( model . id . toLowerCase ( ) ) ;
620623}
621624
622- function isGemini3FlashModel < T extends GoogleApiType > ( model : Model < T > ) : boolean {
625+ export function isGemini3FlashModel < T extends GoogleApiType > ( model : Model < T > ) : boolean {
623626 return / g e m i n i - 3 (?: \. \d + ) ? - f l a s h / . test ( model . id . toLowerCase ( ) ) ;
624627}
625628
0 commit comments