karthink / gptel

A simple LLM client for Emacs
GNU General Public License v3.0
1.14k stars 119 forks source link

Show error message when no connection can be established #26

Closed scheidan closed 1 year ago

scheidan commented 1 year ago

Thanks for the great package!

It would be very helpful if we could see the error messages in cases the connection did not work. For example when using curl we get a helpful hint:

 curl https://api.openai.com/v1/chat/completions \                                                    (base)
                                     -H "Content-Type: application/json" \
                                     -H "Authorization: Bearer sk-K6F..." \
                                     -d '{
                                 "model": "gpt-3.5-turbo",
                                 "messages": [{"role": "user", "content": "Say this is a test!"}],
                                 "temperature": 0.7
                                 }'

leads to:

{
    "error": {
        "message": "You exceeded your current quota, please check your plan and billing details.",
        "type": "insufficient_quota",
        "param": null,
        "code": null
    }
}

Currently in Emacs it only shows *ChatGPT* Response Error: finished.

karthink commented 1 year ago

I just addressed this in #10 a couple of days ago. Just checking, are you on the latest commit?

scheidan commented 1 year ago

Sorry for the noise! I made a mess with updating. Works fine now :)