Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttestbot[bot] committed Aug 28, 2024
1 parent daac1a3 commit 9877f21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_spice.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def return_wrapped_client(model, provider):
spice._get_client = return_wrapped_client
response = await spice.get_response(messages=[], model=HAIKU, retry_strategy=retry_strategy)

last_message = list(client.calls[-1].messages)[-1].content.text
content = list(client.calls[-1].messages)[-1].content
assert content.type == "text"
last_message = content.text
assert isinstance(last_message, str)
assert "Failed to validate response for the following reason: You fail!" in last_message
assert response.text == "Valid response"
Expand All @@ -106,7 +108,9 @@ def return_wrapped_client(model, provider):
retry_strategy = ConverterStrategy(converter=int, retries=1)
response = await spice.get_response(messages=[], model=HAIKU, retry_strategy=retry_strategy)

last_message = list(client.calls[-1].messages)[-1].content.text
content = list(client.calls[-1].messages)[-1].content
assert content.type == "text"
last_message = content.text
assert isinstance(last_message, str)
assert (
"Failed to convert response for the following reason: invalid literal for int() with base 10: 'Not an int'"
Expand Down

0 comments on commit 9877f21

Please sign in to comment.