You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can see the more complete code, i think is in python:
try:
#Make your OpenAI API request here
response = openai.Completion.create(model="text-davinci-003",
prompt="Hello world")
except openai.error.Timeout as e:
#Handle timeout error, e.g. retry or log
print(f"OpenAI API request timed out: {e}")
pass
except openai.error.APIError as e:
#Handle API error, e.g. retry or log
print(f"OpenAI API returned an API Error: {e}")
pass
except openai.error.APIConnectionError as e:
#Handle connection error, e.g. check network or log
print(f"OpenAI API request failed to connect: {e}")
pass
except openai.error.InvalidRequestError as e:
#Handle invalid request error, e.g. validate parameters or log
print(f"OpenAI API request was invalid: {e}")
pass
except openai.error.AuthenticationError as e:
#Handle authentication error, e.g. check credentials or log
print(f"OpenAI API request was not authorized: {e}")
pass
except openai.error.PermissionError as e:
#Handle permission error, e.g. check scope or log
print(f"OpenAI API request was not permitted: {e}")
pass
except openai.error.RateLimitError as e:
#Handle rate limit error, e.g. wait or log
print(f"OpenAI API request exceeded rate limit: {e}")
pass
So is there any similar to ollama.js....im interested in giving feedback to the Chatbot user, set some Timeout to cancel a request if timeout exceeds, and giving some suggestions ( ex: Ratelimit error user passed their limits, wait some time or pay for more limits, connectionError perhpaps internet connection is not right or disabled....)
Thanks in advance
The text was updated successfully, but these errors were encountered:
Hi reading docs from openai i can find a quite complete error handling:
https://help.openai.com/en/articles/6897213-openai-library-error-types-guidance
You can see the more complete code, i think is in python:
So is there any similar to ollama.js....im interested in giving feedback to the Chatbot user, set some Timeout to cancel a request if timeout exceeds, and giving some suggestions ( ex: Ratelimit error user passed their limits, wait some time or pay for more limits, connectionError perhpaps internet connection is not right or disabled....)
Thanks in advance
The text was updated successfully, but these errors were encountered: