karthink / gptel

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

No response/error indicator when executing `gptel` #16

Closed randomwangran closed 1 year ago

randomwangran commented 1 year ago

Execute M-x gptel, it saids Waiting, but no response can received. (setq gptel-api-key "sk-xxxxx") has been executed. Here's a screenshot:

https://user-images.githubusercontent.com/8197831/224576530-a1888203-46a3-4886-970b-f5e7a1511c59.mp4

karthink commented 1 year ago

Hi @randomwangran,

I just added a debug setting to diagnose issues like this. Could you

  1. Pull the latest from this repo and install/load it,

  2. Run (setq gptel--debug t) before running gptel,

  3. Run gptel and wait for a buffer named *gptel-error* response to pop up,

  4. and paste the contents of the buffer here?

If no such buffer pops up, that's helpful too and you can let me know.

jmercouris commented 1 year ago

I ran the code, waited several minutes, and no error buffer popped up.

karthink commented 1 year ago

@jmercouris Thank you. Is the value of gptel-use-curl non-nil for you? (It might look like /usr/bin/curl)

jmercouris commented 1 year ago
gptel-use-curl is a variable defined in ‘gptel.el’.

Its value is t

Whether gptel should prefer Curl when available.

  You can customize this variable.
jmercouris commented 1 year ago

Please note:

[jmercouris@system:~/.emacs.d/packages]$ which curl
/run/current-system/sw/bin/curl

I am running NixOS.

karthink commented 1 year ago

Could you set gptel-use-curl to nil and check if the problem persists?

kulorro commented 1 year ago

The same problem. And set gptel-use-curl in gptel.el to nil couldn't solve the problem.

karthink commented 1 year ago

@ydche3 Could you try again (with gptel--debug set to t)? I removed the aio dependency and made the code simpler to debug in 040baad9.

kulorro commented 1 year ago

@ydche3 Could you try again (with gptel--debug set to t)? I removed the aio dependency and made the code simpler to debug in 040baad.

Without any difference. But I noticed that whenever run C-c RET to send my query, the request wasn't sent behind my proxy. Here is my emacs proxy setting:

(setq url-proxy-services '(("http" . "127.0.0.1:7890")
                           ("https" . "127.0.0.1:7890")))

Should I change my proxy setting? BTW, I've tried an other openai plugin under my proxy setting, and it works.

karthink commented 1 year ago

You shouldn't have to change your proxy settings. Did you notice this with gptel-use-curl set to nil, t or both?

flashjames commented 1 year ago

I have the same problem, it worked first when I tried the mode 4 days ago, but when I tried again today it doesnt return any answers.

I set: "(setq gptel--debug t)"

Where should that info be displayed? (no new buffer with messages with gptel atleast).

When I call the same api end point with javascript and axios, I get answers so it shouldnt be a open ai api problem.

EDIT: Never mind, had to re-read the README - didnt do "M-x gptel-send" this time :)

karthink commented 1 year ago

EDIT: Never mind, had to re-read the README - didnt do "M-x gptel-send" this time :)

Please let me know if the README could be worded better.

flashjames commented 1 year ago

No the readme was clear, it was my bad not re-reading it again.

Thank you for the work on this mode!

EDIT: Maybe could add that you need to do gptel-send here: image

Like ChatGPT ready - Hint: Dont forget to do gptel-send

I expected the second time when I write the question after ### and press enter, it will send the query.

Don't know emacs too well, to know is this is hard to implement.

karthink commented 1 year ago

Like ChatGPT ready - Hint: Dont forget to do gptel-send

The package already does this, I'm not sure what you mean. Here is what I see: 2023-03-24-175832_871x365_scrot

karthink commented 1 year ago

@jmercouris do you still see this error?

jmercouris commented 1 year ago

it works now, i installed via melpa

karthink commented 1 year ago

Like ChatGPT ready - Hint: Dont forget to do gptel-send

@flashjames I'm closing this issue since the original problem has been solved and this hinting is addressed as well. Feel free to reopen if this is not the case.