Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error handling and logging when calling OpenAI APIs #299

Open
alt-glitch opened this issue Apr 26, 2024 · 0 comments
Open

Fix error handling and logging when calling OpenAI APIs #299

alt-glitch opened this issue Apr 26, 2024 · 0 comments

Comments

@alt-glitch
Copy link
Contributor

Pass on the 400 errors from OpenAI to the user instead of causing a server error and throwing a 500.
For example; the following error caused by invalid tool spec causes a 500.
It should throw a 400 and notify the user instead:

openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid schema for function 'search_forum': 'int' is not valid under any of the given schemas.", 'type': 'invalid_request_error', 'param': None, 'code': None}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant