test: fix test - handle llm api inconsistency

This commit is contained in:
Krrish Dholakia 2025-03-21 10:51:34 -07:00
parent 6c51bdebe7
commit 47a18285f1

View file

@ -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)}"