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
Describe the bug
If the OPEN_AI_API Key is wrong or invalid, the chatapi/v1/got endpoint returns http code 200, but the "answer" is empty.
The DEBUG logs will show an error:
2024-05-15 21:50:32,910 DEBUG openai._base_client Thread-1 (process_request_thread) : HTTP Request: POST https://api.openai.com/v1/chat/completions "401 Unauthorized"
2024-05-15 21:50:32,911 INFO backoff Thread-1 (process_request_thread) : Backing off chat(...) for 0.7s (openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: 03********************5e. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}})
But this error is not being relayed by the chatapi/v1/got endpoint. The Frontend needs this information to display a helpful message to users.
To Reproduce
Steps to reproduce the behavior:
Set an invalid OPENAI_API_KEY in the .env file
Launch the backend server: docker compose up execgpt
Call the POST chatapi/v1/got endpoint with a body similar to:
{
"chatInput": "what genes are associated with Droperidol?"
}
The response comes back with an empty "answer" key and the DEBUG log shows the error above
Expected behavior
This endpoint needs to relay messages from calls to the OpenAI API.
The text was updated successfully, but these errors were encountered:
Describe the bug
If the OPEN_AI_API Key is wrong or invalid, the
chatapi/v1/got
endpoint returns http code 200, but the "answer" is empty.The DEBUG logs will show an error:
But this error is not being relayed by the
chatapi/v1/got
endpoint. The Frontend needs this information to display a helpful message to users.To Reproduce
Steps to reproduce the behavior:
docker compose up execgpt
POST chatapi/v1/got
endpoint with a body similar to:The response comes back with an empty "answer" key and the DEBUG log shows the error above
Expected behavior
This endpoint needs to relay messages from calls to the OpenAI API.
The text was updated successfully, but these errors were encountered: