Skip to content

Commit 07f0c01

Browse files
authored
fix(google): wrap primitive tool responses for Gemini API compatibility (#2900)
1 parent e4ad31b commit 07f0c01

File tree

3 files changed

+473
-2
lines changed

3 files changed

+473
-2
lines changed

apps/sim/providers/gemini/core.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
convertToGeminiFormat,
2020
convertUsageMetadata,
2121
createReadableStreamFromGeminiStream,
22+
ensureStructResponse,
2223
extractFunctionCallPart,
2324
extractTextContent,
2425
mapToThinkingLevel,
@@ -104,7 +105,7 @@ async function executeToolCall(
104105
const duration = toolCallEndTime - toolCallStartTime
105106

106107
const resultContent: Record<string, unknown> = result.success
107-
? (result.output as Record<string, unknown>)
108+
? ensureStructResponse(result.output)
108109
: { error: true, message: result.error || 'Tool execution failed', tool: toolName }
109110

110111
const toolCall: FunctionCallResponse = {

0 commit comments

Comments
 (0)