togethercomputer / together-python

The Official Python Client for Together's API
https://pypi.org/project/together/
Apache License 2.0
24 stars 5 forks source link

Fixed 500 and 401 errors reporting missing API Key #66

Closed clam004 closed 9 months ago

clam004 commented 9 months ago

Edited 500 and 401 errors to their correct meaning before these response status codes were reporting that the API key was invalid or missing, these are actually server side or auth issues

Issue # ENG-520

Describe your changes

Previously we were reporting to users that requests having 500 or 401 errors were due to a missing or invalid API key, this is wrong, I deduped this portion on code into response_status_exception(response) to give more accurate feedback on the error