diff --git a/open-sse/translator/request/openai-to-gemini.ts b/open-sse/translator/request/openai-to-gemini.ts index 1413ef9d20..adfa76c274 100644 --- a/open-sse/translator/request/openai-to-gemini.ts +++ b/open-sse/translator/request/openai-to-gemini.ts @@ -523,7 +523,10 @@ export function openaiToGeminiRequest( model: string, body: Record, stream: boolean, - credentials: Record | null = null + credentials: Record | null = null, + options: { + signaturelessToolCallMode?: "native" | "text"; + } = {} ) { // Thread the signature namespace so a thinking model's thoughtSignature (cached on the // response turn under `:`) is found and re-attached to the @@ -533,7 +536,10 @@ export function openaiToGeminiRequest( credentials && typeof credentials._signatureNamespace === "string" ? credentials._signatureNamespace : null; - return openaiToGeminiBase(model, body, stream, { signatureNamespace }); + return openaiToGeminiBase(model, body, stream, { + signatureNamespace, + signaturelessToolCallMode: options.signaturelessToolCallMode, + }); } // OpenAI -> Gemini CLI (Cloud Code Assist) @@ -695,7 +701,15 @@ export function openaiToAntigravityRequest(model, body, stream, credentials = nu } // Register -register(FORMATS.OPENAI, FORMATS.GEMINI, openaiToGeminiRequest, null); +register( + FORMATS.OPENAI, + FORMATS.GEMINI, + (model, body, stream = false, credentials = null) => + openaiToGeminiRequest(model, body, stream, credentials, { + signaturelessToolCallMode: "text", + }), + null +); register( FORMATS.OPENAI, FORMATS.GEMINI_CLI,