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: fix test - handle llm api inconsistency

Krrish Dholakiaa1b716c1efae
diff --git a/tests/llm_translation/base_llm_unit_tests.py b/tests/llm_translation/base_llm_unit_tests.py
index f3614fdb4ce..82a1ef40fb6 100644
--- a/tests/llm_translation/base_llm_unit_tests.py
+++ b/tests/llm_translation/base_llm_unit_tests.py
@@ -1062,6 +1062,7 @@ class BaseAnthropicChatTest(ABC):
**base_completion_call_args, **args, stream=False
)
- assert json.loads(built_response.choices[0].message.content) == json.loads(
- non_stream_response.choices[0].message.content
+ assert (
+ json.loads(built_response.choices[0].message.content).keys()
+ == json.loads(non_stream_response.choices[0].message.content).keys()
), f"Got={json.loads(built_response.choices[0].message.content)}, Expected={json.loads(non_stream_response.choices[0].message.content)}"