From 00e25792c5d7458517bcaa671466d367c5b04409 Mon Sep 17 00:00:00 2001 From: Kerry Lu Date: Mon, 12 Oct 2026 20:13:33 -0700 Subject: [PATCH] test(cost): add Bedrock Converse Claude 5 /v1/responses bridge cost parity pairs (#46141) Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../cases/bedrock_converse.py | 88 +++++++++++++++++++ tests/integration/cost_calculation/catalog.py | 5 +- 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/tests/integration/cost_calculation/cases/bedrock_converse.py b/tests/integration/cost_calculation/cases/bedrock_converse.py index 7e33b700a48..0b7e7df34a3 100644 --- a/tests/integration/cost_calculation/cases/bedrock_converse.py +++ b/tests/integration/cost_calculation/cases/bedrock_converse.py @@ -16,6 +16,7 @@ from integration.cost_calculation.cost_tracking_case import ( RecountExpected, RecountRates, ) +from integration.cost_calculation.bridge_cost_parity.case import BridgeCostParityTestCase from integration.cost_calculation.stream_parity.case import StreamParityTestCase # anthropic.claude-sonnet-5-v1:0 @@ -5924,7 +5925,70 @@ US_ANTHROPIC_CLAUDE_OPUS_5_5_INPUT_TEXT_ROLLUPS: Final = CostTrackingTestCase( ), ) +US_ANTHROPIC_CLAUDE_SONNET_5_RESPONSES_BRIDGED_JSON: Final = US_ANTHROPIC_CLAUDE_SONNET_5_INPUT_TEXT.model_copy( + update={ + "name": "us.anthropic.claude-sonnet-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +US_ANTHROPIC_CLAUDE_SONNET_5_5_RESPONSES_BRIDGED_JSON: Final = US_ANTHROPIC_CLAUDE_SONNET_5_5_INPUT_TEXT.model_copy( + update={ + "name": "us.anthropic.claude-sonnet-5-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +US_ANTHROPIC_CLAUDE_OPUS_5_RESPONSES_BRIDGED_JSON: Final = US_ANTHROPIC_CLAUDE_OPUS_5_INPUT_TEXT.model_copy( + update={ + "name": "us.anthropic.claude-opus-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +US_ANTHROPIC_CLAUDE_OPUS_5_5_RESPONSES_BRIDGED_JSON: Final = US_ANTHROPIC_CLAUDE_OPUS_5_5_INPUT_TEXT.model_copy( + update={ + "name": "us.anthropic.claude-opus-5-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +US_ANTHROPIC_CLAUDE_HAIKU_5_5_RESPONSES_BRIDGED_JSON: Final = US_ANTHROPIC_CLAUDE_HAIKU_5_5_INPUT_TEXT.model_copy( + update={ + "name": "us.anthropic.claude-haiku-5-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +US_ANTHROPIC_CLAUDE_FABLE_5_RESPONSES_BRIDGED_JSON: Final = US_ANTHROPIC_CLAUDE_FABLE_5_INPUT_TEXT.model_copy( + update={ + "name": "us.anthropic.claude-fable-5-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + +US_ANTHROPIC_CLAUDE_FABLE_5_1_RESPONSES_BRIDGED_JSON: Final = US_ANTHROPIC_CLAUDE_FABLE_5_1_INPUT_TEXT.model_copy( + update={ + "name": "us.anthropic.claude-fable-5-1-responses_bridged_json", + "endpoint": "/v1/responses", + "request": {"model": "$MODEL", "input": "summarize the attached material in one line"}, + } +) + CASES: Final[tuple[CostTrackingTestCase, ...]] = ( + US_ANTHROPIC_CLAUDE_SONNET_5_RESPONSES_BRIDGED_JSON, + US_ANTHROPIC_CLAUDE_SONNET_5_5_RESPONSES_BRIDGED_JSON, + US_ANTHROPIC_CLAUDE_OPUS_5_RESPONSES_BRIDGED_JSON, + US_ANTHROPIC_CLAUDE_OPUS_5_5_RESPONSES_BRIDGED_JSON, + US_ANTHROPIC_CLAUDE_HAIKU_5_5_RESPONSES_BRIDGED_JSON, + US_ANTHROPIC_CLAUDE_FABLE_5_RESPONSES_BRIDGED_JSON, + US_ANTHROPIC_CLAUDE_FABLE_5_1_RESPONSES_BRIDGED_JSON, ANTHROPIC_CLAUDE_SONNET_5_V1_0_INPUT_TEXT, ANTHROPIC_CLAUDE_SONNET_5_V1_0_CACHE_READ, ANTHROPIC_CLAUDE_SONNET_5_V1_0_CACHE_WRITE_5M, @@ -6060,3 +6124,27 @@ PARITY: Final[tuple[StreamParityTestCase, ...]] = ( StreamParityTestCase(plain=US_ANTHROPIC_CLAUDE_FABLE_5_INPUT_TEXT, streamed=US_ANTHROPIC_CLAUDE_FABLE_5_STREAM), StreamParityTestCase(plain=US_ANTHROPIC_CLAUDE_FABLE_5_1_INPUT_TEXT, streamed=US_ANTHROPIC_CLAUDE_FABLE_5_1_STREAM), ) + +BRIDGE_COST_PARITY: Final[tuple[BridgeCostParityTestCase, ...]] = ( + BridgeCostParityTestCase( + native=US_ANTHROPIC_CLAUDE_SONNET_5_INPUT_TEXT, bridged=US_ANTHROPIC_CLAUDE_SONNET_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=US_ANTHROPIC_CLAUDE_SONNET_5_5_INPUT_TEXT, bridged=US_ANTHROPIC_CLAUDE_SONNET_5_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=US_ANTHROPIC_CLAUDE_OPUS_5_INPUT_TEXT, bridged=US_ANTHROPIC_CLAUDE_OPUS_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=US_ANTHROPIC_CLAUDE_OPUS_5_5_INPUT_TEXT, bridged=US_ANTHROPIC_CLAUDE_OPUS_5_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=US_ANTHROPIC_CLAUDE_HAIKU_5_5_INPUT_TEXT, bridged=US_ANTHROPIC_CLAUDE_HAIKU_5_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=US_ANTHROPIC_CLAUDE_FABLE_5_INPUT_TEXT, bridged=US_ANTHROPIC_CLAUDE_FABLE_5_RESPONSES_BRIDGED_JSON + ), + BridgeCostParityTestCase( + native=US_ANTHROPIC_CLAUDE_FABLE_5_1_INPUT_TEXT, bridged=US_ANTHROPIC_CLAUDE_FABLE_5_1_RESPONSES_BRIDGED_JSON + ), +) diff --git a/tests/integration/cost_calculation/catalog.py b/tests/integration/cost_calculation/catalog.py index e83ba186cb2..994a7e56c29 100644 --- a/tests/integration/cost_calculation/catalog.py +++ b/tests/integration/cost_calculation/catalog.py @@ -51,7 +51,10 @@ PARITY_CASES: Final[tuple[StreamParityTestCase, ...]] = tuple( ) BATCH_CASES: Final[tuple[BatchCostCase, ...]] = batch_realtime.BATCH_CASES REALTIME_CASES: Final[tuple[RealtimeCostCase, ...]] = batch_realtime.REALTIME_CASES -BRIDGE_COST_PARITY_CASES: Final[tuple[BridgeCostParityTestCase, ...]] = openai.BRIDGE_COST_PARITY +BRIDGE_COST_PARITY_CASES: Final[tuple[BridgeCostParityTestCase, ...]] = ( + *openai.BRIDGE_COST_PARITY, + *bedrock_converse.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) )