mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
Fix greptile review
This commit is contained in:
parent
5f6f3e662e
commit
f94e5e3417
2 changed files with 4 additions and 8 deletions
|
|
@ -686,18 +686,12 @@ class GeminiRealtimeConfig(BaseRealtimeConfig):
|
|||
verbose_logger.debug(
|
||||
f"Gemini Realtime: Transforming {len(function_calls)} tool call(s) to OpenAI format"
|
||||
)
|
||||
has_multiple_calls = len(function_calls) > 1
|
||||
|
||||
return [
|
||||
{
|
||||
"type": "response.function_call_arguments.done",
|
||||
"event_id": f"event_{uuid.uuid4()}",
|
||||
"response_id": resolved_response_id,
|
||||
"item_id": (
|
||||
f"{resolved_output_item_id}_tool_{idx}"
|
||||
if has_multiple_calls
|
||||
else resolved_output_item_id
|
||||
),
|
||||
"item_id": f"{resolved_output_item_id}_tool_{idx}",
|
||||
"output_index": idx,
|
||||
"call_id": fc.get("id", ""),
|
||||
"name": fc.get("name", ""),
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ def test_gemini_realtime_tool_call_transformation():
|
|||
assert function_call_event["call_id"] == "call_123"
|
||||
assert function_call_event["name"] == "get_weather"
|
||||
assert function_call_event["response_id"] == "resp_123"
|
||||
assert function_call_event["item_id"] == "item_123"
|
||||
assert function_call_event["item_id"] == "item_123_tool_0"
|
||||
assert function_call_event["output_index"] == 0
|
||||
|
||||
# Verify arguments are properly serialized as JSON string
|
||||
|
|
@ -579,6 +579,8 @@ def test_gemini_realtime_multi_tool_calls_have_unique_item_ids():
|
|||
assert len(responses) == 2
|
||||
assert responses[0]["response_id"] == "resp_123"
|
||||
assert responses[1]["response_id"] == "resp_123"
|
||||
assert responses[0]["item_id"] == "item_123_tool_0"
|
||||
assert responses[1]["item_id"] == "item_123_tool_1"
|
||||
assert responses[0]["item_id"] != responses[1]["item_id"]
|
||||
assert responses[0]["output_index"] == 0
|
||||
assert responses[1]["output_index"] == 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue