fix(gemini): preserve thought_signature in tool calls to prevent 400 errors
This commit is contained in:
1 parent
920e30a241
commit
33915fb712
3 files changed
+24
-17
No files matched your search
+8
-2
@@ -624,12 +624,18 @@ func (al *AgentLoop) runLLMIteration(ctx context.Context, messages []providers.M
|
||||
}
|
||||
for _, tc := range response.ToolCalls {
|
||||
argumentsJSON, _ := json.Marshal(tc.Arguments)
|
||||
thoughtSignature := ""
|
||||
if tc.Function != nil {
|
||||
thoughtSignature = tc.Function.ThoughtSignature
|
||||
}
|
||||
|
||||
assistantMsg.ToolCalls = append(assistantMsg.ToolCalls, providers.ToolCall{
|
||||
ID: tc.ID,
|
||||
Type: "function",
|
||||
Function: &providers.FunctionCall{
|
||||
Name: tc.Name,
|
||||
Arguments: string(argumentsJSON),
|
||||
Name: tc.Name,
|
||||
Arguments: string(argumentsJSON),
|
||||
ThoughtSignature: thoughtSignature,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user