-
Notifications
You must be signed in to change notification settings - Fork 150
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
getting empty response from openai backend; response not empty #260
Comments
@mmwilbert I removed your API key from the log. It looks like it was visible for a few hours though, so please disable it and regenerate a new one. This sounds like an installation problem. Before trying any other troubleshooting on the system with the problem, could you delete the gptel package and install from the latest commit? |
Thanks for removing the API key! OpenAI had notified me and disabled the key earlier, so it should all be good. I should have realized that I needed to scrub the log. I tried this before, but I just removed the gptel package, checked to make sure it was gone, exited emacs, restarted emacs, reinstalled gptel, and tried it again, and I still have the same issue. |
Thanks for the thorough testing there. My understanding is that the issue is on the machine with Win 11 + WSL, is that correct? I don't know what could be causing it, but in the meantime you could try a couple of workarounds on that machine: disable streaming If either of these work please let me know, it will help me narrow down the possibilities. |
If I set either gptel-stream to nil, or gptel-use-curl to nil, the request never completes in the buffer; the state remains "Waiting".
(I mentioned this in my comment on issue #251) The gptel-log looks like this:
|
I'd like to confirm the exact same problems and behavior as op reported. Tested with gptel 0.7 and then 0.8 built from master with straight. On Mac works out of the box with Emacs 29.2 both in GUI and Terminal sessions. On Linux: With curl:
I get the exact same behavior as described on both: Log shows responses being streamed just fine, but ChatGPT buffer reports empty response. With streaming disabled some post-processing function throws With curl disabled I'me getting failed to establish connection to api.openai.com - I'm guessing because built in TLS lib is deprecated, so I'm guessing built in |
FWI out of curiosity I executed the same request on my (gptel works) Mac and (gptel empty response) Linux and ran With streaming disabled, |
So with streaming disabled I believe the macro you want is something like this, then it works: (defmacro gptel--json-read ()
(if (fboundp 'json-parse-buffer)
`(json-parse-buffer
:object-type 'plist
:null-object nil
:false-object :json-false)
`(progn
(require 'json)
(defvar json-object-type)
(declare-function json-read "json" ())
(let ((json-object-type 'plist))
(json-read))))) Or something to that effect, but definitely you want that |
oh lol, that also solves the streaming issue :) |
on Linux to work without curl, probably want to do either:
|
Yikes! There is a glaring typo in Thanks for catching this. Please reopen this issue if the problem persists. |
This is very similar to #253, but it's happening with the GPT backend.
What I see in the interface is "Empty Response". This happens in Gnu Emacs 29.2 with the only lines in the init.el file being
Note that I don't see this on all my emacs installations. On a different machine with 29.1 it works fine. But I installed 29.1 on
this machine and I still get empty response. Both machines are running Ubuntu 22.04.3 LTS. The difference is that the one that works is running on a "normal" VM, and the other one is running in WSL on Windows 11. I don't know why this would affect anything,
but apparently it does.
Here's the whole log:
The text was updated successfully, but these errors were encountered: