mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-01 01:18:34 +00:00
* test(integration): add rich anthropic claude haiku 5.5, opus 5.5 and fable 5.1 translation cases Capture-backed basic cases on /v1/chat/completions, /v1/messages and /v1/responses for claude-haiku-5-5, claude-opus-5-5 and claude-fable-5-1, reusing the shared client templates and ANTHROPIC_MESSAGES_REQUEST/RESPONSE with model-specific id, content and usage overrides. The minimal Opus 5.5 hello cases are replaced by the rich conversation. Sonnet 5.5 and legacy models are unchanged * test(translation): rich OpenAI captures for gpt-6.1-sol, gpt-6-luna, gpt-6-astra and gpt-5.6-terra Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(translation): rich Azure gpt-6.1-sol, gpt-6-luna, gpt-6-astra and gpt-5.6-terra cases * test(translation): rich azure_ai Claude cases for haiku-5-5 and fable-5-1 Bind the shared chat_completions, messages and responses client templates and the anthropic provider templates to azure_ai/claude-haiku-5-5 and azure_ai/claude-fable-5-1 from real Azure AI Foundry captures, keeping the Azure dialect exact (/anthropic/v1/messages, x-api-key plus api-key on chat_completions and responses, system as a text block list on /v1/messages). Add prompt_cache_hit variants for both models from the second call inside the cache window. The two deployments need rows in tests/integration/proxy_config.yaml Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(translation): rich Gemini bases for gemini-3.8-flash, gemini-3.1-pro-preview and gemini-4-argon Add the shared generateContent provider templates in templates/gemini.py from real captures and bind the three target models on chat completions, messages and responses with explicit per-model response overrides. gemini-4-argon is registered in the three basic lists. gemini-3.5-flash is unchanged * test(translation): enrich vertex_ai claude and gemini cases from live captures Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(integration): rich Bedrock converse, invoke and mantle translation cases from real captures * test(integration): register the rich translation deployments and follow the rich Gemini 3.8 Flash cases Add the synthetic deployments the rich provider cases bind (anthropic, openai, azure, azure_ai, gemini, vertex_ai, bedrock converse, invoke and mantle) to tests/integration/proxy_config.yaml, all pointed at the fake provider on 127.0.0.1:8191 with synthetic keys. The Gemini omitted-temperature contract now takes its expected generationConfig and reply text from the rich GEMINI_3_8_FLASH_TEST_CASE literals instead of the retired minimal hello cases * test(translation): reuse bridged and native response templates --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: kerry <kerry@berri.ai>
609 lines
27 KiB
Python
609 lines
27 KiB
Python
from collections.abc import Mapping
|
|
from typing import Final
|
|
|
|
from integration.translation.case import TranslationTestCase
|
|
from integration.translation.messages.templates import MESSAGES_REQUEST, MESSAGES_RESPONSE
|
|
from integration.translation.templates.bedrock_invoke import (
|
|
BEDROCK_INVOKE_REQUEST,
|
|
BEDROCK_INVOKE_RESPONSE,
|
|
)
|
|
from pydantic import JsonValue
|
|
|
|
CLAUDE_HAIKU_4_5_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "bedrock/invoke/us.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
"max_tokens": 64,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/model/us.anthropic.claude-haiku-4-5-20251001-v1:0/invoke",
|
|
expected_provider_headers={"authorization": "Bearer synthetic-bedrock-key", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"max_tokens": 64,
|
|
"system": [{"type": "text", "text": "You are a terse assistant."}],
|
|
"anthropic_version": "bedrock-2023-05-31",
|
|
},
|
|
mock_provider_response={
|
|
"model": "anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
"id": "msg_bdrk_tl6mgwwa5lgxbhipnkc6qb7landewz65mwxm553sydrxicheqe4a",
|
|
"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,
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
"model": "bedrock/invoke/us.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
"id": "msg_bdrk_tl6mgwwa5lgxbhipnkc6qb7landewz65mwxm553sydrxicheqe4a",
|
|
"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,
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_SONNET_4_6_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "bedrock/invoke/us.anthropic.claude-sonnet-4-6",
|
|
"max_tokens": 64,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/model/us.anthropic.claude-sonnet-4-6/invoke",
|
|
expected_provider_headers={"authorization": "Bearer synthetic-bedrock-key", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"max_tokens": 64,
|
|
"system": [{"type": "text", "text": "You are a terse assistant."}],
|
|
"anthropic_version": "bedrock-2023-05-31",
|
|
},
|
|
mock_provider_response={
|
|
"model": "claude-sonnet-4-6",
|
|
"id": "msg_bdrk_72khh2guasoaflwckvmpzldy67lxs4h745h7l7zujbyeizbpvxfq",
|
|
"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,
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
"model": "bedrock/invoke/us.anthropic.claude-sonnet-4-6",
|
|
"id": "msg_bdrk_72khh2guasoaflwckvmpzldy67lxs4h745h7l7zujbyeizbpvxfq",
|
|
"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,
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_SONNET_5_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "bedrock/invoke/us.anthropic.claude-sonnet-5",
|
|
"max_tokens": 64,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/model/us.anthropic.claude-sonnet-5/invoke",
|
|
expected_provider_headers={"authorization": "Bearer synthetic-bedrock-key", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"max_tokens": 64,
|
|
"system": [{"type": "text", "text": "You are a terse assistant."}],
|
|
"anthropic_version": "bedrock-2023-05-31",
|
|
},
|
|
mock_provider_response={
|
|
"model": "claude-sonnet-5",
|
|
"id": "msg_bdrk_ccbiw5fsz7qitzhh3dkgpdlk6l6cebry5wwwncia55axys522tfq",
|
|
"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},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
"model": "bedrock/invoke/us.anthropic.claude-sonnet-5",
|
|
"id": "msg_bdrk_ccbiw5fsz7qitzhh3dkgpdlk6l6cebry5wwwncia55axys522tfq",
|
|
"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},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_OPUS_4_8_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={
|
|
"model": "bedrock/invoke/us.anthropic.claude-opus-4-8",
|
|
"max_tokens": 64,
|
|
"system": "You are a terse assistant.",
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/model/us.anthropic.claude-opus-4-8/invoke",
|
|
expected_provider_headers={"authorization": "Bearer synthetic-bedrock-key", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
"messages": [{"role": "user", "content": "Say hello."}],
|
|
"max_tokens": 64,
|
|
"system": [{"type": "text", "text": "You are a terse assistant."}],
|
|
"anthropic_version": "bedrock-2023-05-31",
|
|
},
|
|
mock_provider_response={
|
|
"model": "claude-opus-4-8",
|
|
"id": "msg_bdrk_hii3yom4fpd564flttcopesy4ghq7mdw42s4xqmegk2fqmgc2suq",
|
|
"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},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
"model": "bedrock/invoke/us.anthropic.claude-opus-4-8",
|
|
"id": "msg_bdrk_hii3yom4fpd564flttcopesy4ghq7mdw42s4xqmegk2fqmgc2suq",
|
|
"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},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
)
|
|
|
|
BEDROCK_INVOKE_MESSAGES_RESPONSE: Final[Mapping[str, JsonValue]] = {
|
|
key: value for key, value in MESSAGES_RESPONSE.items() if key not in ("diagnostics",)
|
|
}
|
|
|
|
BEDROCK_INVOKE_MESSAGES_SYSTEM: Final[JsonValue] = [
|
|
{
|
|
"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.",
|
|
},
|
|
]
|
|
|
|
CLAUDE_HAIKU_5_5_THINKING_SIGNATURE_0: Final = (
|
|
"CAQS0AUKEggSEAEYAjgBQgh0aGlua2luZxIM9tsaCdqj5UGVQgHOGgylOg8RDlmh3f1L79YiMFFshwFAzn8fQTRWSqaR7dpBkcadG+cFDccq"
|
|
"6Cu6MZxJNVXFtqpmgsWFQR5WGlEgKirrBMjA2IESdj0ySte+0ETFtNXPDkfiovCk9en3WHVYW+jvrAIJzOA7Y9oF52rkQUYY/oIeksjLdriJ"
|
|
"3dTogQyx1PR+LkdBZp63sAr+Zn92Q/7/ZBj4k8f6/wlICa/KiRtklkGz/KfLpCJlhzCoxDZ9nqaMKeWLHBX5/UlJ7Lf8j4VrW4Tr9oQ3VRia"
|
|
"iue189vHibmvLtb0lSOoiMq4hEvE2dA0x7RZnLXQ+mULWd7TVnEeQ1NnGt8SNV56ru58gCU6t6Z/KylY3K5H0EEkFImpOigKlNrdDrk7wRxj"
|
|
"hCaFKsc88HUJ15V+3iA0ys3IcZarEFeuDj3fjiKYGtDzaWWDGpmQs7CsKVjAs6YfVh3Eks0KGuDppfnM8QyvmUz8y7aIkeuuES1u9F82g3NQ"
|
|
"3FoReR4wwdy76xypUHY415wLODfAiSoJjqsI9DArNQc//8UeQX++ECLuvwNm72CgbcN7L13BznbeSQdV1Un65uXS2wT+1eGvDBgGuwuXgvY5"
|
|
"ri2U5YgvnowPboiziBMaUxKNEhNouvD+l+p1bxalC03JcCUCA1MJzqAafufTscOdR1mTSl5V2+PPHz964pvxDCMRR0n+nBGsc3obeoS+9Vqp"
|
|
"yRG2lrPQj8t9GYzL93C2gbB3o0mdBB2dZTlKPxTnkCanL+1PwLjuKiy7lklHNo/upTP84kISsX+pOSrSNRW//BDbC5wkqgXHx/GsVL9OfrBe"
|
|
"P7f4SmUh6VWykR44kEO7vfR2LF1N3LRsHrI4OuNXlh6AbxShwGMvdimckzK5IjCTPX6DKQBXWmlmNJyeNzw2U37e44S9+vhdz5TBhfcYAQ=="
|
|
)
|
|
|
|
CLAUDE_HAIKU_5_5_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "bedrock/invoke/us.anthropic.claude-haiku-5-5"},
|
|
expected_provider_endpoint="/model/us.anthropic.claude-haiku-5-5/invoke",
|
|
expected_provider_headers={"authorization": "Bearer synthetic-bedrock-key", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
**BEDROCK_INVOKE_REQUEST,
|
|
"messages": MESSAGES_REQUEST["messages"],
|
|
"system": BEDROCK_INVOKE_MESSAGES_SYSTEM,
|
|
"tools": MESSAGES_REQUEST["tools"],
|
|
},
|
|
mock_provider_response={
|
|
**BEDROCK_INVOKE_RESPONSE,
|
|
"id": "msg_bdrk_wzz4hwc4dbdg5xyblodt4ucbo6racirmvwxrmm7knfhbqy4m2tfq",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": "I'll take a look at shop/validation.py to check how it handles edge cases like zero, "
|
|
"negative, or non-integer quantities before deciding what to review next.\n\n",
|
|
"signature": CLAUDE_HAIKU_5_5_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_bdrk_01SAJFKxZ5AbvBAPai5cpFSs",
|
|
"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": 185,
|
|
"output_tokens_details": {"thinking_tokens": 85},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
**BEDROCK_INVOKE_MESSAGES_RESPONSE,
|
|
"model": "bedrock/invoke/us.anthropic.claude-haiku-5-5",
|
|
"id": "msg_bdrk_wzz4hwc4dbdg5xyblodt4ucbo6racirmvwxrmm7knfhbqy4m2tfq",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": "I'll take a look at shop/validation.py to check how it handles edge cases like zero, "
|
|
"negative, or non-integer quantities before deciding what to review next.\n\n",
|
|
"signature": CLAUDE_HAIKU_5_5_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_bdrk_01SAJFKxZ5AbvBAPai5cpFSs",
|
|
"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": 185,
|
|
"output_tokens_details": {"thinking_tokens": 85},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_SONNET_5_5_THINKING_SIGNATURE_0: Final = (
|
|
"CAQSnwYKEggSEAEYAjgBQgh0aGlua2luZxIM5Rdi0bxwZPzY53K/Ggz5v0FGebtekQAdYi0iML9pU9O153URlvQmE61tNy33MyzsPW3gebf0"
|
|
"uYHHYrfZvthRnZ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
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "bedrock/invoke/us.anthropic.claude-sonnet-5-5"},
|
|
expected_provider_endpoint="/model/us.anthropic.claude-sonnet-5-5/invoke",
|
|
expected_provider_headers={"authorization": "Bearer synthetic-bedrock-key", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
**BEDROCK_INVOKE_REQUEST,
|
|
"messages": MESSAGES_REQUEST["messages"],
|
|
"system": BEDROCK_INVOKE_MESSAGES_SYSTEM,
|
|
"tools": MESSAGES_REQUEST["tools"],
|
|
},
|
|
mock_provider_response={
|
|
**BEDROCK_INVOKE_RESPONSE,
|
|
"model": "claude-sonnet-5-5",
|
|
"id": "msg_bdrk_rcnbkubesv2zarg2r6uit3hne2znqytllke3i5jo6sm6eh7ml7za",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": "Since the user asked me to look at the validation file first, I'll start there and read "
|
|
"through roughly the first 60 lines to get the context I need before considering the tests.\n\n",
|
|
"signature": CLAUDE_SONNET_5_5_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": "I need `shop/validation.py` first. It defines `validate_quantity` at line 18, so it will "
|
|
"show how zero, negative and non-integer values are handled. I'll read the tests after "
|
|
"that.",
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_bdrk_012x6zRfbMwPWH1TvwvtJcTd",
|
|
"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": 98},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
**BEDROCK_INVOKE_MESSAGES_RESPONSE,
|
|
"model": "bedrock/invoke/us.anthropic.claude-sonnet-5-5",
|
|
"id": "msg_bdrk_rcnbkubesv2zarg2r6uit3hne2znqytllke3i5jo6sm6eh7ml7za",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": "Since the user asked me to look at the validation file first, I'll start there and read "
|
|
"through roughly the first 60 lines to get the context I need before considering the tests.\n\n",
|
|
"signature": CLAUDE_SONNET_5_5_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": "I need `shop/validation.py` first. It defines `validate_quantity` at line 18, so it will "
|
|
"show how zero, negative and non-integer values are handled. I'll read the tests after "
|
|
"that.",
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_bdrk_012x6zRfbMwPWH1TvwvtJcTd",
|
|
"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": 98},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_OPUS_5_5_THINKING_SIGNATURE_0: Final = (
|
|
"CAQSigUKEggSEAEYAjgBQgh0aGlua2luZxIMo+bg7J1athsROSzTGgz8CIhzKVCiV3U3zR8iMFgRZ0GxT3RyB90ZBPfccjWj9SmeP5Su7x5K"
|
|
"v4XcUof6Yw7d+Q31UhW8CTZdeivdDCqlBOkneYlYuN0wm6pkFQG8Cg+ThPVN8HGn/QiZPBihOr5ZJK1joYur01TDHIYWzKuBOHJ/fmYfdgoG"
|
|
"I0d6WAsw3FdL4zsbhWSEHbbD8+RFz/wk/LqOdaQNYS4I42fytuO9+i5bVthVB3UVl0QEDxPw9s/4c/RaFMQpIyuCigqyJpZC6UK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qzDRSASmZu2VYoPZwgWdd/ufIJ2oqH56p+6JszgX92U0d9yJ8o6uw"
|
|
"fvFrP08YYayBhJn7Ba2lpDTdlCtYLT9qsLyXwQ4NIwPr36nzBbDWhRhF5Z5sGdA8vRnyue/CYpbLdI8Qg3JiXaXXTsGhDvbAmX6x55PhXiag"
|
|
"WaQSsQ6UzsJIdSUdjeD5bnrJ841oSnsG5qKaUfz+yr3cRn4ZnIHqDbZ4o9o/0lQC4++WHe2VddIIET3vVITKF+jKUsHo62vr5nx6tyUj5dGj"
|
|
"ZMyFsEMYmf4b9hgij84/mgCOGLNQ5Nu1PM1GKnMpm2dEaosjmSB14pTkuJCzUWGrLANWcgKJRRfv1Wy6n1xaORcm8w7mIWaYbqcxBPddTVOi"
|
|
"sXQ2Gr5pZRsbmcMnYcsDF/LejdLT7m1w4WEeOG7B7kXue2FkVaBq0k5K/mgGuIpdmhuwEYuzA5nf+E91Ik0+ktTT5tX/LfhlTc1RqIT07G86"
|
|
"ufm8yKpp6Uc7PvWXGm7tR+/70sN5O4ltSiamehskjtAHj1ev3zc/dQJ3oQP6ljf1AY7/ZB9v6YgLY1c0tZ+cHUQ/0+ND+7sraZu/Xiihggfc"
|
|
"s8SMejElcBxTWV86zG2ijctI5UlotIclfNMiGAE="
|
|
)
|
|
|
|
CLAUDE_OPUS_5_5_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "bedrock/invoke/us.anthropic.claude-opus-5-5"},
|
|
expected_provider_endpoint="/model/us.anthropic.claude-opus-5-5/invoke",
|
|
expected_provider_headers={"authorization": "Bearer synthetic-bedrock-key", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
**BEDROCK_INVOKE_REQUEST,
|
|
"messages": MESSAGES_REQUEST["messages"],
|
|
"system": BEDROCK_INVOKE_MESSAGES_SYSTEM,
|
|
"tools": MESSAGES_REQUEST["tools"],
|
|
},
|
|
mock_provider_response={
|
|
**BEDROCK_INVOKE_RESPONSE,
|
|
"model": "claude-opus-5-5",
|
|
"id": "msg_bdrk_twd7a5k6nmlhwudxctflvx44se2jpvhjrwimhwul2gwzgnni3zsa",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": "I'll start by reading the validation file around line 18, as the user requested first, "
|
|
"before checking the tests.\n\n",
|
|
"signature": CLAUDE_OPUS_5_5_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "thinking",
|
|
"thinking": "Now I'll check `validate_quantity` in `shop/validation.py` around line 18 to see how it "
|
|
"handles zero, negative, and non-integer inputs before reviewing the test.\n\n",
|
|
"signature": CLAUDE_OPUS_5_5_THINKING_SIGNATURE_1,
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_bdrk_01Kf2DAxymu3xTnb2AwxZZgB",
|
|
"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": 221,
|
|
"output_tokens_details": {"thinking_tokens": 50},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
**BEDROCK_INVOKE_MESSAGES_RESPONSE,
|
|
"model": "bedrock/invoke/us.anthropic.claude-opus-5-5",
|
|
"id": "msg_bdrk_twd7a5k6nmlhwudxctflvx44se2jpvhjrwimhwul2gwzgnni3zsa",
|
|
"content": [
|
|
{
|
|
"type": "thinking",
|
|
"thinking": "I'll start by reading the validation file around line 18, as the user requested first, "
|
|
"before checking the tests.\n\n",
|
|
"signature": CLAUDE_OPUS_5_5_THINKING_SIGNATURE_0,
|
|
},
|
|
{
|
|
"type": "thinking",
|
|
"thinking": "Now I'll check `validate_quantity` in `shop/validation.py` around line 18 to see how it "
|
|
"handles zero, negative, and non-integer inputs before reviewing the test.\n\n",
|
|
"signature": CLAUDE_OPUS_5_5_THINKING_SIGNATURE_1,
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_bdrk_01Kf2DAxymu3xTnb2AwxZZgB",
|
|
"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": 221,
|
|
"output_tokens_details": {"thinking_tokens": 50},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
)
|
|
|
|
CLAUDE_FABLE_5_1_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/messages",
|
|
litellm_request={**MESSAGES_REQUEST, "model": "bedrock/invoke/us.anthropic.claude-fable-5-1"},
|
|
expected_provider_endpoint="/model/us.anthropic.claude-fable-5-1/invoke",
|
|
expected_provider_headers={"authorization": "Bearer synthetic-bedrock-key", "content-type": "application/json"},
|
|
expected_provider_request={
|
|
**BEDROCK_INVOKE_REQUEST,
|
|
"messages": MESSAGES_REQUEST["messages"],
|
|
"system": BEDROCK_INVOKE_MESSAGES_SYSTEM,
|
|
"tools": MESSAGES_REQUEST["tools"],
|
|
},
|
|
mock_provider_response={
|
|
**BEDROCK_INVOKE_RESPONSE,
|
|
"model": "claude-fable-5-1",
|
|
"id": "msg_bdrk_gh2vug2tpleguniqdb6ry6otz5y4x2jxg3lneudi2hx4wrv6xp5q",
|
|
"content": [
|
|
{
|
|
"type": "text",
|
|
"text": "I'll read the validation function around line 18 in shop/validation.py.",
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_bdrk_01Wr8tPMkYit6TSkCn7oBKcr",
|
|
"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": 122,
|
|
"output_tokens_details": {"thinking_tokens": 0},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
expected_litellm_response={
|
|
**BEDROCK_INVOKE_MESSAGES_RESPONSE,
|
|
"model": "bedrock/invoke/us.anthropic.claude-fable-5-1",
|
|
"id": "msg_bdrk_gh2vug2tpleguniqdb6ry6otz5y4x2jxg3lneudi2hx4wrv6xp5q",
|
|
"content": [
|
|
{
|
|
"type": "text",
|
|
"text": "I'll read the validation function around line 18 in shop/validation.py.",
|
|
},
|
|
{
|
|
"type": "tool_use",
|
|
"id": "toolu_bdrk_01Wr8tPMkYit6TSkCn7oBKcr",
|
|
"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": 122,
|
|
"output_tokens_details": {"thinking_tokens": 0},
|
|
"service_tier": "standard",
|
|
},
|
|
},
|
|
)
|