brave-browser icon indicating copy to clipboard operation
brave-browser copied to clipboard

[BYOM]: Display error messages in the UI (for OpenAI and more in general)

Open LorenzoMinto opened this issue 1 year ago • 1 comments

Description

If a request fails we currently show a standardized message and it's not easy for the user to understand the issue, i.e. missing credits in API.

Steps to reproduce

  1. Connect OpenAI API to Leo
  2. Put faulty key
  3. Make request

Actual result

General error message

Expected result

Error message with explanation

Channel information

  • [ ] release (stable)
  • [ ] beta
  • [X] nightly

LorenzoMinto avatar Jul 15 '24 16:07 LorenzoMinto

This is the error format:

{
    "error": {
        "message": "The model `gpt-4-turbo-preview` does not exist or you do not have access to it.",
        "type": "invalid_request_error",
        "param": null,
        "code": "model_not_found"
    }
}

petemill avatar Jul 15 '24 16:07 petemill

I was looking into this today for Ollama as well. Ollama uses the same shape, but only fills the response object partially in some cases:

Image

jonathansampson avatar Dec 02 '24 18:12 jonathansampson