Skip to content

Commit

Permalink
tests: Raise an exception if the response comes back empty
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamdby committed Mar 18, 2024
1 parent b9103a4 commit 33e39d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_bing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def generate_response() -> str:
)
except:
print("ERROR: Could not create a prompt!")
raise Exception("ERROR: Could not create a prompt!")

return response.choices[0].message.content

Expand Down
1 change: 1 addition & 0 deletions tests/test_freechatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def generate_response() -> str:
)
except:
print("ERROR: Could not create a prompt!")
raise Exception("ERROR: Could not create a prompt!")

return response.choices[0].message.content

Expand Down

0 comments on commit 33e39d2

Please sign in to comment.