Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(translation): add claude-sonnet-5-5 anthropic messages service_tier case (#46678)

devin-ai-integration[bot]0a680f68212b
diff --git a/tests/integration/translation/messages/service_tier/test_messages_service_tier_anthropic.py b/tests/integration/translation/messages/service_tier/test_messages_service_tier_anthropic.py
index de453564e15..5a3a760ffdc 100644
--- a/tests/integration/translation/messages/service_tier/test_messages_service_tier_anthropic.py
+++ b/tests/integration/translation/messages/service_tier/test_messages_service_tier_anthropic.py
@@ -5,7 +5,7 @@ import pytest
from integration._support.client import Gateway
from integration._support.provider import SharedProvider
from integration.translation.case import TranslationTestCase
-from integration.translation.messages.bases.anthropic import CLAUDE_SONNET_4_6_TEST_CASE
+from integration.translation.messages.bases.anthropic import CLAUDE_SONNET_4_6_TEST_CASE, CLAUDE_SONNET_5_5_TEST_CASE
from integration.translation.runner import assert_translation
CLAUDE_SONNET_4_6_SERVICE_TIER_TEST_CASE: Final = replace(
@@ -24,6 +24,76 @@ CLAUDE_SONNET_4_6_SERVICE_TIER_TEST_CASE: Final = replace(
)
[email protected]("case", [CLAUDE_SONNET_4_6_SERVICE_TIER_TEST_CASE], ids=lambda case: case.id)
+CLAUDE_SONNET_5_5_SERVICE_TIER_THINKING_SIGNATURE: Final = (
+ "CAQSkQcKEAgSGAI4AUIIdGhpbmtpbmcSDEpY9gn98XnFX1pSihoMmijS1UTCmGlkINMoIjAndpfj217OaTruvzuuNVWqe7ISoH6Ju4alxqev"
+ "mfITGMNOiuRIUP5U2fMyQhVrJ20qrgaZUyE2dwvMcSaJAXqpHGrHCxxl8Caev2GOUBeBgI9gZVE08HMn22idoM90TAa1NXUZkKmJ+Rw0aQEE"
+ "G2r0rvUNY8xN5zFa8bCtNGYXqIC+Sy+kv5Al6J8dc8Gmkh0CX/Sij414Y71xUx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9T2EoZqt8",
+ "content": [
+ {
+ "type": "thinking",
+ "thinking": "I'll start by reading shop/validation.py first, as the user requested, before looking at the tests.\n\n",
+ "signature": CLAUDE_SONNET_5_5_SERVICE_TIER_THINKING_SIGNATURE,
+ },
+ {
+ "type": "text",
+ "text": "I'm reading `shop/validation.py` first. `validate_quantity` starts at line 18, so I'll read from just above it to get the imports and helpers, through the end of the function.",
+ },
+ {
+ "type": "tool_use",
+ "id": "toolu_017mBCZeT7c9e1duQXRRzS6x",
+ "name": "read_file",
+ "input": {"path": "shop/validation.py", "start_line": 1, "end_line": 60},
+ "caller": {"type": "direct"},
+ },
+ ],
+ "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": 251,
+ "output_tokens_details": {"thinking_tokens": 94},
+ "service_tier": "standard",
+ "inference_geo": "global",
+ },
+}
+
+CLAUDE_SONNET_5_5_SERVICE_TIER_TEST_CASE: Final = replace(
+ CLAUDE_SONNET_5_5_TEST_CASE,
+ scenario="service_tier",
+ litellm_request={**CLAUDE_SONNET_5_5_TEST_CASE.litellm_request, "service_tier": "standard_only"},
+ expected_provider_request={
+ **CLAUDE_SONNET_5_5_TEST_CASE.expected_provider_request,
+ "service_tier": "standard_only",
+ },
+ mock_provider_response={
+ **CLAUDE_SONNET_5_5_TEST_CASE.mock_provider_response,
+ **CLAUDE_SONNET_5_5_SERVICE_TIER_RESPONSE_FIELDS,
+ },
+ expected_litellm_response={
+ **CLAUDE_SONNET_5_5_TEST_CASE.expected_litellm_response,
+ **CLAUDE_SONNET_5_5_SERVICE_TIER_RESPONSE_FIELDS,
+ },
+)
+
+
+ "case",
+ [CLAUDE_SONNET_4_6_SERVICE_TIER_TEST_CASE, CLAUDE_SONNET_5_5_SERVICE_TIER_TEST_CASE],
+ ids=lambda case: case.id,
+)
def test_messages_service_tier_anthropic(case: TranslationTestCase, gateway: Gateway, provider: SharedProvider) -> None:
assert_translation(case, gateway, provider)