julep icon indicating copy to clipboard operation
julep copied to clipboard

Fix error handling and logging when calling OpenAI APIs

Open alt-glitch opened this issue 1 year ago • 0 comments
trafficstars

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}}

alt-glitch avatar Apr 26 '24 09:04 alt-glitch