mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 07:03:25 +00:00
fix(ai): default tool call arguments to empty object for Google providers
When Google providers return tool calls without an args field (common for
no-argument tools), the arguments field was undefined. This breaks
subsequent API calls that require tool_use.input to be present.
Now defaults to {} when args is missing.
Related: clawdbot/clawdbot#1509
This commit is contained in:
parent
d74fd82673
commit
a6d878e804
4 changed files with 108 additions and 3 deletions
|
|
@ -685,7 +685,7 @@ export const streamGoogleGeminiCli: StreamFunction<"google-gemini-cli", GoogleGe
|
|||
type: "toolCall",
|
||||
id: toolCallId,
|
||||
name: part.functionCall.name || "",
|
||||
arguments: part.functionCall.args as Record<string, unknown>,
|
||||
arguments: (part.functionCall.args as Record<string, unknown>) ?? {},
|
||||
...(part.thoughtSignature && { thoughtSignature: part.thoughtSignature }),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue