diff --git a/tests/integration/cost_calculation/cases/anthropic.py b/tests/integration/cost_calculation/cases/anthropic.py index 1ea9cb44868..cadbca9b96f 100644 --- a/tests/integration/cost_calculation/cases/anthropic.py +++ b/tests/integration/cost_calculation/cases/anthropic.py @@ -14,6 +14,7 @@ from integration.cost_calculation.cost_tracking_case import ( RecountRates, SseResponse, ) +from integration.cost_calculation.bridge_cost_parity.case import BridgeCostParityTestCase from integration.cost_calculation.stream_parity.case import StreamParityTestCase, sse_frames @@ -6656,7 +6657,61 @@ CLAUDE_OPUS_5_5_INPUT_TEXT_ROLLUPS: Final = CostTrackingTestCase( ), ) +CLAUDE_SONNET_5_RESPONSES_BRIDGED_JSON: Final = CLAUDE_SONNET_5_MESSAGES_INPUT_TEXT.model_copy( + update={ + "name": "claude-sonnet-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +CLAUDE_SONNET_5_5_RESPONSES_BRIDGED_JSON: Final = CLAUDE_SONNET_5_5_MESSAGES_INPUT_TEXT.model_copy( + update={ + "name": "claude-sonnet-5-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +CLAUDE_HAIKU_5_5_RESPONSES_BRIDGED_JSON: Final = CLAUDE_HAIKU_5_5_MESSAGES_INPUT_TEXT.model_copy( + update={ + "name": "claude-haiku-5-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +CLAUDE_FABLE_5_RESPONSES_BRIDGED_JSON: Final = CLAUDE_FABLE_5_MESSAGES_INPUT_TEXT.model_copy( + update={ + "name": "claude-fable-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +CLAUDE_FABLE_5_1_RESPONSES_BRIDGED_JSON: Final = CLAUDE_FABLE_5_1_MESSAGES_INPUT_TEXT.model_copy( + update={ + "name": "claude-fable-5-1-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +CLAUDE_OPUS_5_5_RESPONSES_BRIDGED_JSON: Final = CLAUDE_OPUS_5_5_MESSAGES_INPUT_TEXT.model_copy( + update={ + "name": "claude-opus-5-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + CASES: Final[tuple[CostTrackingTestCase, ...]] = ( + CLAUDE_SONNET_5_RESPONSES_BRIDGED_JSON, + CLAUDE_SONNET_5_5_RESPONSES_BRIDGED_JSON, + CLAUDE_HAIKU_5_5_RESPONSES_BRIDGED_JSON, + CLAUDE_FABLE_5_RESPONSES_BRIDGED_JSON, + CLAUDE_FABLE_5_1_RESPONSES_BRIDGED_JSON, + CLAUDE_OPUS_5_5_RESPONSES_BRIDGED_JSON, CLAUDE_HAIKU_4_5_INPUT_TEXT, CLAUDE_HAIKU_4_5_CACHE_READ, CLAUDE_HAIKU_4_5_CACHE_WRITE_5M, @@ -6798,3 +6853,22 @@ PARITY: Final[tuple[StreamParityTestCase, ...]] = ( StreamParityTestCase(plain=CLAUDE_FABLE_5_1_INPUT_TEXT, streamed=CLAUDE_FABLE_5_1_STREAM), StreamParityTestCase(plain=CLAUDE_OPUS_5_5_INPUT_TEXT, streamed=CLAUDE_OPUS_5_5_STREAM), ) + +BRIDGE_COST_PARITY: Final[tuple[BridgeCostParityTestCase, ...]] = ( + BridgeCostParityTestCase( + native=CLAUDE_SONNET_5_MESSAGES_INPUT_TEXT, bridged=CLAUDE_SONNET_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=CLAUDE_SONNET_5_5_MESSAGES_INPUT_TEXT, bridged=CLAUDE_SONNET_5_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=CLAUDE_HAIKU_5_5_MESSAGES_INPUT_TEXT, bridged=CLAUDE_HAIKU_5_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase(native=CLAUDE_FABLE_5_MESSAGES_INPUT_TEXT, bridged=CLAUDE_FABLE_5_RESPONSES_BRIDGED_JSON), + BridgeCostParityTestCase( + native=CLAUDE_FABLE_5_1_MESSAGES_INPUT_TEXT, bridged=CLAUDE_FABLE_5_1_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=CLAUDE_OPUS_5_5_MESSAGES_INPUT_TEXT, bridged=CLAUDE_OPUS_5_5_RESPONSES_BRIDGED_JSON + ), +) diff --git a/tests/integration/cost_calculation/catalog.py b/tests/integration/cost_calculation/catalog.py index 9f99d8fb2c1..9702c2f9d20 100644 --- a/tests/integration/cost_calculation/catalog.py +++ b/tests/integration/cost_calculation/catalog.py @@ -55,6 +55,7 @@ BRIDGE_COST_PARITY_CASES: Final[tuple[BridgeCostParityTestCase, ...]] = ( *openai.BRIDGE_COST_PARITY, *bedrock_converse.BRIDGE_COST_PARITY, *azure.BRIDGE_COST_PARITY, + *anthropic.BRIDGE_COST_PARITY, ) _PARITY_LEGS: Final = frozenset(leg.name for pair in PARITY_CASES for leg in (pair.plain, pair.streamed)) | frozenset( leg.name for pair in BRIDGE_COST_PARITY_CASES for leg in (pair.native, pair.bridged)