From f0ff8caddd9b75f78d2ac9560fb95bbfb243db0d Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 12 Jun 2026 00:55:35 +0000 Subject: [PATCH] test(translation): vendor the google characterization corpus (vertex_gemini/gemini/vertex_anthropic) --- .../cases/cache_control_messages.json | 33 ++++ .../cases/cache_control_tools.json | 54 +++++++ .../cases/full_combo.json | 76 +++++++++ .../cases/image_base64.json | 24 +++ .../cases/image_url.json | 29 ++++ .../cases/max_completion_tokens.json | 13 ++ .../cases/multi_turn.json | 21 +++ .../cases/params_sampling.json | 20 +++ .../cases/pdf_base64.json | 25 +++ .../cases/plain_text.json | 13 ++ .../cases/reasoning_effort_low.json | 17 ++ .../cases/response_format_json_object.json | 16 ++ .../cases/response_format_json_schema.json | 32 ++++ .../cases/system_prompt.json | 17 ++ .../cases/thinking_enabled.json | 20 +++ .../cases/thinking_history_blocks.json | 35 ++++ .../cases/tools_basic.json | 34 ++++ .../cases/tools_forced_choice.json | 39 +++++ .../cases/tools_parallel.json | 52 ++++++ .../cases/tools_streamed_args_roundtrip.json | 83 ++++++++++ .../fixtures/responses/gemini/text_basic.json | 36 +++++ .../fixtures/responses/gemini/thinking.json | 48 ++++++ .../fixtures/responses/gemini/tool_use.json | 48 ++++++ .../vertex_anthropic/text_basic.json | 16 ++ .../responses/vertex_anthropic/thinking.json | 23 +++ .../responses/vertex_anthropic/tool_use.json | 24 +++ .../responses/vertex_gemini/text_basic.json | 23 +++ .../responses/vertex_gemini/thinking.json | 32 ++++ .../responses/vertex_gemini/tool_use.json | 25 +++ .../fixtures/streams/gemini/text_stream.txt | 6 + .../fixtures/streams/gemini/tool_stream.txt | 4 + .../streams/vertex_anthropic/text_stream.txt | 23 +++ .../streams/vertex_anthropic/tool_stream.txt | 29 ++++ .../streams/vertex_gemini/text_stream.txt | 6 + .../streams/vertex_gemini/thinking_stream.txt | 6 + .../streams/vertex_gemini/tool_stream.txt | 4 + .../snapshots/envelopes/gemini.json | 4 + .../snapshots/envelopes/vertex_anthropic.json | 4 + .../snapshots/envelopes/vertex_gemini.json | 4 + .../gemini/cache_control_messages.json | 22 +++ .../requests/gemini/cache_control_tools.json | 51 ++++++ .../snapshots/requests/gemini/full_combo.json | 82 ++++++++++ .../requests/gemini/image_base64.json | 21 +++ .../gemini/max_completion_tokens.json | 15 ++ .../snapshots/requests/gemini/multi_turn.json | 31 ++++ .../requests/gemini/params_sampling.json | 21 +++ .../snapshots/requests/gemini/pdf_base64.json | 21 +++ .../snapshots/requests/gemini/plain_text.json | 15 ++ .../requests/gemini/reasoning_effort_low.json | 19 +++ .../gemini/response_format_json_object.json | 16 ++ .../gemini/response_format_json_schema.json | 28 ++++ .../requests/gemini/system_prompt.json | 22 +++ .../requests/gemini/thinking_enabled.json | 19 +++ .../gemini/thinking_history_blocks.json | 39 +++++ .../requests/gemini/tools_basic.json | 41 +++++ .../requests/gemini/tools_forced_choice.json | 44 +++++ .../requests/gemini/tools_parallel.json | 51 ++++++ .../gemini/tools_streamed_args_roundtrip.json | 93 +++++++++++ .../cache_control_messages.json | 27 ++++ .../vertex_anthropic/cache_control_tools.json | 52 ++++++ .../requests/vertex_anthropic/full_combo.json | 74 +++++++++ .../vertex_anthropic/image_base64.json | 23 +++ .../max_completion_tokens.json | 15 ++ .../requests/vertex_anthropic/multi_turn.json | 33 ++++ .../vertex_anthropic/params_sampling.json | 24 +++ .../requests/vertex_anthropic/pdf_base64.json | 23 +++ .../requests/vertex_anthropic/plain_text.json | 15 ++ .../reasoning_effort_low.json | 19 +++ .../response_format_json_object.json | 15 ++ .../response_format_json_schema.json | 36 +++++ .../vertex_anthropic/system_prompt.json | 21 +++ .../vertex_anthropic/thinking_enabled.json | 19 +++ .../thinking_history_blocks.json | 42 +++++ .../vertex_anthropic/tools_basic.json | 36 +++++ .../vertex_anthropic/tools_forced_choice.json | 37 +++++ .../vertex_anthropic/tools_parallel.json | 53 +++++++ .../tools_streamed_args_roundtrip.json | 85 ++++++++++ .../vertex_gemini/cache_control_messages.json | 22 +++ .../vertex_gemini/cache_control_tools.json | 51 ++++++ .../requests/vertex_gemini/full_combo.json | 82 ++++++++++ .../requests/vertex_gemini/image_base64.json | 21 +++ .../requests/vertex_gemini/image_url.json | 21 +++ .../vertex_gemini/max_completion_tokens.json | 15 ++ .../requests/vertex_gemini/multi_turn.json | 31 ++++ .../vertex_gemini/params_sampling.json | 21 +++ .../requests/vertex_gemini/pdf_base64.json | 21 +++ .../requests/vertex_gemini/plain_text.json | 15 ++ .../vertex_gemini/reasoning_effort_low.json | 19 +++ .../response_format_json_object.json | 16 ++ .../response_format_json_schema.json | 28 ++++ .../requests/vertex_gemini/system_prompt.json | 22 +++ .../vertex_gemini/thinking_enabled.json | 19 +++ .../thinking_history_blocks.json | 39 +++++ .../requests/vertex_gemini/tools_basic.json | 41 +++++ .../vertex_gemini/tools_forced_choice.json | 44 +++++ .../vertex_gemini/tools_parallel.json | 51 ++++++ .../tools_streamed_args_roundtrip.json | 93 +++++++++++ .../responses/gemini/text_basic.json | 41 +++++ .../snapshots/responses/gemini/thinking.json | 54 +++++++ .../snapshots/responses/gemini/tool_use.json | 60 +++++++ .../vertex_anthropic/text_basic.json | 44 +++++ .../responses/vertex_anthropic/thinking.json | 58 +++++++ .../responses/vertex_anthropic/tool_use.json | 54 +++++++ .../responses/vertex_gemini/text_basic.json | 41 +++++ .../responses/vertex_gemini/thinking.json | 54 +++++++ .../responses/vertex_gemini/tool_use.json | 60 +++++++ .../snapshots/streams/gemini/text_stream.json | 81 ++++++++++ .../snapshots/streams/gemini/tool_stream.json | 101 ++++++++++++ .../streams/vertex_anthropic/text_stream.json | 72 +++++++++ .../streams/vertex_anthropic/tool_stream.json | 150 ++++++++++++++++++ .../streams/vertex_gemini/text_stream.json | 81 ++++++++++ .../vertex_gemini/thinking_stream.json | 116 ++++++++++++++ .../streams/vertex_gemini/tool_stream.json | 101 ++++++++++++ 113 files changed, 4158 insertions(+) create mode 100644 tests/test_litellm/translation/characterization_google/cases/cache_control_messages.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/cache_control_tools.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/full_combo.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/image_base64.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/image_url.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/max_completion_tokens.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/multi_turn.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/params_sampling.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/pdf_base64.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/plain_text.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/reasoning_effort_low.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/response_format_json_object.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/response_format_json_schema.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/system_prompt.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/thinking_enabled.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/thinking_history_blocks.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/tools_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/tools_forced_choice.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/tools_parallel.json create mode 100644 tests/test_litellm/translation/characterization_google/cases/tools_streamed_args_roundtrip.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/text_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/thinking.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/tool_use.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/text_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/thinking.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/tool_use.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/text_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/thinking.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/tool_use.json create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/streams/gemini/text_stream.txt create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/streams/gemini/tool_stream.txt create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_anthropic/text_stream.txt create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_anthropic/tool_stream.txt create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/text_stream.txt create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/thinking_stream.txt create mode 100644 tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/tool_stream.txt create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/envelopes/gemini.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/envelopes/vertex_anthropic.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/envelopes/vertex_gemini.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/cache_control_messages.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/cache_control_tools.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/full_combo.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/image_base64.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/max_completion_tokens.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/multi_turn.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/params_sampling.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/pdf_base64.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/plain_text.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/reasoning_effort_low.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/response_format_json_object.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/response_format_json_schema.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/system_prompt.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/thinking_enabled.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/thinking_history_blocks.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_forced_choice.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_parallel.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_streamed_args_roundtrip.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/cache_control_messages.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/cache_control_tools.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/full_combo.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/image_base64.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/max_completion_tokens.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/multi_turn.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/params_sampling.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/pdf_base64.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/plain_text.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/reasoning_effort_low.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/response_format_json_object.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/response_format_json_schema.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/system_prompt.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/thinking_enabled.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/thinking_history_blocks.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_forced_choice.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_parallel.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_streamed_args_roundtrip.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/cache_control_messages.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/cache_control_tools.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/full_combo.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/image_base64.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/image_url.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/max_completion_tokens.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/multi_turn.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/params_sampling.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/pdf_base64.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/plain_text.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/reasoning_effort_low.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/response_format_json_object.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/response_format_json_schema.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/system_prompt.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/thinking_enabled.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/thinking_history_blocks.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_forced_choice.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_parallel.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_streamed_args_roundtrip.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/text_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/thinking.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/tool_use.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/text_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/thinking.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/tool_use.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/text_basic.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/thinking.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/tool_use.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/streams/gemini/text_stream.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/streams/gemini/tool_stream.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_anthropic/text_stream.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_anthropic/tool_stream.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/text_stream.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/thinking_stream.json create mode 100644 tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/tool_stream.json diff --git a/tests/test_litellm/translation/characterization_google/cases/cache_control_messages.json b/tests/test_litellm/translation/characterization_google/cases/cache_control_messages.json new file mode 100644 index 0000000000..2038a02658 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/cache_control_messages.json @@ -0,0 +1,33 @@ +{ + "id": "cache_control_messages", + "messages": [ + { + "content": [ + { + "cache_control": { + "type": "ephemeral" + }, + "text": "You are a terse geographer.", + "type": "text" + } + ], + "role": "system" + }, + { + "content": [ + { + "cache_control": { + "type": "ephemeral" + }, + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "params": { + "max_tokens": 256 + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/cache_control_tools.json b/tests/test_litellm/translation/characterization_google/cases/cache_control_tools.json new file mode 100644 index 0000000000..9b858e741b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/cache_control_tools.json @@ -0,0 +1,54 @@ +{ + "id": "cache_control_tools", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 256, + "tools": [ + { + "function": { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + "type": "function" + }, + { + "cache_control": { + "type": "ephemeral" + }, + "function": { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + }, + "type": "function" + } + ] + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/full_combo.json b/tests/test_litellm/translation/characterization_google/cases/full_combo.json new file mode 100644 index 0000000000..20320faf1b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/full_combo.json @@ -0,0 +1,76 @@ +{ + "id": "full_combo", + "messages": [ + { + "content": [ + { + "cache_control": { + "type": "ephemeral" + }, + "text": "You are a terse geographer.", + "type": "text" + } + ], + "role": "system" + }, + { + "content": "Weather in Paris?", + "role": "user" + }, + { + "content": null, + "role": "assistant", + "tool_calls": [ + { + "function": { + "arguments": "{\"city\": \"Paris\"}", + "name": "get_weather" + }, + "id": "call_char_001", + "type": "function" + } + ] + }, + { + "content": "18C, clear", + "role": "tool", + "tool_call_id": "call_char_001" + }, + { + "content": "Summarize, then check the weather again.", + "role": "user" + } + ], + "params": { + "max_tokens": 2048, + "temperature": 1, + "thinking": { + "budget_tokens": 1024, + "type": "enabled" + }, + "tools": [ + { + "function": { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + "type": "function" + } + ] + }, + "skip": { + "azure": "v1 get_optional_params raises UnsupportedParamsError for `thinking` on gpt-4.1 (non-reasoning openai-family model)", + "openai": "v1 get_optional_params raises UnsupportedParamsError for `thinking` on gpt-4.1 (non-reasoning openai-family model)" + } +} diff --git a/tests/test_litellm/translation/characterization_google/cases/image_base64.json b/tests/test_litellm/translation/characterization_google/cases/image_base64.json new file mode 100644 index 0000000000..a22a64db96 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/image_base64.json @@ -0,0 +1,24 @@ +{ + "id": "image_base64", + "messages": [ + { + "content": [ + { + "text": "Describe this image.", + "type": "text" + }, + { + "image_url": { + "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==" + }, + "type": "image_url" + } + ], + "role": "user" + } + ], + "params": { + "max_tokens": 256 + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/image_url.json b/tests/test_litellm/translation/characterization_google/cases/image_url.json new file mode 100644 index 0000000000..be96ae3bab --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/image_url.json @@ -0,0 +1,29 @@ +{ + "id": "image_url", + "messages": [ + { + "content": [ + { + "text": "Describe this image.", + "type": "text" + }, + { + "image_url": { + "url": "https://example.com/cat.png" + }, + "type": "image_url" + } + ], + "role": "user" + } + ], + "params": { + "max_tokens": 256 + }, + "skip": { + "bedrock_converse": "v1 downloads URL media for bedrock transforms (network)", + "bedrock_invoke": "v1 downloads URL media for bedrock transforms (network)", + "gemini": "v1 downloads URL media for google ai studio transforms (network); the vertex_ai gemini route passes the URL through as fileData and is pinned", + "vertex_anthropic": "v1 downloads URL media for claude-on-vertex transforms (network); native anthropic passes the URL through and is pinned" + } +} diff --git a/tests/test_litellm/translation/characterization_google/cases/max_completion_tokens.json b/tests/test_litellm/translation/characterization_google/cases/max_completion_tokens.json new file mode 100644 index 0000000000..e080a4872c --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/max_completion_tokens.json @@ -0,0 +1,13 @@ +{ + "id": "max_completion_tokens", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_completion_tokens": 512 + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/multi_turn.json b/tests/test_litellm/translation/characterization_google/cases/multi_turn.json new file mode 100644 index 0000000000..1c69bffa87 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/multi_turn.json @@ -0,0 +1,21 @@ +{ + "id": "multi_turn", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + }, + { + "content": "Paris.", + "role": "assistant" + }, + { + "content": "And of Italy?", + "role": "user" + } + ], + "params": { + "max_tokens": 256 + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/params_sampling.json b/tests/test_litellm/translation/characterization_google/cases/params_sampling.json new file mode 100644 index 0000000000..f065a9170c --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/params_sampling.json @@ -0,0 +1,20 @@ +{ + "id": "params_sampling", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 128, + "stop": [ + "\n\n", + "END" + ], + "temperature": 0.2, + "top_p": 0.9, + "user": "char-user-1234" + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/pdf_base64.json b/tests/test_litellm/translation/characterization_google/cases/pdf_base64.json new file mode 100644 index 0000000000..3db2c791e6 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/pdf_base64.json @@ -0,0 +1,25 @@ +{ + "id": "pdf_base64", + "messages": [ + { + "content": [ + { + "text": "Summarize this document.", + "type": "text" + }, + { + "file": { + "file_data": "data:application/pdf;base64,JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbXS9Db3VudCAwPj5lbmRvYmoKdHJhaWxlcjw8L1Jvb3QgMSAwIFI+PgolJUVPRgo=", + "filename": "char.pdf" + }, + "type": "file" + } + ], + "role": "user" + } + ], + "params": { + "max_tokens": 256 + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/plain_text.json b/tests/test_litellm/translation/characterization_google/cases/plain_text.json new file mode 100644 index 0000000000..92bd6787ed --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/plain_text.json @@ -0,0 +1,13 @@ +{ + "id": "plain_text", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 256 + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/reasoning_effort_low.json b/tests/test_litellm/translation/characterization_google/cases/reasoning_effort_low.json new file mode 100644 index 0000000000..9192da9cb1 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/reasoning_effort_low.json @@ -0,0 +1,17 @@ +{ + "id": "reasoning_effort_low", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 2048, + "reasoning_effort": "low" + }, + "skip": { + "azure": "v1 get_optional_params raises UnsupportedParamsError for `reasoning_effort` on gpt-4.1 (non-reasoning openai-family model)", + "openai": "v1 get_optional_params raises UnsupportedParamsError for `reasoning_effort` on gpt-4.1 (non-reasoning openai-family model)" + } +} diff --git a/tests/test_litellm/translation/characterization_google/cases/response_format_json_object.json b/tests/test_litellm/translation/characterization_google/cases/response_format_json_object.json new file mode 100644 index 0000000000..318c8e5461 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/response_format_json_object.json @@ -0,0 +1,16 @@ +{ + "id": "response_format_json_object", + "messages": [ + { + "content": "Reply in JSON: capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 256, + "response_format": { + "type": "json_object" + } + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/response_format_json_schema.json b/tests/test_litellm/translation/characterization_google/cases/response_format_json_schema.json new file mode 100644 index 0000000000..5846118e5f --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/response_format_json_schema.json @@ -0,0 +1,32 @@ +{ + "id": "response_format_json_schema", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 256, + "response_format": { + "json_schema": { + "name": "capital", + "schema": { + "additionalProperties": false, + "properties": { + "capital": { + "type": "string" + } + }, + "required": [ + "capital" + ], + "type": "object" + }, + "strict": true + }, + "type": "json_schema" + } + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/system_prompt.json b/tests/test_litellm/translation/characterization_google/cases/system_prompt.json new file mode 100644 index 0000000000..048bbf1a58 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/system_prompt.json @@ -0,0 +1,17 @@ +{ + "id": "system_prompt", + "messages": [ + { + "content": "You are a terse geographer.", + "role": "system" + }, + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 256 + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/thinking_enabled.json b/tests/test_litellm/translation/characterization_google/cases/thinking_enabled.json new file mode 100644 index 0000000000..c1a33a4351 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/thinking_enabled.json @@ -0,0 +1,20 @@ +{ + "id": "thinking_enabled", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 2048, + "thinking": { + "budget_tokens": 1024, + "type": "enabled" + } + }, + "skip": { + "azure": "v1 get_optional_params raises UnsupportedParamsError for `thinking` on gpt-4.1 (non-reasoning openai-family model)", + "openai": "v1 get_optional_params raises UnsupportedParamsError for `thinking` on gpt-4.1 (non-reasoning openai-family model)" + } +} diff --git a/tests/test_litellm/translation/characterization_google/cases/thinking_history_blocks.json b/tests/test_litellm/translation/characterization_google/cases/thinking_history_blocks.json new file mode 100644 index 0000000000..727aa89d8b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/thinking_history_blocks.json @@ -0,0 +1,35 @@ +{ + "id": "thinking_history_blocks", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + }, + { + "content": "Paris.", + "role": "assistant", + "thinking_blocks": [ + { + "signature": "sig-char-deadbeef", + "thinking": "The user asks about France; the capital is Paris.", + "type": "thinking" + } + ] + }, + { + "content": "And of Italy?", + "role": "user" + } + ], + "params": { + "max_tokens": 2048, + "thinking": { + "budget_tokens": 1024, + "type": "enabled" + } + }, + "skip": { + "azure": "v1 get_optional_params raises UnsupportedParamsError for `thinking` on gpt-4.1 (non-reasoning openai-family model)", + "openai": "v1 get_optional_params raises UnsupportedParamsError for `thinking` on gpt-4.1 (non-reasoning openai-family model)" + } +} diff --git a/tests/test_litellm/translation/characterization_google/cases/tools_basic.json b/tests/test_litellm/translation/characterization_google/cases/tools_basic.json new file mode 100644 index 0000000000..cc0f3a7b54 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/tools_basic.json @@ -0,0 +1,34 @@ +{ + "id": "tools_basic", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 256, + "tool_choice": "auto", + "tools": [ + { + "function": { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + "type": "function" + } + ] + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/tools_forced_choice.json b/tests/test_litellm/translation/characterization_google/cases/tools_forced_choice.json new file mode 100644 index 0000000000..e40eeaeec3 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/tools_forced_choice.json @@ -0,0 +1,39 @@ +{ + "id": "tools_forced_choice", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 256, + "tool_choice": { + "function": { + "name": "get_weather" + }, + "type": "function" + }, + "tools": [ + { + "function": { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + "type": "function" + } + ] + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/tools_parallel.json b/tests/test_litellm/translation/characterization_google/cases/tools_parallel.json new file mode 100644 index 0000000000..8e90a550fc --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/tools_parallel.json @@ -0,0 +1,52 @@ +{ + "id": "tools_parallel", + "messages": [ + { + "content": "What is the capital of France?", + "role": "user" + } + ], + "params": { + "max_tokens": 256, + "parallel_tool_calls": true, + "tools": [ + { + "function": { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + "type": "function" + }, + { + "function": { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + }, + "type": "function" + } + ] + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/cases/tools_streamed_args_roundtrip.json b/tests/test_litellm/translation/characterization_google/cases/tools_streamed_args_roundtrip.json new file mode 100644 index 0000000000..887519d1cb --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/cases/tools_streamed_args_roundtrip.json @@ -0,0 +1,83 @@ +{ + "id": "tools_streamed_args_roundtrip", + "messages": [ + { + "content": "Weather and time in Paris?", + "role": "user" + }, + { + "content": null, + "role": "assistant", + "tool_calls": [ + { + "function": { + "arguments": "{\"city\": \"Paris\"}", + "name": "get_weather" + }, + "id": "call_char_001", + "type": "function" + }, + { + "function": { + "arguments": "{\"tz\": \"Europe/Paris\"}", + "name": "get_time" + }, + "id": "call_char_002", + "type": "function" + } + ] + }, + { + "content": "18C, clear", + "role": "tool", + "tool_call_id": "call_char_001" + }, + { + "content": "14:05", + "role": "tool", + "tool_call_id": "call_char_002" + } + ], + "params": { + "max_tokens": 256, + "tools": [ + { + "function": { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + "type": "function" + }, + { + "function": { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + }, + "type": "function" + } + ] + }, + "skip": {} +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/text_basic.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/text_basic.json new file mode 100644 index 0000000000..eeb275ec4e --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/text_basic.json @@ -0,0 +1,36 @@ +{ + "candidates": [ + { + "content": { + "role": "model", + "parts": [ + { + "text": "The capital of France is Paris." + } + ] + }, + "finishReason": "STOP", + "avgLogprobs": -0.0125 + } + ], + "usageMetadata": { + "promptTokenCount": 8, + "candidatesTokenCount": 8, + "totalTokenCount": 16, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 8 + } + ], + "candidatesTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 8 + } + ] + }, + "modelVersion": "gemini-2.5-flash", + "createTime": "2025-05-24T00:00:00.000000Z", + "responseId": "char-gemini-text-0001" +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/thinking.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/thinking.json new file mode 100644 index 0000000000..fef7ca0ba6 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/thinking.json @@ -0,0 +1,48 @@ +{ + "candidates": [ + { + "content": { + "role": "model", + "parts": [ + { + "text": "The user asks about France. The capital is Paris.", + "thought": true, + "thoughtSignature": "c2lnLWNoYXItdmVydGV4LWdlbWluaQ==" + }, + { + "text": "The capital of France is Paris." + } + ] + }, + "finishReason": "STOP" + } + ], + "usageMetadata": { + "promptTokenCount": 1290, + "candidatesTokenCount": 8, + "totalTokenCount": 1450, + "thoughtsTokenCount": 152, + "cachedContentTokenCount": 1024, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 1290 + } + ], + "cacheTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 1024 + } + ], + "candidatesTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 8 + } + ] + }, + "modelVersion": "gemini-2.5-flash", + "createTime": "2025-05-24T00:00:00.000000Z", + "responseId": "char-gemini-think-0001" +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/tool_use.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/tool_use.json new file mode 100644 index 0000000000..678ae52794 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/gemini/tool_use.json @@ -0,0 +1,48 @@ +{ + "candidates": [ + { + "content": { + "role": "model", + "parts": [ + { + "functionCall": { + "name": "get_weather", + "args": { + "city": "Paris" + } + } + }, + { + "functionCall": { + "name": "get_time", + "args": { + "tz": "Europe/Paris" + } + } + } + ] + }, + "finishReason": "STOP" + } + ], + "usageMetadata": { + "promptTokenCount": 74, + "candidatesTokenCount": 22, + "totalTokenCount": 96, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 74 + } + ], + "candidatesTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 22 + } + ] + }, + "modelVersion": "gemini-2.5-flash", + "createTime": "2025-05-24T00:00:00.000000Z", + "responseId": "char-gemini-tool-0001" +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/text_basic.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/text_basic.json new file mode 100644 index 0000000000..b1ffe51745 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/text_basic.json @@ -0,0 +1,16 @@ +{ + "id": "msg_vrtx_01CharVtxText0001", + "type": "message", + "role": "assistant", + "model": "claude-sonnet-4-20250514", + "content": [{"type": "text", "text": "The capital of France is Paris."}], + "stop_reason": "end_turn", + "stop_sequence": null, + "usage": { + "input_tokens": 14, + "output_tokens": 9, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "service_tier": "standard" + } +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/thinking.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/thinking.json new file mode 100644 index 0000000000..dc1a9480d9 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/thinking.json @@ -0,0 +1,23 @@ +{ + "id": "msg_vrtx_01CharVtxThink001", + "type": "message", + "role": "assistant", + "model": "claude-sonnet-4-20250514", + "content": [ + { + "type": "thinking", + "thinking": "The user asks about France. The capital is Paris.", + "signature": "sig-char-vertex-anthropic-001" + }, + {"type": "text", "text": "The capital of France is Paris."} + ], + "stop_reason": "end_turn", + "stop_sequence": null, + "usage": { + "input_tokens": 42, + "output_tokens": 71, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "service_tier": "standard" + } +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/tool_use.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/tool_use.json new file mode 100644 index 0000000000..f19884392e --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_anthropic/tool_use.json @@ -0,0 +1,24 @@ +{ + "id": "msg_vrtx_01CharVtxTool0001", + "type": "message", + "role": "assistant", + "model": "claude-sonnet-4-20250514", + "content": [ + {"type": "text", "text": "I'll check the weather in Paris."}, + { + "type": "tool_use", + "id": "toolu_vrtx_01CharWeather01", + "name": "get_weather", + "input": {"city": "Paris"} + } + ], + "stop_reason": "tool_use", + "stop_sequence": null, + "usage": { + "input_tokens": 410, + "output_tokens": 67, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "service_tier": "standard" + } +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/text_basic.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/text_basic.json new file mode 100644 index 0000000000..c3397b5f85 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/text_basic.json @@ -0,0 +1,23 @@ +{ + "candidates": [ + { + "content": { + "role": "model", + "parts": [{"text": "The capital of France is Paris."}] + }, + "finishReason": "STOP", + "avgLogprobs": -0.0125 + } + ], + "usageMetadata": { + "promptTokenCount": 8, + "candidatesTokenCount": 8, + "totalTokenCount": 16, + "promptTokensDetails": [{"modality": "TEXT", "tokenCount": 8}], + "candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 8}], + "trafficType": "ON_DEMAND" + }, + "modelVersion": "gemini-2.5-pro", + "createTime": "2025-05-24T00:00:00.000000Z", + "responseId": "char-vertex-gemini-text-0001" +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/thinking.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/thinking.json new file mode 100644 index 0000000000..d20a9f0df8 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/thinking.json @@ -0,0 +1,32 @@ +{ + "candidates": [ + { + "content": { + "role": "model", + "parts": [ + { + "text": "The user asks about France. The capital is Paris.", + "thought": true, + "thoughtSignature": "c2lnLWNoYXItdmVydGV4LWdlbWluaQ==" + }, + {"text": "The capital of France is Paris."} + ] + }, + "finishReason": "STOP" + } + ], + "usageMetadata": { + "promptTokenCount": 1290, + "candidatesTokenCount": 8, + "totalTokenCount": 1450, + "thoughtsTokenCount": 152, + "cachedContentTokenCount": 1024, + "promptTokensDetails": [{"modality": "TEXT", "tokenCount": 1290}], + "cacheTokensDetails": [{"modality": "TEXT", "tokenCount": 1024}], + "candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 8}], + "trafficType": "ON_DEMAND" + }, + "modelVersion": "gemini-2.5-pro", + "createTime": "2025-05-24T00:00:00.000000Z", + "responseId": "char-vertex-gemini-think-0001" +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/tool_use.json b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/tool_use.json new file mode 100644 index 0000000000..9114f91b16 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/responses/vertex_gemini/tool_use.json @@ -0,0 +1,25 @@ +{ + "candidates": [ + { + "content": { + "role": "model", + "parts": [ + {"functionCall": {"name": "get_weather", "args": {"city": "Paris"}}}, + {"functionCall": {"name": "get_time", "args": {"tz": "Europe/Paris"}}} + ] + }, + "finishReason": "STOP" + } + ], + "usageMetadata": { + "promptTokenCount": 74, + "candidatesTokenCount": 22, + "totalTokenCount": 96, + "promptTokensDetails": [{"modality": "TEXT", "tokenCount": 74}], + "candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 22}], + "trafficType": "ON_DEMAND" + }, + "modelVersion": "gemini-2.5-pro", + "createTime": "2025-05-24T00:00:00.000000Z", + "responseId": "char-vertex-gemini-tool-0001" +} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/streams/gemini/text_stream.txt b/tests/test_litellm/translation/characterization_google/fixtures/streams/gemini/text_stream.txt new file mode 100644 index 0000000000..03feac6bea --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/streams/gemini/text_stream.txt @@ -0,0 +1,6 @@ +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": "Paris is the"}]}}], "modelVersion": "gemini-2.5-flash", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-gemini-stream-text-0001"} + +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": " capital of France."}]}}], "modelVersion": "gemini-2.5-flash", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-gemini-stream-text-0001"} + +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": ""}]}, "finishReason": "STOP"}], "usageMetadata": {"promptTokenCount": 8, "candidatesTokenCount": 8, "totalTokenCount": 16, "promptTokensDetails": [{"modality": "TEXT", "tokenCount": 8}], "candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 8}]}, "modelVersion": "gemini-2.5-flash", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-gemini-stream-text-0001"} + diff --git a/tests/test_litellm/translation/characterization_google/fixtures/streams/gemini/tool_stream.txt b/tests/test_litellm/translation/characterization_google/fixtures/streams/gemini/tool_stream.txt new file mode 100644 index 0000000000..6ab291c3e1 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/streams/gemini/tool_stream.txt @@ -0,0 +1,4 @@ +data: {"candidates": [{"content": {"role": "model", "parts": [{"functionCall": {"name": "get_weather", "args": {"city": "Paris"}}}]}}], "modelVersion": "gemini-2.5-flash", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-gemini-stream-tool-0001"} + +data: {"candidates": [{"content": {"role": "model", "parts": [{"functionCall": {"name": "get_time", "args": {"tz": "Europe/Paris"}}}]}, "finishReason": "STOP"}], "usageMetadata": {"promptTokenCount": 74, "candidatesTokenCount": 22, "totalTokenCount": 96, "promptTokensDetails": [{"modality": "TEXT", "tokenCount": 74}], "candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 22}]}, "modelVersion": "gemini-2.5-flash", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-gemini-stream-tool-0001"} + diff --git a/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_anthropic/text_stream.txt b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_anthropic/text_stream.txt new file mode 100644 index 0000000000..b0705d743b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_anthropic/text_stream.txt @@ -0,0 +1,23 @@ +event: message_start +data: {"type":"message_start","message":{"id":"msg_vrtx_01CharVtxStrTxt01","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":12,"output_tokens":1}}} + +event: ping +data: {"type": "ping"} + +event: content_block_start +data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + +event: content_block_delta +data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Paris is the"}} + +event: content_block_delta +data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" capital of France."}} + +event: content_block_stop +data: {"type":"content_block_stop","index":0} + +event: message_delta +data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":9}} + +event: message_stop +data: {"type":"message_stop"} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_anthropic/tool_stream.txt b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_anthropic/tool_stream.txt new file mode 100644 index 0000000000..bb189829d8 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_anthropic/tool_stream.txt @@ -0,0 +1,29 @@ +event: message_start +data: {"type":"message_start","message":{"id":"msg_vrtx_01CharVtxStrTul01","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":410,"output_tokens":3}}} + +event: content_block_start +data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + +event: content_block_delta +data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll check the weather in Paris."}} + +event: content_block_stop +data: {"type":"content_block_stop","index":0} + +event: content_block_start +data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_vrtx_01CharWeather01","name":"get_weather","input":{}}} + +event: content_block_delta +data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"city\""}} + +event: content_block_delta +data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":": \"Paris\"}"}} + +event: content_block_stop +data: {"type":"content_block_stop","index":1} + +event: message_delta +data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"output_tokens":67}} + +event: message_stop +data: {"type":"message_stop"} diff --git a/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/text_stream.txt b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/text_stream.txt new file mode 100644 index 0000000000..472425bae6 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/text_stream.txt @@ -0,0 +1,6 @@ +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": "Paris is the"}]}}], "modelVersion": "gemini-2.5-pro", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-vertex-gemini-stream-text-0001"} + +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": " capital of France."}]}}], "modelVersion": "gemini-2.5-pro", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-vertex-gemini-stream-text-0001"} + +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": ""}]}, "finishReason": "STOP"}], "usageMetadata": {"promptTokenCount": 8, "candidatesTokenCount": 8, "totalTokenCount": 16, "promptTokensDetails": [{"modality": "TEXT", "tokenCount": 8}], "candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 8}], "trafficType": "ON_DEMAND"}, "modelVersion": "gemini-2.5-pro", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-vertex-gemini-stream-text-0001"} + diff --git a/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/thinking_stream.txt b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/thinking_stream.txt new file mode 100644 index 0000000000..76ad200f9e --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/thinking_stream.txt @@ -0,0 +1,6 @@ +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": "The user asks about France.", "thought": true}]}}], "modelVersion": "gemini-2.5-pro", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-vertex-gemini-stream-think-0001"} + +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": " The capital is Paris.", "thought": true, "thoughtSignature": "c2lnLWNoYXItdmVydGV4LWdlbWluaQ=="}]}}], "modelVersion": "gemini-2.5-pro", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-vertex-gemini-stream-think-0001"} + +data: {"candidates": [{"content": {"role": "model", "parts": [{"text": "The capital of France is Paris."}]}, "finishReason": "STOP"}], "usageMetadata": {"promptTokenCount": 42, "candidatesTokenCount": 8, "totalTokenCount": 202, "thoughtsTokenCount": 152, "promptTokensDetails": [{"modality": "TEXT", "tokenCount": 42}], "candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 8}], "trafficType": "ON_DEMAND"}, "modelVersion": "gemini-2.5-pro", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-vertex-gemini-stream-think-0001"} + diff --git a/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/tool_stream.txt b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/tool_stream.txt new file mode 100644 index 0000000000..9a0fcea5ad --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/fixtures/streams/vertex_gemini/tool_stream.txt @@ -0,0 +1,4 @@ +data: {"candidates": [{"content": {"role": "model", "parts": [{"functionCall": {"name": "get_weather", "args": {"city": "Paris"}}}]}}], "modelVersion": "gemini-2.5-pro", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-vertex-gemini-stream-tool-0001"} + +data: {"candidates": [{"content": {"role": "model", "parts": [{"functionCall": {"name": "get_time", "args": {"tz": "Europe/Paris"}}}]}, "finishReason": "STOP"}], "usageMetadata": {"promptTokenCount": 74, "candidatesTokenCount": 22, "totalTokenCount": 96, "promptTokensDetails": [{"modality": "TEXT", "tokenCount": 74}], "candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 22}], "trafficType": "ON_DEMAND"}, "modelVersion": "gemini-2.5-pro", "createTime": "2025-05-24T00:00:00.000000Z", "responseId": "char-vertex-gemini-stream-tool-0001"} + diff --git a/tests/test_litellm/translation/characterization_google/snapshots/envelopes/gemini.json b/tests/test_litellm/translation/characterization_google/snapshots/envelopes/gemini.json new file mode 100644 index 0000000000..f564bfa3ec --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/envelopes/gemini.json @@ -0,0 +1,4 @@ +{ + "stream_url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse", + "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent" +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/envelopes/vertex_anthropic.json b/tests/test_litellm/translation/characterization_google/snapshots/envelopes/vertex_anthropic.json new file mode 100644 index 0000000000..24dcfc9201 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/envelopes/vertex_anthropic.json @@ -0,0 +1,4 @@ +{ + "stream_url": "https://us-east5-aiplatform.googleapis.com/v1/projects/char-test-project/locations/us-east5/publishers/anthropic/models/claude-sonnet-4@20250514:streamRawPredict", + "url": "https://us-east5-aiplatform.googleapis.com/v1/projects/char-test-project/locations/us-east5/publishers/anthropic/models/claude-sonnet-4@20250514:rawPredict" +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/envelopes/vertex_gemini.json b/tests/test_litellm/translation/characterization_google/snapshots/envelopes/vertex_gemini.json new file mode 100644 index 0000000000..3244155f3c --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/envelopes/vertex_gemini.json @@ -0,0 +1,4 @@ +{ + "stream_url": "https://us-central1-aiplatform.googleapis.com/v1/projects/char-test-project/locations/us-central1/publishers/google/models/gemini-2.5-pro:streamGenerateContent?alt=sse", + "url": "https://us-central1-aiplatform.googleapis.com/v1/projects/char-test-project/locations/us-central1/publishers/google/models/gemini-2.5-pro:generateContent" +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/cache_control_messages.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/cache_control_messages.json new file mode 100644 index 0000000000..2aee10031c --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/cache_control_messages.json @@ -0,0 +1,22 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "system_instruction": { + "parts": [ + { + "text": "You are a terse geographer." + } + ] + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/cache_control_tools.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/cache_control_tools.json new file mode 100644 index 0000000000..6d33af9f80 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/cache_control_tools.json @@ -0,0 +1,51 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/full_combo.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/full_combo.json new file mode 100644 index 0000000000..4bb5fa9fb9 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/full_combo.json @@ -0,0 +1,82 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Weather in Paris?" + } + ], + "role": "user" + }, + { + "parts": [ + { + "function_call": { + "args": { + "city": "Paris" + }, + "name": "get_weather" + } + } + ], + "role": "model" + }, + { + "parts": [ + { + "function_response": { + "name": "get_weather", + "response": { + "content": "18C, clear" + } + } + } + ], + "role": "user" + }, + { + "parts": [ + { + "text": "Summarize, then check the weather again." + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 2048, + "temperature": 1, + "thinkingConfig": { + "includeThoughts": true, + "thinkingBudget": 1024 + } + }, + "system_instruction": { + "parts": [ + { + "text": "You are a terse geographer." + } + ] + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/image_base64.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/image_base64.json new file mode 100644 index 0000000000..82ab913531 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/image_base64.json @@ -0,0 +1,21 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Describe this image." + }, + { + "inline_data": { + "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==", + "mime_type": "image/png" + } + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/max_completion_tokens.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/max_completion_tokens.json new file mode 100644 index 0000000000..f3bfd3ba2f --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/max_completion_tokens.json @@ -0,0 +1,15 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 512 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/multi_turn.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/multi_turn.json new file mode 100644 index 0000000000..3bdbe68419 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/multi_turn.json @@ -0,0 +1,31 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + }, + { + "parts": [ + { + "text": "Paris." + } + ], + "role": "model" + }, + { + "parts": [ + { + "text": "And of Italy?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/params_sampling.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/params_sampling.json new file mode 100644 index 0000000000..1362e2e466 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/params_sampling.json @@ -0,0 +1,21 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 128, + "stop_sequences": [ + "\n\n", + "END" + ], + "temperature": 0.2, + "top_p": 0.9 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/pdf_base64.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/pdf_base64.json new file mode 100644 index 0000000000..b6c6b75d6b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/pdf_base64.json @@ -0,0 +1,21 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Summarize this document." + }, + { + "inline_data": { + "data": "JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbXS9Db3VudCAwPj5lbmRvYmoKdHJhaWxlcjw8L1Jvb3QgMSAwIFI+PgolJUVPRgo=", + "mime_type": "application/pdf" + } + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/plain_text.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/plain_text.json new file mode 100644 index 0000000000..7060b660e2 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/plain_text.json @@ -0,0 +1,15 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/reasoning_effort_low.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/reasoning_effort_low.json new file mode 100644 index 0000000000..7e1434cac8 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/reasoning_effort_low.json @@ -0,0 +1,19 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 2048, + "thinkingConfig": { + "includeThoughts": true, + "thinkingBudget": 1024 + } + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/response_format_json_object.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/response_format_json_object.json new file mode 100644 index 0000000000..847d6c5601 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/response_format_json_object.json @@ -0,0 +1,16 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Reply in JSON: capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256, + "response_mime_type": "application/json" + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/response_format_json_schema.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/response_format_json_schema.json new file mode 100644 index 0000000000..ce579acff6 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/response_format_json_schema.json @@ -0,0 +1,28 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256, + "response_json_schema": { + "additionalProperties": false, + "properties": { + "capital": { + "type": "string" + } + }, + "required": [ + "capital" + ], + "type": "object" + }, + "response_mime_type": "application/json" + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/system_prompt.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/system_prompt.json new file mode 100644 index 0000000000..2aee10031c --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/system_prompt.json @@ -0,0 +1,22 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "system_instruction": { + "parts": [ + { + "text": "You are a terse geographer." + } + ] + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/thinking_enabled.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/thinking_enabled.json new file mode 100644 index 0000000000..7e1434cac8 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/thinking_enabled.json @@ -0,0 +1,19 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 2048, + "thinkingConfig": { + "includeThoughts": true, + "thinkingBudget": 1024 + } + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/thinking_history_blocks.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/thinking_history_blocks.json new file mode 100644 index 0000000000..df4cb34c5b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/thinking_history_blocks.json @@ -0,0 +1,39 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + }, + { + "parts": [ + { + "text": "The user asks about France; the capital is Paris.", + "thoughtSignature": "sig-char-deadbeef" + }, + { + "text": "Paris." + } + ], + "role": "model" + }, + { + "parts": [ + { + "text": "And of Italy?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 2048, + "thinkingConfig": { + "includeThoughts": true, + "thinkingBudget": 1024 + } + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_basic.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_basic.json new file mode 100644 index 0000000000..dec3268206 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_basic.json @@ -0,0 +1,41 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "toolConfig": { + "functionCallingConfig": { + "mode": "AUTO" + } + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_forced_choice.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_forced_choice.json new file mode 100644 index 0000000000..e0084c7a89 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_forced_choice.json @@ -0,0 +1,44 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "toolConfig": { + "functionCallingConfig": { + "allowed_function_names": [ + "get_weather" + ], + "mode": "ANY" + } + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_parallel.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_parallel.json new file mode 100644 index 0000000000..6d33af9f80 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_parallel.json @@ -0,0 +1,51 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_streamed_args_roundtrip.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_streamed_args_roundtrip.json new file mode 100644 index 0000000000..1b04dc5acb --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/gemini/tools_streamed_args_roundtrip.json @@ -0,0 +1,93 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Weather and time in Paris?" + } + ], + "role": "user" + }, + { + "parts": [ + { + "function_call": { + "args": { + "city": "Paris" + }, + "name": "get_weather" + } + }, + { + "function_call": { + "args": { + "tz": "Europe/Paris" + }, + "name": "get_time" + } + } + ], + "role": "model" + }, + { + "parts": [ + { + "function_response": { + "name": "get_weather", + "response": { + "content": "18C, clear" + } + } + }, + { + "function_response": { + "name": "get_time", + "response": { + "content": "14:05" + } + } + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/cache_control_messages.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/cache_control_messages.json new file mode 100644 index 0000000000..a611a7b7b0 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/cache_control_messages.json @@ -0,0 +1,27 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "cache_control": { + "type": "ephemeral" + }, + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "system": [ + { + "cache_control": { + "type": "ephemeral" + }, + "text": "You are a terse geographer.", + "type": "text" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/cache_control_tools.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/cache_control_tools.json new file mode 100644 index 0000000000..f92d13e8a0 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/cache_control_tools.json @@ -0,0 +1,52 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "tools": [ + { + "description": "Get current weather for a city.", + "input_schema": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "name": "get_weather", + "type": "custom" + }, + { + "cache_control": { + "type": "ephemeral" + }, + "description": "Get current time for a timezone.", + "input_schema": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + }, + "name": "get_time", + "type": "custom" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/full_combo.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/full_combo.json new file mode 100644 index 0000000000..41209a1dbf --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/full_combo.json @@ -0,0 +1,74 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 2048, + "messages": [ + { + "content": [ + { + "text": "Weather in Paris?", + "type": "text" + } + ], + "role": "user" + }, + { + "content": [ + { + "id": "call_char_001", + "input": { + "city": "Paris" + }, + "name": "get_weather", + "type": "tool_use" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "content": "18C, clear", + "tool_use_id": "call_char_001", + "type": "tool_result" + }, + { + "text": "Summarize, then check the weather again.", + "type": "text" + } + ], + "role": "user" + } + ], + "system": [ + { + "cache_control": { + "type": "ephemeral" + }, + "text": "You are a terse geographer.", + "type": "text" + } + ], + "temperature": 1, + "thinking": { + "budget_tokens": 1024, + "type": "enabled" + }, + "tools": [ + { + "description": "Get current weather for a city.", + "input_schema": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "name": "get_weather", + "type": "custom" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/image_base64.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/image_base64.json new file mode 100644 index 0000000000..e05a6fee42 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/image_base64.json @@ -0,0 +1,23 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "Describe this image.", + "type": "text" + }, + { + "source": { + "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==", + "media_type": "image/png", + "type": "base64" + }, + "type": "image" + } + ], + "role": "user" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/max_completion_tokens.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/max_completion_tokens.json new file mode 100644 index 0000000000..c135d0bf23 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/max_completion_tokens.json @@ -0,0 +1,15 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 512, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/multi_turn.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/multi_turn.json new file mode 100644 index 0000000000..9039a97e5b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/multi_turn.json @@ -0,0 +1,33 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + }, + { + "content": [ + { + "text": "Paris.", + "type": "text" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "text": "And of Italy?", + "type": "text" + } + ], + "role": "user" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/params_sampling.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/params_sampling.json new file mode 100644 index 0000000000..c610ad5c78 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/params_sampling.json @@ -0,0 +1,24 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 128, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "metadata": { + "user_id": "char-user-1234" + }, + "stop_sequences": [ + "\n\n", + "END" + ], + "temperature": 0.2, + "top_p": 0.9 +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/pdf_base64.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/pdf_base64.json new file mode 100644 index 0000000000..3b2824aa89 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/pdf_base64.json @@ -0,0 +1,23 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "Summarize this document.", + "type": "text" + }, + { + "source": { + "data": "JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbXS9Db3VudCAwPj5lbmRvYmoKdHJhaWxlcjw8L1Jvb3QgMSAwIFI+PgolJUVPRgo=", + "media_type": "application/pdf", + "type": "base64" + }, + "type": "document" + } + ], + "role": "user" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/plain_text.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/plain_text.json new file mode 100644 index 0000000000..1556d441ff --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/plain_text.json @@ -0,0 +1,15 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/reasoning_effort_low.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/reasoning_effort_low.json new file mode 100644 index 0000000000..d18cb40992 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/reasoning_effort_low.json @@ -0,0 +1,19 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 2048, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "thinking": { + "budget_tokens": 1024, + "type": "enabled" + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/response_format_json_object.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/response_format_json_object.json new file mode 100644 index 0000000000..a5b5e2671f --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/response_format_json_object.json @@ -0,0 +1,15 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "Reply in JSON: capital of France?", + "type": "text" + } + ], + "role": "user" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/response_format_json_schema.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/response_format_json_schema.json new file mode 100644 index 0000000000..b57b03f864 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/response_format_json_schema.json @@ -0,0 +1,36 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "tool_choice": { + "name": "json_tool_call", + "type": "tool" + }, + "tools": [ + { + "input_schema": { + "additionalProperties": false, + "properties": { + "capital": { + "type": "string" + } + }, + "required": [ + "capital" + ], + "type": "object" + }, + "name": "json_tool_call" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/system_prompt.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/system_prompt.json new file mode 100644 index 0000000000..7aae3257a9 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/system_prompt.json @@ -0,0 +1,21 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "system": [ + { + "text": "You are a terse geographer.", + "type": "text" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/thinking_enabled.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/thinking_enabled.json new file mode 100644 index 0000000000..d18cb40992 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/thinking_enabled.json @@ -0,0 +1,19 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 2048, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "thinking": { + "budget_tokens": 1024, + "type": "enabled" + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/thinking_history_blocks.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/thinking_history_blocks.json new file mode 100644 index 0000000000..09e0a5f294 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/thinking_history_blocks.json @@ -0,0 +1,42 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 2048, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + }, + { + "content": [ + { + "signature": "sig-char-deadbeef", + "thinking": "The user asks about France; the capital is Paris.", + "type": "thinking" + }, + { + "text": "Paris.", + "type": "text" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "text": "And of Italy?", + "type": "text" + } + ], + "role": "user" + } + ], + "thinking": { + "budget_tokens": 1024, + "type": "enabled" + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_basic.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_basic.json new file mode 100644 index 0000000000..d1dec80611 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_basic.json @@ -0,0 +1,36 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "tool_choice": { + "type": "auto" + }, + "tools": [ + { + "description": "Get current weather for a city.", + "input_schema": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "name": "get_weather", + "type": "custom" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_forced_choice.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_forced_choice.json new file mode 100644 index 0000000000..7b0e7d5033 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_forced_choice.json @@ -0,0 +1,37 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "tool_choice": { + "name": "get_weather", + "type": "tool" + }, + "tools": [ + { + "description": "Get current weather for a city.", + "input_schema": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "name": "get_weather", + "type": "custom" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_parallel.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_parallel.json new file mode 100644 index 0000000000..b9e5646c5a --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_parallel.json @@ -0,0 +1,53 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "What is the capital of France?", + "type": "text" + } + ], + "role": "user" + } + ], + "tool_choice": { + "disable_parallel_tool_use": false, + "type": "auto" + }, + "tools": [ + { + "description": "Get current weather for a city.", + "input_schema": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "name": "get_weather", + "type": "custom" + }, + { + "description": "Get current time for a timezone.", + "input_schema": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + }, + "name": "get_time", + "type": "custom" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_streamed_args_roundtrip.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_streamed_args_roundtrip.json new file mode 100644 index 0000000000..0d02aa0300 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_anthropic/tools_streamed_args_roundtrip.json @@ -0,0 +1,85 @@ +{ + "anthropic_version": "vertex-2023-10-16", + "max_tokens": 256, + "messages": [ + { + "content": [ + { + "text": "Weather and time in Paris?", + "type": "text" + } + ], + "role": "user" + }, + { + "content": [ + { + "id": "call_char_001", + "input": { + "city": "Paris" + }, + "name": "get_weather", + "type": "tool_use" + }, + { + "id": "call_char_002", + "input": { + "tz": "Europe/Paris" + }, + "name": "get_time", + "type": "tool_use" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "content": "18C, clear", + "tool_use_id": "call_char_001", + "type": "tool_result" + }, + { + "content": "14:05", + "tool_use_id": "call_char_002", + "type": "tool_result" + } + ], + "role": "user" + } + ], + "tools": [ + { + "description": "Get current weather for a city.", + "input_schema": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "name": "get_weather", + "type": "custom" + }, + { + "description": "Get current time for a timezone.", + "input_schema": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + }, + "name": "get_time", + "type": "custom" + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/cache_control_messages.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/cache_control_messages.json new file mode 100644 index 0000000000..2aee10031c --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/cache_control_messages.json @@ -0,0 +1,22 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "system_instruction": { + "parts": [ + { + "text": "You are a terse geographer." + } + ] + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/cache_control_tools.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/cache_control_tools.json new file mode 100644 index 0000000000..6d33af9f80 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/cache_control_tools.json @@ -0,0 +1,51 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/full_combo.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/full_combo.json new file mode 100644 index 0000000000..4bb5fa9fb9 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/full_combo.json @@ -0,0 +1,82 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Weather in Paris?" + } + ], + "role": "user" + }, + { + "parts": [ + { + "function_call": { + "args": { + "city": "Paris" + }, + "name": "get_weather" + } + } + ], + "role": "model" + }, + { + "parts": [ + { + "function_response": { + "name": "get_weather", + "response": { + "content": "18C, clear" + } + } + } + ], + "role": "user" + }, + { + "parts": [ + { + "text": "Summarize, then check the weather again." + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 2048, + "temperature": 1, + "thinkingConfig": { + "includeThoughts": true, + "thinkingBudget": 1024 + } + }, + "system_instruction": { + "parts": [ + { + "text": "You are a terse geographer." + } + ] + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/image_base64.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/image_base64.json new file mode 100644 index 0000000000..82ab913531 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/image_base64.json @@ -0,0 +1,21 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Describe this image." + }, + { + "inline_data": { + "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==", + "mime_type": "image/png" + } + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/image_url.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/image_url.json new file mode 100644 index 0000000000..d6087b556d --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/image_url.json @@ -0,0 +1,21 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Describe this image." + }, + { + "file_data": { + "file_uri": "https://example.com/cat.png", + "mime_type": "image/png" + } + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/max_completion_tokens.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/max_completion_tokens.json new file mode 100644 index 0000000000..f3bfd3ba2f --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/max_completion_tokens.json @@ -0,0 +1,15 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 512 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/multi_turn.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/multi_turn.json new file mode 100644 index 0000000000..3bdbe68419 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/multi_turn.json @@ -0,0 +1,31 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + }, + { + "parts": [ + { + "text": "Paris." + } + ], + "role": "model" + }, + { + "parts": [ + { + "text": "And of Italy?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/params_sampling.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/params_sampling.json new file mode 100644 index 0000000000..1362e2e466 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/params_sampling.json @@ -0,0 +1,21 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 128, + "stop_sequences": [ + "\n\n", + "END" + ], + "temperature": 0.2, + "top_p": 0.9 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/pdf_base64.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/pdf_base64.json new file mode 100644 index 0000000000..b6c6b75d6b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/pdf_base64.json @@ -0,0 +1,21 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Summarize this document." + }, + { + "inline_data": { + "data": "JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbXS9Db3VudCAwPj5lbmRvYmoKdHJhaWxlcjw8L1Jvb3QgMSAwIFI+PgolJUVPRgo=", + "mime_type": "application/pdf" + } + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/plain_text.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/plain_text.json new file mode 100644 index 0000000000..7060b660e2 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/plain_text.json @@ -0,0 +1,15 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/reasoning_effort_low.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/reasoning_effort_low.json new file mode 100644 index 0000000000..7e1434cac8 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/reasoning_effort_low.json @@ -0,0 +1,19 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 2048, + "thinkingConfig": { + "includeThoughts": true, + "thinkingBudget": 1024 + } + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/response_format_json_object.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/response_format_json_object.json new file mode 100644 index 0000000000..847d6c5601 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/response_format_json_object.json @@ -0,0 +1,16 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Reply in JSON: capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256, + "response_mime_type": "application/json" + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/response_format_json_schema.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/response_format_json_schema.json new file mode 100644 index 0000000000..ce579acff6 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/response_format_json_schema.json @@ -0,0 +1,28 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256, + "response_json_schema": { + "additionalProperties": false, + "properties": { + "capital": { + "type": "string" + } + }, + "required": [ + "capital" + ], + "type": "object" + }, + "response_mime_type": "application/json" + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/system_prompt.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/system_prompt.json new file mode 100644 index 0000000000..2aee10031c --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/system_prompt.json @@ -0,0 +1,22 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "system_instruction": { + "parts": [ + { + "text": "You are a terse geographer." + } + ] + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/thinking_enabled.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/thinking_enabled.json new file mode 100644 index 0000000000..7e1434cac8 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/thinking_enabled.json @@ -0,0 +1,19 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 2048, + "thinkingConfig": { + "includeThoughts": true, + "thinkingBudget": 1024 + } + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/thinking_history_blocks.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/thinking_history_blocks.json new file mode 100644 index 0000000000..df4cb34c5b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/thinking_history_blocks.json @@ -0,0 +1,39 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + }, + { + "parts": [ + { + "text": "The user asks about France; the capital is Paris.", + "thoughtSignature": "sig-char-deadbeef" + }, + { + "text": "Paris." + } + ], + "role": "model" + }, + { + "parts": [ + { + "text": "And of Italy?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 2048, + "thinkingConfig": { + "includeThoughts": true, + "thinkingBudget": 1024 + } + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_basic.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_basic.json new file mode 100644 index 0000000000..dec3268206 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_basic.json @@ -0,0 +1,41 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "toolConfig": { + "functionCallingConfig": { + "mode": "AUTO" + } + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_forced_choice.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_forced_choice.json new file mode 100644 index 0000000000..e0084c7a89 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_forced_choice.json @@ -0,0 +1,44 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "toolConfig": { + "functionCallingConfig": { + "allowed_function_names": [ + "get_weather" + ], + "mode": "ANY" + } + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_parallel.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_parallel.json new file mode 100644 index 0000000000..6d33af9f80 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_parallel.json @@ -0,0 +1,51 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "What is the capital of France?" + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_streamed_args_roundtrip.json b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_streamed_args_roundtrip.json new file mode 100644 index 0000000000..1b04dc5acb --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/requests/vertex_gemini/tools_streamed_args_roundtrip.json @@ -0,0 +1,93 @@ +{ + "contents": [ + { + "parts": [ + { + "text": "Weather and time in Paris?" + } + ], + "role": "user" + }, + { + "parts": [ + { + "function_call": { + "args": { + "city": "Paris" + }, + "name": "get_weather" + } + }, + { + "function_call": { + "args": { + "tz": "Europe/Paris" + }, + "name": "get_time" + } + } + ], + "role": "model" + }, + { + "parts": [ + { + "function_response": { + "name": "get_weather", + "response": { + "content": "18C, clear" + } + } + }, + { + "function_response": { + "name": "get_time", + "response": { + "content": "14:05" + } + } + } + ], + "role": "user" + } + ], + "generationConfig": { + "max_output_tokens": 256 + }, + "tools": [ + { + "function_declarations": [ + { + "description": "Get current weather for a city.", + "name": "get_weather", + "parameters": { + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + } + }, + { + "description": "Get current time for a timezone.", + "name": "get_time", + "parameters": { + "properties": { + "tz": { + "type": "string" + } + }, + "required": [ + "tz" + ], + "type": "object" + } + } + ] + } + ] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/text_basic.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/text_basic.json new file mode 100644 index 0000000000..92f3638e68 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/text_basic.json @@ -0,0 +1,41 @@ +{ + "choices": [ + { + "finish_reason": "stop", + "index": 0, + "message": { + "content": "The capital of France is Paris.", + "function_call": null, + "images": [], + "role": "assistant", + "thinking_blocks": [], + "tool_calls": null + } + } + ], + "created": 1718064000, + "id": "char-gemini-text-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_read_input_tokens": null, + "completion_tokens": 8, + "completion_tokens_details": { + "text_tokens": 8 + }, + "prompt_tokens": 8, + "prompt_tokens_details": { + "audio_tokens": null, + "cached_tokens": null, + "image_tokens": null, + "text_tokens": 8, + "video_tokens": null + }, + "total_tokens": 16 + }, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/thinking.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/thinking.json new file mode 100644 index 0000000000..7b8c2bc0db --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/thinking.json @@ -0,0 +1,54 @@ +{ + "choices": [ + { + "finish_reason": "stop", + "index": 0, + "message": { + "content": "The capital of France is Paris.", + "function_call": null, + "images": [], + "provider_specific_fields": { + "thought_signatures": [ + "c2lnLWNoYXItdmVydGV4LWdlbWluaQ==" + ] + }, + "reasoning_content": "The user asks about France. The capital is Paris.", + "role": "assistant", + "thinking_blocks": [ + { + "signature": "c2lnLWNoYXItdmVydGV4LWdlbWluaQ==", + "thinking": "The user asks about France. The capital is Paris.", + "type": "thinking" + } + ], + "tool_calls": null + } + } + ], + "created": 1718064000, + "id": "char-gemini-think-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_read_input_tokens": 1024, + "completion_tokens": 160, + "completion_tokens_details": { + "reasoning_tokens": 152, + "text_tokens": 8 + }, + "prompt_tokens": 1290, + "prompt_tokens_details": { + "audio_tokens": null, + "cached_tokens": 1024, + "image_tokens": null, + "text_tokens": 266, + "video_tokens": null + }, + "total_tokens": 1450 + }, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/tool_use.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/tool_use.json new file mode 100644 index 0000000000..0e01043a98 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/gemini/tool_use.json @@ -0,0 +1,60 @@ +{ + "choices": [ + { + "finish_reason": "tool_calls", + "index": 0, + "message": { + "content": null, + "function_call": null, + "images": [], + "role": "assistant", + "thinking_blocks": [], + "tool_calls": [ + { + "function": { + "arguments": "{\"city\": \"Paris\"}", + "name": "get_weather" + }, + "id": "call_0000000000000000000000000000", + "index": 0, + "type": "function" + }, + { + "function": { + "arguments": "{\"tz\": \"Europe/Paris\"}", + "name": "get_time" + }, + "id": "call_0000000000000000000000000000", + "index": 1, + "type": "function" + } + ] + } + } + ], + "created": 1718064000, + "id": "char-gemini-tool-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_read_input_tokens": null, + "completion_tokens": 22, + "completion_tokens_details": { + "text_tokens": 22 + }, + "prompt_tokens": 74, + "prompt_tokens_details": { + "audio_tokens": null, + "cached_tokens": null, + "image_tokens": null, + "text_tokens": 74, + "video_tokens": null + }, + "total_tokens": 96 + }, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/text_basic.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/text_basic.json new file mode 100644 index 0000000000..65d2912516 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/text_basic.json @@ -0,0 +1,44 @@ +{ + "choices": [ + { + "finish_reason": "stop", + "index": 0, + "message": { + "content": "The capital of France is Paris.", + "function_call": null, + "provider_specific_fields": { + "citations": null, + "thinking_blocks": null + }, + "role": "assistant", + "tool_calls": null + } + } + ], + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "completion_tokens": 9, + "completion_tokens_details": { + "reasoning_tokens": 0, + "text_tokens": 9 + }, + "inference_geo": null, + "prompt_tokens": 14, + "prompt_tokens_details": { + "audio_tokens": null, + "cache_creation_tokens": 0, + "cached_tokens": 0, + "image_tokens": null, + "text_tokens": 14, + "video_tokens": null + }, + "speed": null, + "total_tokens": 23 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/thinking.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/thinking.json new file mode 100644 index 0000000000..f5fa7fe7fc --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/thinking.json @@ -0,0 +1,58 @@ +{ + "choices": [ + { + "finish_reason": "stop", + "index": 0, + "message": { + "content": "The capital of France is Paris.", + "function_call": null, + "provider_specific_fields": { + "citations": null, + "thinking_blocks": [ + { + "signature": "sig-char-vertex-anthropic-001", + "thinking": "The user asks about France. The capital is Paris.", + "type": "thinking" + } + ] + }, + "reasoning_content": "The user asks about France. The capital is Paris.", + "role": "assistant", + "thinking_blocks": [ + { + "signature": "sig-char-vertex-anthropic-001", + "thinking": "The user asks about France. The capital is Paris.", + "type": "thinking" + } + ], + "tool_calls": null + } + } + ], + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "completion_tokens": 71, + "completion_tokens_details": { + "reasoning_tokens": 11, + "text_tokens": 60 + }, + "inference_geo": null, + "prompt_tokens": 42, + "prompt_tokens_details": { + "audio_tokens": null, + "cache_creation_tokens": 0, + "cached_tokens": 0, + "image_tokens": null, + "text_tokens": 42, + "video_tokens": null + }, + "speed": null, + "total_tokens": 113 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/tool_use.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/tool_use.json new file mode 100644 index 0000000000..f03c6fb16a --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_anthropic/tool_use.json @@ -0,0 +1,54 @@ +{ + "choices": [ + { + "finish_reason": "tool_calls", + "index": 0, + "message": { + "content": "I'll check the weather in Paris.", + "function_call": null, + "provider_specific_fields": { + "citations": null, + "thinking_blocks": null + }, + "role": "assistant", + "tool_calls": [ + { + "function": { + "arguments": "{\"city\": \"Paris\"}", + "name": "get_weather" + }, + "id": "toolu_vrtx_01CharWeather01", + "index": 1, + "type": "function" + } + ] + } + } + ], + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "completion_tokens": 67, + "completion_tokens_details": { + "reasoning_tokens": 0, + "text_tokens": 67 + }, + "inference_geo": null, + "prompt_tokens": 410, + "prompt_tokens_details": { + "audio_tokens": null, + "cache_creation_tokens": 0, + "cached_tokens": 0, + "image_tokens": null, + "text_tokens": 410, + "video_tokens": null + }, + "speed": null, + "total_tokens": 477 + } +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/text_basic.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/text_basic.json new file mode 100644 index 0000000000..8cdc181c98 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/text_basic.json @@ -0,0 +1,41 @@ +{ + "choices": [ + { + "finish_reason": "stop", + "index": 0, + "message": { + "content": "The capital of France is Paris.", + "function_call": null, + "images": [], + "role": "assistant", + "thinking_blocks": [], + "tool_calls": null + } + } + ], + "created": 1718064000, + "id": "char-vertex-gemini-text-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_read_input_tokens": null, + "completion_tokens": 8, + "completion_tokens_details": { + "text_tokens": 8 + }, + "prompt_tokens": 8, + "prompt_tokens_details": { + "audio_tokens": null, + "cached_tokens": null, + "image_tokens": null, + "text_tokens": 8, + "video_tokens": null + }, + "total_tokens": 16 + }, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/thinking.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/thinking.json new file mode 100644 index 0000000000..ede2c32bf0 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/thinking.json @@ -0,0 +1,54 @@ +{ + "choices": [ + { + "finish_reason": "stop", + "index": 0, + "message": { + "content": "The capital of France is Paris.", + "function_call": null, + "images": [], + "provider_specific_fields": { + "thought_signatures": [ + "c2lnLWNoYXItdmVydGV4LWdlbWluaQ==" + ] + }, + "reasoning_content": "The user asks about France. The capital is Paris.", + "role": "assistant", + "thinking_blocks": [ + { + "signature": "c2lnLWNoYXItdmVydGV4LWdlbWluaQ==", + "thinking": "The user asks about France. The capital is Paris.", + "type": "thinking" + } + ], + "tool_calls": null + } + } + ], + "created": 1718064000, + "id": "char-vertex-gemini-think-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_read_input_tokens": 1024, + "completion_tokens": 160, + "completion_tokens_details": { + "reasoning_tokens": 152, + "text_tokens": 8 + }, + "prompt_tokens": 1290, + "prompt_tokens_details": { + "audio_tokens": null, + "cached_tokens": 1024, + "image_tokens": null, + "text_tokens": 266, + "video_tokens": null + }, + "total_tokens": 1450 + }, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/tool_use.json b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/tool_use.json new file mode 100644 index 0000000000..20231ae73d --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/responses/vertex_gemini/tool_use.json @@ -0,0 +1,60 @@ +{ + "choices": [ + { + "finish_reason": "tool_calls", + "index": 0, + "message": { + "content": null, + "function_call": null, + "images": [], + "role": "assistant", + "thinking_blocks": [], + "tool_calls": [ + { + "function": { + "arguments": "{\"city\": \"Paris\"}", + "name": "get_weather" + }, + "id": "call_0000000000000000000000000000", + "index": 0, + "type": "function" + }, + { + "function": { + "arguments": "{\"tz\": \"Europe/Paris\"}", + "name": "get_time" + }, + "id": "call_0000000000000000000000000000", + "index": 1, + "type": "function" + } + ] + } + } + ], + "created": 1718064000, + "id": "char-vertex-gemini-tool-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion", + "system_fingerprint": null, + "usage": { + "cache_read_input_tokens": null, + "completion_tokens": 22, + "completion_tokens_details": { + "text_tokens": 22 + }, + "prompt_tokens": 74, + "prompt_tokens_details": { + "audio_tokens": null, + "cached_tokens": null, + "image_tokens": null, + "text_tokens": 74, + "video_tokens": null + }, + "total_tokens": 96 + }, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] +} diff --git a/tests/test_litellm/translation/characterization_google/snapshots/streams/gemini/text_stream.json b/tests/test_litellm/translation/characterization_google/snapshots/streams/gemini/text_stream.json new file mode 100644 index 0000000000..b39c5b1207 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/streams/gemini/text_stream.json @@ -0,0 +1,81 @@ +[ + { + "choices": [ + { + "delta": { + "audio": null, + "content": "Paris is the", + "function_call": null, + "provider_specific_fields": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-gemini-stream-text-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": " capital of France.", + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-gemini-stream-text-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 1718064000, + "id": "char-gemini-stream-text-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion.chunk", + "provider_specific_fields": null + } +] diff --git a/tests/test_litellm/translation/characterization_google/snapshots/streams/gemini/tool_stream.json b/tests/test_litellm/translation/characterization_google/snapshots/streams/gemini/tool_stream.json new file mode 100644 index 0000000000..f8ac93089b --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/streams/gemini/tool_stream.json @@ -0,0 +1,101 @@ +[ + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "provider_specific_fields": null, + "role": "assistant", + "tool_calls": [ + { + "function": { + "arguments": "{\"city\": \"Paris\"}", + "name": "get_weather" + }, + "id": "call_0000000000000000000000000000", + "index": 0, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-gemini-stream-tool-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": [ + { + "function": { + "arguments": "{\"tz\": \"Europe/Paris\"}", + "name": "get_time" + }, + "id": "call_0000000000000000000000000000", + "index": 1, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-gemini-stream-tool-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "tool_calls", + "index": 0, + "logprobs": null + } + ], + "created": 1718064000, + "id": "char-gemini-stream-tool-0001", + "model": "gemini-2.5-flash", + "object": "chat.completion.chunk", + "provider_specific_fields": null + } +] diff --git a/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_anthropic/text_stream.json b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_anthropic/text_stream.json new file mode 100644 index 0000000000..ce622e150a --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_anthropic/text_stream.json @@ -0,0 +1,72 @@ +[ + { + "choices": [ + { + "delta": { + "audio": null, + "content": "Paris is the", + "function_call": null, + "provider_specific_fields": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": " capital of France.", + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null + } +] diff --git a/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_anthropic/tool_stream.json b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_anthropic/tool_stream.json new file mode 100644 index 0000000000..59648585ee --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_anthropic/tool_stream.json @@ -0,0 +1,150 @@ +[ + { + "choices": [ + { + "delta": { + "audio": null, + "content": "I'll check the weather in Paris.", + "function_call": null, + "provider_specific_fields": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": "", + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": [ + { + "function": { + "arguments": "", + "name": "get_weather" + }, + "id": "toolu_vrtx_01CharWeather01", + "index": 0, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": "", + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": [ + { + "function": { + "arguments": "{\"city\"", + "name": null + }, + "id": null, + "index": 0, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": "", + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": [ + { + "function": { + "arguments": ": \"Paris\"}", + "name": null + }, + "id": null, + "index": 0, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "tool_calls", + "index": 0, + "logprobs": null + } + ], + "created": 1718064000, + "id": "chatcmpl-00000000-0000-0000-0000-000000000001", + "model": "claude-sonnet-4@20250514", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null + } +] diff --git a/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/text_stream.json b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/text_stream.json new file mode 100644 index 0000000000..98e4042361 --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/text_stream.json @@ -0,0 +1,81 @@ +[ + { + "choices": [ + { + "delta": { + "audio": null, + "content": "Paris is the", + "function_call": null, + "provider_specific_fields": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-vertex-gemini-stream-text-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": " capital of France.", + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-vertex-gemini-stream-text-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 1718064000, + "id": "char-vertex-gemini-stream-text-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null + } +] diff --git a/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/thinking_stream.json b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/thinking_stream.json new file mode 100644 index 0000000000..82d642e13a --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/thinking_stream.json @@ -0,0 +1,116 @@ +[ + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "provider_specific_fields": null, + "reasoning_content": "The user asks about France.", + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-vertex-gemini-stream-think-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "provider_specific_fields": { + "thought_signatures": [ + "c2lnLWNoYXItdmVydGV4LWdlbWluaQ==" + ] + }, + "reasoning_content": " The capital is Paris.", + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-vertex-gemini-stream-think-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": "The capital of France is Paris.", + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-vertex-gemini-stream-think-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 1718064000, + "id": "char-vertex-gemini-stream-think-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null + } +] diff --git a/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/tool_stream.json b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/tool_stream.json new file mode 100644 index 0000000000..703c9f422f --- /dev/null +++ b/tests/test_litellm/translation/characterization_google/snapshots/streams/vertex_gemini/tool_stream.json @@ -0,0 +1,101 @@ +[ + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "provider_specific_fields": null, + "role": "assistant", + "tool_calls": [ + { + "function": { + "arguments": "{\"city\": \"Paris\"}", + "name": "get_weather" + }, + "id": "call_0000000000000000000000000000", + "index": 0, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-vertex-gemini-stream-tool-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "provider_specific_fields": null, + "role": null, + "tool_calls": [ + { + "function": { + "arguments": "{\"tz\": \"Europe/Paris\"}", + "name": "get_time" + }, + "id": "call_0000000000000000000000000000", + "index": 1, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "citations": null, + "created": 1718064000, + "id": "char-vertex-gemini-stream-tool-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null, + "system_fingerprint": null, + "vertex_ai_citation_metadata": [], + "vertex_ai_grounding_metadata": [], + "vertex_ai_safety_ratings": [], + "vertex_ai_safety_results": [], + "vertex_ai_url_context_metadata": [] + }, + { + "choices": [ + { + "delta": { + "audio": null, + "content": null, + "function_call": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "tool_calls", + "index": 0, + "logprobs": null + } + ], + "created": 1718064000, + "id": "char-vertex-gemini-stream-tool-0001", + "model": "gemini-2.5-pro", + "object": "chat.completion.chunk", + "provider_specific_fields": null + } +]