mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-04 01:48:57 +00:00
1135 lines
58 KiB
Python
1135 lines
58 KiB
Python
from typing import Final
|
|
|
|
from integration.translation.case import TranslationTestCase
|
|
from integration.translation.messages.templates import MESSAGES_BRIDGE_RESPONSE, MESSAGES_REQUEST
|
|
from integration.translation.templates.vertex_ai import (
|
|
VERTEX_AI_ANTHROPIC_MESSAGES_REQUEST,
|
|
VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
VERTEX_AI_GEMINI_GENERATE_CONTENT_REQUEST,
|
|
VERTEX_AI_GEMINI_GENERATE_CONTENT_RESPONSE,
|
|
)
|
|
|
|
GEMINI_3_5_FLASH_THOUGHT_SIGNATURE: Final = "AY89a1+kriNs9YsPegJQxgjTWsMlxsqPU/UkHDyz4EK+3FRrE52ygqPIHTvkblgKKiO5Fn8R9D3iu//i+YnuuZ+e7W0yxUoFScas89b5rn3vZHsihnUA7VTe3b7beth1IftteoTGZ3F8OSLrSIP8HKn4xTIx35eeNEt5oiD3K5rTQrdklqO277HvTDhu/LuZhZ0pzaWciGQEc61epIBBpC2ygu8V4L8TekUVZnz6qzSzxipdiQStQ8dZou43334hMnxOR6JjJCGxqt/1K+C0vXX6YP6f+Bph5VhPSnvy2Z1uApi3TUxAcsDDyVewIr+ha2G6DPhN1Oi5uZZNhmbvH01Uq5OOquF1uEICq2m/35LhJIbDNM9N7oI1Z6L94P9xdugeFXM2S7wdJfc8sdg09vEzNeA++GK25zRuB4hU7XyaG4XnWjmu2kswi4sf+EyrO/K0P2tb/ZCJu7kJTtWTiD1wgSIl1eqS8ORKKsXDN2hIbFrtsNR50WIvVzd6"
|
|
CLAUDE_HAIKU_5_5_MESSAGES_THINKING_SIGNATURE: Final = "CAQS4wYKEggSEAIYAjgBQgh0aGlua2luZxIMgzBnOw4aYVVqPKRPGgyphQhlJ0pt7tgasWIiMOWM4ATud/TWad7qo/Eh9ZSXhK3IcgnwdgqVeXog9D1q/y69qnyrHdN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= TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "vertex_ai/claude-haiku-4-5@20251001",
|
|
"max_tokens": 64,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/anthropic/models/claude-haiku-4-5@20251001:rawPredict",
|
|
expected_provider_headers={"authorization": "Bearer scripted-token", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"max_tokens": 64,
|
|
"stream": False,
|
|
"system": [{"type": "text", "text": "You are a terse assistant."}],
|
|
"anthropic_version": "vertex-2023-10-16",
|
|
},
|
|
mock_provider_response={
|
|
"model": "claude-haiku-4-5-20251001",
|
|
"id": "msg_vrtx_011CfjuyLkoJCtCANzSshqj7",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"content": [{"type": "text", "text": "Hello."}],
|
|
"container": None,
|
|
"stop_reason": "end_turn",
|
|
"stop_sequence": None,
|
|
"stop_details": None,
|
|
"usage": {
|
|
"input_tokens": 17,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 5,
|
|
},
|
|
},
|
|
expected_litellm_status_code=200,
|
|
expected_litellm_response={
|
|
"model": "vertex_ai/claude-haiku-4-5@20251001",
|
|
"id": "msg_vrtx_011CfjuyLkoJCtCANzSshqj7",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"content": [{"type": "text", "text": "Hello."}],
|
|
"container": None,
|
|
"stop_reason": "end_turn",
|
|
"stop_sequence": None,
|
|
"stop_details": None,
|
|
"usage": {
|
|
"input_tokens": 17,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 5,
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_SONNET_4_6_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "vertex_ai/claude-sonnet-4-6@default",
|
|
"max_tokens": 64,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/anthropic/models/claude-sonnet-4-6@default:rawPredict",
|
|
expected_provider_headers={"authorization": "Bearer scripted-token", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"max_tokens": 64,
|
|
"stream": False,
|
|
"system": [{"type": "text", "text": "You are a terse assistant."}],
|
|
"anthropic_version": "vertex-2023-10-16",
|
|
},
|
|
mock_provider_response={
|
|
"model": "claude-sonnet-4-6",
|
|
"id": "msg_vrtx_011CfjuxNMG2o9mmi6TvgC48",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"content": [{"type": "text", "text": "Hello!"}],
|
|
"container": None,
|
|
"stop_reason": "end_turn",
|
|
"stop_sequence": None,
|
|
"stop_details": None,
|
|
"usage": {
|
|
"input_tokens": 18,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 5,
|
|
},
|
|
},
|
|
expected_litellm_status_code=200,
|
|
expected_litellm_response={
|
|
"model": "vertex_ai/claude-sonnet-4-6@default",
|
|
"id": "msg_vrtx_011CfjuxNMG2o9mmi6TvgC48",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"content": [{"type": "text", "text": "Hello!"}],
|
|
"container": None,
|
|
"stop_reason": "end_turn",
|
|
"stop_sequence": None,
|
|
"stop_details": None,
|
|
"usage": {
|
|
"input_tokens": 18,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 5,
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_SONNET_5_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "vertex_ai/claude-sonnet-5@default",
|
|
"max_tokens": 64,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/anthropic/models/claude-sonnet-5@default:rawPredict",
|
|
expected_provider_headers={"authorization": "Bearer scripted-token", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"max_tokens": 64,
|
|
"stream": False,
|
|
"system": [{"type": "text", "text": "You are a terse assistant."}],
|
|
"anthropic_version": "vertex-2023-10-16",
|
|
},
|
|
mock_provider_response={
|
|
"model": "claude-sonnet-5",
|
|
"id": "msg_vrtx_011CfjuyZQJsY8CfdZxY6C9E",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"content": [{"type": "text", "text": "Hello."}],
|
|
"container": None,
|
|
"stop_reason": "end_turn",
|
|
"stop_sequence": None,
|
|
"stop_details": None,
|
|
"usage": {
|
|
"input_tokens": 21,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"thinking_tokens": 0},
|
|
},
|
|
},
|
|
expected_litellm_status_code=200,
|
|
expected_litellm_response={
|
|
"model": "vertex_ai/claude-sonnet-5@default",
|
|
"id": "msg_vrtx_011CfjuyZQJsY8CfdZxY6C9E",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"content": [{"type": "text", "text": "Hello."}],
|
|
"container": None,
|
|
"stop_reason": "end_turn",
|
|
"stop_sequence": None,
|
|
"stop_details": None,
|
|
"usage": {
|
|
"input_tokens": 21,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"thinking_tokens": 0},
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_OPUS_4_8_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "vertex_ai/claude-opus-4-8@default",
|
|
"max_tokens": 64,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/anthropic/models/claude-opus-4-8@default:rawPredict",
|
|
expected_provider_headers={"authorization": "Bearer scripted-token", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"max_tokens": 64,
|
|
"stream": False,
|
|
"system": [{"type": "text", "text": "You are a terse assistant."}],
|
|
"anthropic_version": "vertex-2023-10-16",
|
|
},
|
|
mock_provider_response={
|
|
"model": "claude-opus-4-8",
|
|
"id": "msg_vrtx_011Cfjuyk5joSiAW8h6nktJh",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"content": [{"type": "text", "text": "Hello."}],
|
|
"container": None,
|
|
"stop_reason": "end_turn",
|
|
"stop_sequence": None,
|
|
"stop_details": None,
|
|
"usage": {
|
|
"input_tokens": 21,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"thinking_tokens": 0},
|
|
},
|
|
},
|
|
expected_litellm_status_code=200,
|
|
expected_litellm_response={
|
|
"model": "vertex_ai/claude-opus-4-8@default",
|
|
"id": "msg_vrtx_011Cfjuyk5joSiAW8h6nktJh",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"content": [{"type": "text", "text": "Hello."}],
|
|
"container": None,
|
|
"stop_reason": "end_turn",
|
|
"stop_sequence": None,
|
|
"stop_details": None,
|
|
"usage": {
|
|
"input_tokens": 21,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"thinking_tokens": 0},
|
|
},
|
|
},
|
|
)
|
|
|
|
GEMINI_3_5_FLASH_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "vertex_ai/gemini-3.5-flash",
|
|
"max_tokens": 1024,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/google/models/gemini-3.5-flash:generateContent",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer scripted-token"},
|
|
expected_provider_request={
|
|
"contents": [{"role": "user", "parts": [{"text": "Say hello."}]}],
|
|
"system_instruction": {"parts": [{"text": "You are a terse assistant."}]},
|
|
"generationConfig": {"max_output_tokens": 1024},
|
|
},
|
|
mock_provider_response={
|
|
"candidates": [
|
|
{
|
|
"content": {
|
|
"role": "model",
|
|
"parts": [{"text": "Hello.", "thoughtSignature": GEMINI_3_5_FLASH_THOUGHT_SIGNATURE}],
|
|
},
|
|
"finishReason": "STOP",
|
|
}
|
|
],
|
|
"usageMetadata": {
|
|
"promptTokenCount": 9,
|
|
"candidatesTokenCount": 2,
|
|
"totalTokenCount": 95,
|
|
"trafficType": "ON_DEMAND",
|
|
"promptTokensDetails": [{"modality": "TEXT", "tokenCount": 9}],
|
|
"candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 2}],
|
|
"thoughtsTokenCount": 84,
|
|
},
|
|
"modelVersion": "gemini-3.5-flash",
|
|
"createTime": "2026-10-05T22:54:50.809002Z",
|
|
"responseId": "uirEaqqwMc-U9LsPjJTYuQU",
|
|
},
|
|
expected_litellm_status_code=200,
|
|
expected_litellm_response={
|
|
"id": "uirEaqqwMc-U9LsPjJTYuQU",
|
|
"type": "message",
|
|
"role": "assistant",
|
|
"model": "vertex_ai/gemini-3.5-flash",
|
|
"stop_sequence": None,
|
|
"usage": {"input_tokens": 9, "output_tokens": 86},
|
|
"content": [{"type": "text", "text": "Hello."}],
|
|
"stop_reason": "end_turn",
|
|
"stop_details": None,
|
|
},
|
|
)
|
|
|
|
CLAUDE_SONNET_5_5_MESSAGES_THINKING_SIGNATURE_0: Final = (
|
|
"CAQSiQYKEggSEAIYAjgBQgh0aGlua2luZxIMgrCyOX5aamkI52eqGgy+6kkncswGkygvTJMiMP0m0811aMrw7nEXG8RULCLVjlRy"
|
|
"YnR1NVQMPi4D8+0wd7GpOQ3kYb6rRHr4eZQrXiqkBeZyXjb/2wJIq+K8HxoIHFJ1u6xQrkMnZ/tA6M7Kt9Hvftp9EvdEDGYlEN9t"
|
|
"aLY0iXPBS0XwePUByV3ZDxTgNx2wXj1K88BwXtpQYYdDUFFb0pC5/HlxxZE1xHeQpHX/7sfTroWGNNco1JKKMC9FfT/YkHM+CaE+"
|
|
"LnIaPmL2Ft5t/4UhwBcgIbGIrj0INS0QObLNVSy32zLbxiyaDzC/ZVb9FC+mzRsQdkUpKDsiZMc0quyLrmuCl0cxuypCFiwPXrTM"
|
|
"mRSMZiHN6LG/D0w9ySgHalASqB11GuAKP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kv7gXtrqe8cV7MPasGKHWYpaHspVu0k0qXQo4PdINS4lnetIIT+lV9L6sxvk"
|
|
"KVpmjeE3ktitlE3GyjhyznzcB0DCNpGlWf13GXBokyv4OMtr6I+jYtE2TZRsSTBv6wEmNwnB50yWvBPSph86Qz5Yf4S68KQBEbwH"
|
|
"bssQoZ3DgoG2sk+ybNbAEsBLCU+35/8iMk87/dngk7mbM+EaVaboyGBm9KXzh8Kk"
|
|
)
|
|
|
|
|
|
CLAUDE_SONNET_5_5_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "vertex_ai/claude-sonnet-5-5@default"},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/anthropic/models/claude-sonnet-5-5@default:rawPredict",
|
|
expected_provider_headers={"authorization": "Bearer scripted-token", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_REQUEST,
|
|
"messages": MESSAGES_REQUEST["messages"],
|
|
"stream": False,
|
|
"system": [
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"You help maintain a synthetic Python project. Read the relevant files before suggesting a fix. "
|
|
"Explain which file you need next, then call a read-only tool. Never change files. Use the messages "
|
|
"client for this project review. Consider zero, negative and non-integer quantities before choosing "
|
|
"the next file to inspect."
|
|
),
|
|
},
|
|
],
|
|
"tools": MESSAGES_REQUEST["tools"],
|
|
},
|
|
mock_provider_response={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
"model": "claude-sonnet-5-5",
|
|
"id": "msg_vrtx_011Cg38paXLscBt8ARDQWjmd",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"Since the user asked for the validation file first, I'll focus there rather than reading tests in "
|
|
"parallel. I'll pull a range around line 18, say lines 1-60, to get enough context.\n\n"
|
|
),
|
|
"signature": CLAUDE_SONNET_5_5_MESSAGES_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"Next I'll check `shop/validation.py` to see how `validate_quantity` handles zero, negative, and "
|
|
"non-integer values, starting from the top of the file around line 18.\n\n"
|
|
),
|
|
"signature": CLAUDE_SONNET_5_5_MESSAGES_THINKING_SIGNATURE_1,
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_vrtx_01UHVgrFsbouYKZ8mjVaM2wj",
|
|
"name": "read_file",
|
|
"input": {"path": "shop/validation.py", "start_line": 1, "end_line": 60},
|
|
},
|
|
],
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 873,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 873, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 257,
|
|
"output_tokens_details": {"thinking_tokens": 159},
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
"model": "vertex_ai/claude-sonnet-5-5@default",
|
|
"id": "msg_vrtx_011Cg38paXLscBt8ARDQWjmd",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"Since the user asked for the validation file first, I'll focus there rather than reading tests in "
|
|
"parallel. I'll pull a range around line 18, say lines 1-60, to get enough context.\n\n"
|
|
),
|
|
"signature": CLAUDE_SONNET_5_5_MESSAGES_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"Next I'll check `shop/validation.py` to see how `validate_quantity` handles zero, negative, and "
|
|
"non-integer values, starting from the top of the file around line 18.\n\n"
|
|
),
|
|
"signature": CLAUDE_SONNET_5_5_MESSAGES_THINKING_SIGNATURE_1,
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_vrtx_01UHVgrFsbouYKZ8mjVaM2wj",
|
|
"name": "read_file",
|
|
"input": {"path": "shop/validation.py", "start_line": 1, "end_line": 60},
|
|
},
|
|
],
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 873,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 873, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 257,
|
|
"output_tokens_details": {"thinking_tokens": 159},
|
|
},
|
|
},
|
|
)
|
|
|
|
|
|
CLAUDE_HAIKU_5_5_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "vertex_ai/claude-haiku-5-5@default"},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/anthropic/models/claude-haiku-5-5@default:rawPredict",
|
|
expected_provider_headers={"authorization": "Bearer scripted-token", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_REQUEST,
|
|
"messages": MESSAGES_REQUEST["messages"],
|
|
"stream": False,
|
|
"system": [
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"You help maintain a synthetic Python project. Read the relevant files before suggesting a fix. "
|
|
"Explain which file you need next, then call a read-only tool. Never change files. Use the messages "
|
|
"client for this project review. Consider zero, negative and non-integer quantities before choosing "
|
|
"the next file to inspect."
|
|
),
|
|
},
|
|
],
|
|
"tools": MESSAGES_REQUEST["tools"],
|
|
},
|
|
mock_provider_response={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
"model": "claude-haiku-5-5",
|
|
"id": "msg_vrtx_011Cg8BfjWDUi4ZYQxpy6aVM",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"I found validate_quantity defined around line 18, so I'll read the validation.py file from the start "
|
|
"through roughly line 60 to capture the full context, keeping in mind I'll need to check how it handles "
|
|
"zero, negative, and non-integer cases.\n\n"
|
|
),
|
|
"signature": CLAUDE_HAIKU_5_5_MESSAGES_THINKING_SIGNATURE,
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"I'll read `shop/validation.py` first. The search put `validate_quantity` at line 18, so I'll start "
|
|
"there and include the lines around it to see how zero, negative, and non-integer values are handled."
|
|
),
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_vrtx_01YSY1kAV4ayCLVdBJkSv4dt",
|
|
"name": "read_file",
|
|
"input": {"path": "shop/validation.py", "start_line": 1, "end_line": 60},
|
|
},
|
|
],
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 873,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 873, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 292,
|
|
"output_tokens_details": {"thinking_tokens": 129},
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
"model": "vertex_ai/claude-haiku-5-5@default",
|
|
"id": "msg_vrtx_011Cg8BfjWDUi4ZYQxpy6aVM",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"I found validate_quantity defined around line 18, so I'll read the validation.py file from the start "
|
|
"through roughly line 60 to capture the full context, keeping in mind I'll need to check how it handles "
|
|
"zero, negative, and non-integer cases.\n\n"
|
|
),
|
|
"signature": CLAUDE_HAIKU_5_5_MESSAGES_THINKING_SIGNATURE,
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"I'll read `shop/validation.py` first. The search put `validate_quantity` at line 18, so I'll start "
|
|
"there and include the lines around it to see how zero, negative, and non-integer values are handled."
|
|
),
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_vrtx_01YSY1kAV4ayCLVdBJkSv4dt",
|
|
"name": "read_file",
|
|
"input": {"path": "shop/validation.py", "start_line": 1, "end_line": 60},
|
|
},
|
|
],
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 873,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 873, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 292,
|
|
"output_tokens_details": {"thinking_tokens": 129},
|
|
},
|
|
},
|
|
)
|
|
|
|
|
|
CLAUDE_OPUS_5_5_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "vertex_ai/claude-opus-5-5@default"},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/anthropic/models/claude-opus-5-5@default:rawPredict",
|
|
expected_provider_headers={"authorization": "Bearer scripted-token", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_REQUEST,
|
|
"messages": MESSAGES_REQUEST["messages"],
|
|
"stream": False,
|
|
"system": [
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"You help maintain a synthetic Python project. Read the relevant files before suggesting a fix. "
|
|
"Explain which file you need next, then call a read-only tool. Never change files. Use the messages "
|
|
"client for this project review. Consider zero, negative and non-integer quantities before choosing "
|
|
"the next file to inspect."
|
|
),
|
|
},
|
|
],
|
|
"tools": MESSAGES_REQUEST["tools"],
|
|
},
|
|
mock_provider_response={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
"model": "claude-opus-5-5",
|
|
"id": "msg_vrtx_011Cg38pLy1pX8GQEfjq6NFo",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
'Since the user said "first," I\'ll focus on reading the validation file around line 18 before moving '
|
|
"on to the test file.\n\n"
|
|
),
|
|
"signature": CLAUDE_OPUS_5_5_MESSAGES_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"I'll start with `shop/validation.py`. `validate_quantity` is defined at line 18, so I'll read the "
|
|
"lines around it. That should show how zero, negative and non-integer quantities are handled."
|
|
),
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_vrtx_018jLLjmUz5DQCg8xZ76kMFY",
|
|
"name": "read_file",
|
|
"input": {"path": "shop/validation.py", "start_line": 1, "end_line": 50},
|
|
},
|
|
],
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 873,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 873, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 233,
|
|
"output_tokens_details": {"thinking_tokens": 70},
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
"model": "vertex_ai/claude-opus-5-5@default",
|
|
"id": "msg_vrtx_011Cg38pLy1pX8GQEfjq6NFo",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
'Since the user said "first," I\'ll focus on reading the validation file around line 18 before moving '
|
|
"on to the test file.\n\n"
|
|
),
|
|
"signature": CLAUDE_OPUS_5_5_MESSAGES_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"I'll start with `shop/validation.py`. `validate_quantity` is defined at line 18, so I'll read the "
|
|
"lines around it. That should show how zero, negative and non-integer quantities are handled."
|
|
),
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_vrtx_018jLLjmUz5DQCg8xZ76kMFY",
|
|
"name": "read_file",
|
|
"input": {"path": "shop/validation.py", "start_line": 1, "end_line": 50},
|
|
},
|
|
],
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 873,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 873, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 233,
|
|
"output_tokens_details": {"thinking_tokens": 70},
|
|
},
|
|
},
|
|
)
|
|
|
|
|
|
CLAUDE_FABLE_5_1_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "vertex_ai/claude-fable-5-1@default"},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/anthropic/models/claude-fable-5-1@default:rawPredict",
|
|
expected_provider_headers={"authorization": "Bearer scripted-token", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_REQUEST,
|
|
"messages": MESSAGES_REQUEST["messages"],
|
|
"stream": False,
|
|
"system": [
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"You help maintain a synthetic Python project. Read the relevant files before suggesting a fix. "
|
|
"Explain which file you need next, then call a read-only tool. Never change files. Use the messages "
|
|
"client for this project review. Consider zero, negative and non-integer quantities before choosing "
|
|
"the next file to inspect."
|
|
),
|
|
},
|
|
],
|
|
"tools": MESSAGES_REQUEST["tools"],
|
|
},
|
|
mock_provider_response={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
"model": "claude-fable-5-1",
|
|
"id": "msg_vrtx_011Cg38pBu4rsBNuTwSrvoze",
|
|
"content": [
|
|
{
|
|
"type": "text",
|
|
"text": "I'll read the validation function to see how zero, negative, and non-integer quantities are handled.",
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_vrtx_01SNoqWEthDpRET4kp9iGsXB",
|
|
"name": "read_file",
|
|
"input": {"path": "shop/validation.py", "start_line": 1, "end_line": 40},
|
|
},
|
|
],
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 873,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 873, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 129,
|
|
"output_tokens_details": {"thinking_tokens": 0},
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
**VERTEX_AI_ANTHROPIC_MESSAGES_RESPONSE,
|
|
"model": "vertex_ai/claude-fable-5-1@default",
|
|
"id": "msg_vrtx_011Cg38pBu4rsBNuTwSrvoze",
|
|
"content": [
|
|
{
|
|
"type": "text",
|
|
"text": "I'll read the validation function to see how zero, negative, and non-integer quantities are handled.",
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_vrtx_01SNoqWEthDpRET4kp9iGsXB",
|
|
"name": "read_file",
|
|
"input": {"path": "shop/validation.py", "start_line": 1, "end_line": 40},
|
|
},
|
|
],
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 873,
|
|
"cache_read_input_tokens": 0,
|
|
"cache_creation": {"ephemeral_5m_input_tokens": 873, "ephemeral_1h_input_tokens": 0},
|
|
"output_tokens": 129,
|
|
"output_tokens_details": {"thinking_tokens": 0},
|
|
},
|
|
},
|
|
)
|
|
|
|
|
|
GEMINI_3_8_FLASH_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "vertex_ai/gemini-3.8-flash"},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/google/models/gemini-3.8-flash:generateContent",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer scripted-token"},
|
|
expected_provider_request={
|
|
**VERTEX_AI_GEMINI_GENERATE_CONTENT_REQUEST,
|
|
"system_instruction": {
|
|
"parts": [
|
|
{
|
|
"text": (
|
|
"You help maintain a synthetic Python project. Read the relevant files before suggesting a fix. "
|
|
"Explain which file you need next, then call a read-only tool. Never change files. Use the messages "
|
|
"client for this project review. Consider zero, negative and non-integer quantities before choosing "
|
|
"the next file to inspect."
|
|
),
|
|
},
|
|
],
|
|
},
|
|
},
|
|
mock_provider_response={
|
|
**VERTEX_AI_GEMINI_GENERATE_CONTENT_RESPONSE,
|
|
"candidates": [
|
|
{
|
|
"content": {
|
|
"role": "model",
|
|
"parts": [
|
|
{
|
|
"text": (
|
|
"**My Thought Process on Reviewing Quantity Validation**\n\nMy primary objective is to understand how "
|
|
"the system handles zero, negative, and non-integer quantities, as this is crucial for ensuring the "
|
|
"integrity of our synthetic Python project. The user's initial request directly guides me to the "
|
|
'"validation file first so we can understand how zero and negative quantities are handled."\n\nIn '
|
|
"alignment with my system instructions, I must first identify the next relevant file, explain why "
|
|
"I'm choosing it, and then use a read-only tool to inspect it. I also need to explicitly keep in "
|
|
"mind the nuances of zero, negative, and non-integer quantities as I proceed.\n\nTherefore, the "
|
|
"immediate next step is to examine the validation logic. Based on this, I've deduced that "
|
|
"`shop/validation.py` is the file I need to inspect. This file is likely to contain the core logic "
|
|
"for validating quantities, and I anticipate it will provide the answers regarding how these "
|
|
"specific edge cases (zero, negative, and non-integer values) are managed.\n\nTo get a comprehensive "
|
|
"view of this validation mechanism, I will focus on the initial section of the file, particularly "
|
|
"around the function `validate_quantity(quantity)`, which I recall is located at line 18. I'll "
|
|
"request to read lines 1 through 40 to get a good understanding of the surrounding context and the "
|
|
"validation function itself.\n\n"
|
|
),
|
|
"thought": True,
|
|
},
|
|
{
|
|
"text": (
|
|
"I need to read `shop/validation.py` next to see how `validate_quantity` validates incoming quantity "
|
|
"values, including checks for zero, negative, and non-integer quantities."
|
|
),
|
|
},
|
|
{
|
|
"functionCall": {
|
|
"name": "read_file",
|
|
"args": {"end_line": 40, "path": "shop/validation.py", "start_line": 1},
|
|
"id": "call_190093",
|
|
},
|
|
"thoughtSignature": GEMINI_3_8_FLASH_MESSAGES_THOUGHT_SIGNATURE_0,
|
|
},
|
|
],
|
|
},
|
|
"finishReason": "STOP",
|
|
},
|
|
],
|
|
"usageMetadata": {
|
|
"promptTokenCount": 242,
|
|
"candidatesTokenCount": 71,
|
|
"totalTokenCount": 556,
|
|
"trafficType": "ON_DEMAND",
|
|
"promptTokensDetails": [{"modality": "TEXT", "tokenCount": 242}],
|
|
"candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 71}],
|
|
"thoughtsTokenCount": 243,
|
|
},
|
|
"modelVersion": "gemini-3.8-flash",
|
|
"createTime": "2026-10-15T01:13:45.750641Z",
|
|
"responseId": "ySjQarHoLb2apucPwee_YQ",
|
|
},
|
|
expected_litellm_response={
|
|
**MESSAGES_BRIDGE_RESPONSE,
|
|
"id": "ySjQarHoLb2apucPwee_YQ",
|
|
"model": "vertex_ai/gemini-3.8-flash",
|
|
"usage": {"input_tokens": 242, "output_tokens": 314},
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"**My Thought Process on Reviewing Quantity Validation**\n\nMy primary objective is to understand how "
|
|
"the system handles zero, negative, and non-integer quantities, as this is crucial for ensuring the "
|
|
"integrity of our synthetic Python project. The user's initial request directly guides me to the "
|
|
'"validation file first so we can understand how zero and negative quantities are handled."\n\nIn '
|
|
"alignment with my system instructions, I must first identify the next relevant file, explain why "
|
|
"I'm choosing it, and then use a read-only tool to inspect it. I also need to explicitly keep in "
|
|
"mind the nuances of zero, negative, and non-integer quantities as I proceed.\n\nTherefore, the "
|
|
"immediate next step is to examine the validation logic. Based on this, I've deduced that "
|
|
"`shop/validation.py` is the file I need to inspect. This file is likely to contain the core logic "
|
|
"for validating quantities, and I anticipate it will provide the answers regarding how these "
|
|
"specific edge cases (zero, negative, and non-integer values) are managed.\n\nTo get a comprehensive "
|
|
"view of this validation mechanism, I will focus on the initial section of the file, particularly "
|
|
"around the function `validate_quantity(quantity)`, which I recall is located at line 18. I'll "
|
|
"request to read lines 1 through 40 to get a good understanding of the surrounding context and the "
|
|
"validation function itself.\n\n"
|
|
),
|
|
"signature": "",
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"I need to read `shop/validation.py` next to see how `validate_quantity` validates incoming quantity "
|
|
"values, including checks for zero, negative, and non-integer quantities."
|
|
),
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "call_190093",
|
|
"name": "read_file",
|
|
"input": {"end_line": 40, "path": "shop/validation.py", "start_line": 1},
|
|
"provider_specific_fields": {"signature": GEMINI_3_8_FLASH_MESSAGES_THOUGHT_SIGNATURE_0},
|
|
},
|
|
],
|
|
},
|
|
)
|
|
|
|
|
|
GEMINI_3_1_PRO_PREVIEW_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "vertex_ai/gemini-3.1-pro-preview"},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/google/models/gemini-3.1-pro-preview:generateContent",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer scripted-token"},
|
|
expected_provider_request={
|
|
**VERTEX_AI_GEMINI_GENERATE_CONTENT_REQUEST,
|
|
"system_instruction": {
|
|
"parts": [
|
|
{
|
|
"text": (
|
|
"You help maintain a synthetic Python project. Read the relevant files before suggesting a fix. "
|
|
"Explain which file you need next, then call a read-only tool. Never change files. Use the messages "
|
|
"client for this project review. Consider zero, negative and non-integer quantities before choosing "
|
|
"the next file to inspect."
|
|
),
|
|
},
|
|
],
|
|
},
|
|
},
|
|
mock_provider_response={
|
|
**VERTEX_AI_GEMINI_GENERATE_CONTENT_RESPONSE,
|
|
"candidates": [
|
|
{
|
|
"content": {
|
|
"role": "model",
|
|
"parts": [
|
|
{
|
|
"text": (
|
|
"**My Thought Process on Quantities in the Shop Module**\n\nMy immediate goal here is to gain a "
|
|
"precise understanding of how the `shop` module, specifically within its `validation.py` file, "
|
|
"handles the input of item quantities, with a particular focus on zero and negative values. This is "
|
|
"a critical area for ensuring data integrity and preventing potential issues downstream in any "
|
|
"e-commerce or inventory system.\n\nTo achieve this, I need to examine the source code directly. I've "
|
|
"identified that the relevant logic for quantity validation is likely contained within a function "
|
|
"named `validate_quantity`. Based on my indexing or prior knowledge of this codebase, I know this "
|
|
"function resides in `shop/validation.py`. I'll proceed by reading a section of this file that "
|
|
"encompasses the `validate_quantity` function. I'm aiming for a contextually rich view, so I'll "
|
|
"fetch lines from around where I expect the function to start. My tool call will be to `read_file`, "
|
|
'specifying the path as `"shop/validation.py"`. To ensure I capture the function definition and its '
|
|
"immediate surrounding logic, I'll set `start_line` to `1` and `end_line` to `30`. This range should "
|
|
"provide me with sufficient context to analyze the function's implementation.\n\nOnce I have the "
|
|
"content of `shop/validation.py` for those lines, I will meticulously review the `validate_quantity` "
|
|
"function to observe how it explicitly checks for and handles zero and negative quantity inputs. "
|
|
"This will involve looking for conditional statements (`if`, `elif`, `else`) and any associated "
|
|
"error-raising mechanisms or default behaviors.\n\n"
|
|
),
|
|
"thought": True,
|
|
},
|
|
{
|
|
"text": (
|
|
"I will read the `shop/validation.py` file to see how `validate_quantity` handles zero and negative "
|
|
"quantities."
|
|
),
|
|
},
|
|
{
|
|
"functionCall": {
|
|
"name": "read_file",
|
|
"args": {"start_line": 1, "end_line": 35, "path": "shop/validation.py"},
|
|
"id": "call_1455553",
|
|
},
|
|
"thoughtSignature": GEMINI_3_1_PRO_PREVIEW_MESSAGES_THOUGHT_SIGNATURE_0,
|
|
},
|
|
],
|
|
},
|
|
"finishReason": "STOP",
|
|
},
|
|
],
|
|
"usageMetadata": {
|
|
"promptTokenCount": 242,
|
|
"candidatesTokenCount": 59,
|
|
"totalTokenCount": 499,
|
|
"trafficType": "ON_DEMAND",
|
|
"promptTokensDetails": [{"modality": "TEXT", "tokenCount": 242}],
|
|
"candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 59}],
|
|
"thoughtsTokenCount": 198,
|
|
},
|
|
"modelVersion": "gemini-3.1-pro-preview",
|
|
"createTime": "2026-10-15T01:13:40.675781Z",
|
|
"responseId": "xCjQasWfKcyL9LsPx7HAqQ8",
|
|
},
|
|
expected_litellm_response={
|
|
**MESSAGES_BRIDGE_RESPONSE,
|
|
"id": "xCjQasWfKcyL9LsPx7HAqQ8",
|
|
"model": "vertex_ai/gemini-3.1-pro-preview",
|
|
"usage": {"input_tokens": 242, "output_tokens": 257},
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"**My Thought Process on Quantities in the Shop Module**\n\nMy immediate goal here is to gain a "
|
|
"precise understanding of how the `shop` module, specifically within its `validation.py` file, "
|
|
"handles the input of item quantities, with a particular focus on zero and negative values. This is "
|
|
"a critical area for ensuring data integrity and preventing potential issues downstream in any "
|
|
"e-commerce or inventory system.\n\nTo achieve this, I need to examine the source code directly. I've "
|
|
"identified that the relevant logic for quantity validation is likely contained within a function "
|
|
"named `validate_quantity`. Based on my indexing or prior knowledge of this codebase, I know this "
|
|
"function resides in `shop/validation.py`. I'll proceed by reading a section of this file that "
|
|
"encompasses the `validate_quantity` function. I'm aiming for a contextually rich view, so I'll "
|
|
"fetch lines from around where I expect the function to start. My tool call will be to `read_file`, "
|
|
'specifying the path as `"shop/validation.py"`. To ensure I capture the function definition and its '
|
|
"immediate surrounding logic, I'll set `start_line` to `1` and `end_line` to `30`. This range should "
|
|
"provide me with sufficient context to analyze the function's implementation.\n\nOnce I have the "
|
|
"content of `shop/validation.py` for those lines, I will meticulously review the `validate_quantity` "
|
|
"function to observe how it explicitly checks for and handles zero and negative quantity inputs. "
|
|
"This will involve looking for conditional statements (`if`, `elif`, `else`) and any associated "
|
|
"error-raising mechanisms or default behaviors.\n\n"
|
|
),
|
|
"signature": "",
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"I will read the `shop/validation.py` file to see how `validate_quantity` handles zero and negative "
|
|
"quantities."
|
|
),
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "call_1455553",
|
|
"name": "read_file",
|
|
"input": {"start_line": 1, "end_line": 35, "path": "shop/validation.py"},
|
|
"provider_specific_fields": {"signature": GEMINI_3_1_PRO_PREVIEW_MESSAGES_THOUGHT_SIGNATURE_0},
|
|
},
|
|
],
|
|
},
|
|
)
|
|
|
|
|
|
GEMINI_4_ARGON_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "vertex_ai/gemini-4-argon"},
|
|
expected_provider_endpoint="/v1/projects/synthetic-vertex-project/locations/global/publishers/google/models/gemini-4-argon:generateContent",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer scripted-token"},
|
|
expected_provider_request={
|
|
**VERTEX_AI_GEMINI_GENERATE_CONTENT_REQUEST,
|
|
"system_instruction": {
|
|
"parts": [
|
|
{
|
|
"text": (
|
|
"You help maintain a synthetic Python project. Read the relevant files before suggesting a fix. "
|
|
"Explain which file you need next, then call a read-only tool. Never change files. Use the messages "
|
|
"client for this project review. Consider zero, negative and non-integer quantities before choosing "
|
|
"the next file to inspect."
|
|
),
|
|
},
|
|
],
|
|
},
|
|
},
|
|
mock_provider_response={
|
|
**VERTEX_AI_GEMINI_GENERATE_CONTENT_RESPONSE,
|
|
"candidates": [
|
|
{
|
|
"content": {
|
|
"role": "model",
|
|
"parts": [
|
|
{
|
|
"text": (
|
|
"**My Thought Process on Handling Quantity Validation**\n\nMy primary objective is to meticulously "
|
|
"understand how the system currently manages the validation of product quantities, specifically "
|
|
"focusing on how it addresses zero and negative values. To achieve this, I need to first dive into "
|
|
"the `shop/validation.py` file. This will provide me with the foundational knowledge of the existing "
|
|
"logic and the rules that govern quantity inputs.\n\nFollowing the system's instructions, my next step "
|
|
"is to explicitly state which file I require for this understanding and then invoke the `read_file` "
|
|
"tool to access `shop/validation.py`. I must also keep in mind the overarching directive to consider "
|
|
"zero, negative, and non-integer quantities throughout this process, as this will be crucial when I "
|
|
"eventually propose any solutions or fixes. It's important to remember that I am not to alter any "
|
|
"files, only to read and analyze them, and to communicate my progress and needs via the provided "
|
|
"messages client.\n\n"
|
|
),
|
|
"thought": True,
|
|
},
|
|
{
|
|
"text": (
|
|
"I will read `shop/validation.py` next to inspect how `validate_quantity` handles zero, negative, "
|
|
"and non-integer quantities."
|
|
),
|
|
},
|
|
{
|
|
"functionCall": {
|
|
"name": "read_file",
|
|
"args": {"end_line": 50, "start_line": 1, "path": "shop/validation.py"},
|
|
"id": "call_258575",
|
|
},
|
|
"thoughtSignature": GEMINI_4_ARGON_MESSAGES_THOUGHT_SIGNATURE_0,
|
|
},
|
|
],
|
|
},
|
|
"finishReason": "STOP",
|
|
},
|
|
],
|
|
"usageMetadata": {
|
|
"promptTokenCount": 412,
|
|
"candidatesTokenCount": 69,
|
|
"totalTokenCount": 604,
|
|
"trafficType": "ON_DEMAND",
|
|
"promptTokensDetails": [{"modality": "TEXT", "tokenCount": 412}],
|
|
"candidatesTokensDetails": [{"modality": "TEXT", "tokenCount": 69}],
|
|
"thoughtsTokenCount": 123,
|
|
},
|
|
"modelVersion": "gemini-4-argon",
|
|
"createTime": "2026-10-15T01:13:52.985186Z",
|
|
"responseId": "0CjQauKQPNyFpucPldSPiAY",
|
|
},
|
|
expected_litellm_response={
|
|
**MESSAGES_BRIDGE_RESPONSE,
|
|
"id": "0CjQauKQPNyFpucPldSPiAY",
|
|
"model": "vertex_ai/gemini-4-argon",
|
|
"usage": {"input_tokens": 412, "output_tokens": 192},
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": (
|
|
"**My Thought Process on Handling Quantity Validation**\n\nMy primary objective is to meticulously "
|
|
"understand how the system currently manages the validation of product quantities, specifically "
|
|
"focusing on how it addresses zero and negative values. To achieve this, I need to first dive into "
|
|
"the `shop/validation.py` file. This will provide me with the foundational knowledge of the existing "
|
|
"logic and the rules that govern quantity inputs.\n\nFollowing the system's instructions, my next step "
|
|
"is to explicitly state which file I require for this understanding and then invoke the `read_file` "
|
|
"tool to access `shop/validation.py`. I must also keep in mind the overarching directive to consider "
|
|
"zero, negative, and non-integer quantities throughout this process, as this will be crucial when I "
|
|
"eventually propose any solutions or fixes. It's important to remember that I am not to alter any "
|
|
"files, only to read and analyze them, and to communicate my progress and needs via the provided "
|
|
"messages client.\n\n"
|
|
),
|
|
"signature": "",
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": (
|
|
"I will read `shop/validation.py` next to inspect how `validate_quantity` handles zero, negative, "
|
|
"and non-integer quantities."
|
|
),
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "call_258575",
|
|
"name": "read_file",
|
|
"input": {"end_line": 50, "start_line": 1, "path": "shop/validation.py"},
|
|
"provider_specific_fields": {"signature": GEMINI_4_ARGON_MESSAGES_THOUGHT_SIGNATURE_0},
|
|
},
|
|
],
|
|
},
|
|
)
|