karthink / gptel

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

Can't get it to work #5

Closed agzam closed 1 year ago

agzam commented 1 year ago

I'm using latest --head Emacs:

GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin22.3.0, NS appkit-2299.40 Version 13.2.1 (Build 22D68)) of 2023-03-06

And can't figure out why it's not working. The API key is set, gptel opens the buffer, it says "Ready". I would type something and press "C-c RET", and it immediately fails with 'Response Error: nil'.

I'm not sure how to debug aio functions. Edebug doesn't work nicely with them. I'm not sure if it matters (featurep 'gptel-transient) always returns nil for me.

agzam commented 1 year ago

Oh, it looks like maybe it doesn't handle the insufficient_quota error.

karthink commented 1 year ago

Yeah it doesn't handle errors except for when requests fail to be sent, and when the API key is missing. I need to look at what it returns when the quota is insufficient.

If you're up to it, could you find the curl output (from the cli) for this kind of error?

I can provide a sample command a bit later, I'm AFK right now.

On Thu, Mar 9, 2023, 2:45 PM Ag Ibragimov @.***> wrote:

Oh, it looks like maybe it doesn't handle the insufficient_quota error.

— Reply to this email directly, view it on GitHub https://github.com/karthink/gptel/issues/5#issuecomment-1462929822, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBVOLHULX7Z7OJJOMT3G3DW3JMQZANCNFSM6AAAAAAVVWJMDQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

agzam commented 1 year ago

If you're up to it, could you find the curl output (from the cli) for this kind of error?

darn, I knew I needed to save it, and I honestly thought I did. But then I restarted Emacs and it's gone now. :(

But guess what?

image

minad commented 1 year ago

@agzam How quickly did you reach this quota limit? I wonder how much regular usage of ChatGPT costs per month.

agzam commented 1 year ago

How quickly did you reach this quota limit?

I just tried the package without openai paid account. If you don't want to deal with the quota error right now, perhaps adding a note in the readme would be enough.

karthink commented 1 year ago

I'd like to handle this error, actually. I'm pretty sure ChatGPT's output above is wrong. The JSON should have the error field, but the rest of it looks incorrect. If you run into this error again, please evaluate the function from #10 and try again? That should give you the full response from the API.

agzam commented 1 year ago

I'm sorry I didn't save the output. To run into this error again, I have to either cut my credit card and wait for it to fail or I have to register a new account, but I got only one phone number to use. IIRC, it does need a proper phone number.

karthink commented 1 year ago

Oh, please don't bother with any of that! I only meant if you run into this error again, whenever that might be.

karthink commented 1 year ago

If you run into this error again, please set gptel--debug to t and try again. This should produce a buffer with the result of the API request.

karthink commented 1 year ago

Indicating useful errors is now fully implemented in gptel. Feel free to reopen if you get cryptic error messages again.