agent: Fix tool use in Gemini (#30689)
Thread doesn't run pending tools when `stop_reason` is not `ToolUse`. Perhaps we should change that so that it always runs pending tools if there are some, but for now this change just fixes setting `stop_reason` for Google models. Release Notes: - N/A
This commit is contained in:
parent
dce6e96c16
commit
d42cb111f4
1 changed files with 1 additions and 0 deletions
|
@ -628,6 +628,7 @@ impl GoogleEventMapper {
|
||||||
// responds with `finish_reason: STOP`
|
// responds with `finish_reason: STOP`
|
||||||
if wants_to_use_tool {
|
if wants_to_use_tool {
|
||||||
self.stop_reason = StopReason::ToolUse;
|
self.stop_reason = StopReason::ToolUse;
|
||||||
|
events.push(Ok(LanguageModelCompletionEvent::Stop(StopReason::ToolUse)));
|
||||||
}
|
}
|
||||||
events
|
events
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue