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

Improve error field when OpenAI health check fails #101

Open
sd2k opened this issue Oct 16, 2023 · 0 comments
Open

Improve error field when OpenAI health check fails #101

sd2k opened this issue Oct 16, 2023 · 0 comments

Comments

@sd2k
Copy link
Contributor

sd2k commented Oct 16, 2023

The error field of the OpenAI health check is currently a stringified Go error, which is tricky for the frontend to parse. It would be nicer for the frontend if we returned something better, such as the actual response body as an any type. This could even appear in a separate nullable field, in case there is no response body (e.g. if the HTTP request failed to send for some reason). The details would then look something like...

{
  "configured": true,
  "ok": false,
  "error": "unexpected status code 401: {<the `response` object below>}",
  "response": {
    "error": {
      "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.",
      "type": "invalid_request_error",
      "param": null,
      "code": null
    }
  }
}
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