From ce6fcafd04f761d60e4799e4b6c33984e69225a4 Mon Sep 17 00:00:00 2001 From: Kerry Lu Date: Mon, 12 Oct 2026 20:26:46 -0700 Subject: [PATCH] test(cost): add azure gpt-6 /v1/messages bridge cost parity pairs (#46139) Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../cost_calculation/cases/azure.py | 60 +++++++++++++++++++ tests/integration/cost_calculation/catalog.py | 1 + 2 files changed, 61 insertions(+) diff --git a/tests/integration/cost_calculation/cases/azure.py b/tests/integration/cost_calculation/cases/azure.py index b6d6d0496da..df96d1d9993 100644 --- a/tests/integration/cost_calculation/cases/azure.py +++ b/tests/integration/cost_calculation/cases/azure.py @@ -17,6 +17,7 @@ from integration.cost_calculation.cost_tracking_case import ( SseResponse, WavUpload, ) +from integration.cost_calculation.bridge_cost_parity.case import BridgeCostParityTestCase from integration.cost_calculation.stream_parity.case import StreamParityTestCase, sse_frames @@ -5572,7 +5573,59 @@ AZURE_GPT_6_LUNA_TOOL_CALL: Final = CostTrackingTestCase( ), ) +AZURE_GPT_6_SOL_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_SOL_INPUT_TEXT.model_copy( + update={ + "name": "azure-gpt-6-sol-messages_bridged_json", + "endpoint": "/v1/messages", + "request": { + "model": "$MODEL", + "max_tokens": 412, + "messages": [{"role": "user", "content": "azure chat native fixture"}], + }, + } +) + +AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_LUNA_INPUT_TEXT.model_copy( + update={ + "name": "azure-gpt-6-luna-messages_bridged_json", + "endpoint": "/v1/messages", + "request": { + "model": "$MODEL", + "max_tokens": 412, + "messages": [{"role": "user", "content": "azure chat native fixture"}], + }, + } +) + +AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_ASTRA_INPUT_TEXT.model_copy( + update={ + "name": "azure-gpt-6-astra-messages_bridged_json", + "endpoint": "/v1/messages", + "request": { + "model": "$MODEL", + "max_tokens": 412, + "messages": [{"role": "user", "content": "azure chat native fixture"}], + }, + } +) + +AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_1_SOL_INPUT_TEXT.model_copy( + update={ + "name": "azure-gpt-6.1-sol-messages_bridged_json", + "endpoint": "/v1/messages", + "request": { + "model": "$MODEL", + "max_tokens": 412, + "messages": [{"role": "user", "content": "azure chat native fixture"}], + }, + } +) + CASES: Final[tuple[CostTrackingTestCase, ...]] = ( + AZURE_GPT_6_SOL_MESSAGES_BRIDGED_JSON, + AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON, + AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_JSON, + AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_JSON, AZURE_GPT_5_4_MINI_INPUT_TEXT, AZURE_GPT_5_4_MINI_CACHE_READ, AZURE_GPT_5_4_MINI_AUDIO_INPUT, @@ -5656,3 +5709,10 @@ PARITY: Final[tuple[StreamParityTestCase, ...]] = ( StreamParityTestCase(plain=AZURE_GPT_6_ASTRA_INPUT_TEXT, streamed=AZURE_GPT_6_ASTRA_STREAM), StreamParityTestCase(plain=AZURE_GPT_6_1_SOL_INPUT_TEXT, streamed=AZURE_GPT_6_1_SOL_STREAM), ) + +BRIDGE_COST_PARITY: Final[tuple[BridgeCostParityTestCase, ...]] = ( + BridgeCostParityTestCase(native=AZURE_GPT_6_SOL_INPUT_TEXT, bridged=AZURE_GPT_6_SOL_MESSAGES_BRIDGED_JSON), + BridgeCostParityTestCase(native=AZURE_GPT_6_LUNA_INPUT_TEXT, bridged=AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON), + BridgeCostParityTestCase(native=AZURE_GPT_6_ASTRA_INPUT_TEXT, bridged=AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_JSON), + BridgeCostParityTestCase(native=AZURE_GPT_6_1_SOL_INPUT_TEXT, bridged=AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_JSON), +) diff --git a/tests/integration/cost_calculation/catalog.py b/tests/integration/cost_calculation/catalog.py index 994a7e56c29..9f99d8fb2c1 100644 --- a/tests/integration/cost_calculation/catalog.py +++ b/tests/integration/cost_calculation/catalog.py @@ -54,6 +54,7 @@ REALTIME_CASES: Final[tuple[RealtimeCostCase, ...]] = batch_realtime.REALTIME_CA BRIDGE_COST_PARITY_CASES: Final[tuple[BridgeCostParityTestCase, ...]] = ( *openai.BRIDGE_COST_PARITY, *bedrock_converse.BRIDGE_COST_PARITY, + *azure.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)