mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix: satisfy Gemini tool history checks
This commit is contained in:
parent
148fa47b91
commit
a9d23cf0f5
1 changed files with 4 additions and 1 deletions
|
|
@ -598,7 +598,10 @@ def _gemini_convert_messages_with_history( # noqa: PLR0915
|
|||
and messages[msg_i]["role"] in tool_call_message_roles
|
||||
):
|
||||
tool_result_message = messages[msg_i]
|
||||
tool_call_id = tool_result_message.get("tool_call_id")
|
||||
tool_call_id_value = tool_result_message.get("tool_call_id")
|
||||
tool_call_id = (
|
||||
tool_call_id_value if isinstance(tool_call_id_value, str) else None
|
||||
)
|
||||
message_with_tool_call = (
|
||||
message_by_tool_call_id.get(
|
||||
tool_call_id, last_message_with_tool_calls
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue