-
Notifications
You must be signed in to change notification settings - Fork 163
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
gptel does not work with Emacs 30 pretest (30.0.92) #450
Comments
Can you generate a backtrace? |
@karthink M-x gptel give:
|
This backtrace is unreadable, could you paste it as it appears in the backtrace buffer, inside elisp formatted blocks on github like this:
|
Ok. Sorry Debugger entered--Lisp error: (wrong-type-argument bufferp nil)
buffer-local-value(gptel-mode nil)
#f(compiled-function (b) #<bytecode 0x8be6261920f913b>)((" *temp*"))
#f(compiled-function (name) #<bytecode -0x18cc9977fe730f87>)(" *temp*")
#f(compiled-function (elt) #<bytecode 0x14d5c72df59cb1d3>)(" *temp*")
seq-map(#f(compiled-function (elt) #<bytecode 0x14d5c72df59cb1d3>) (" *Minibuf-1*" "*scratch*" " *Minibuf-0*" "*Messages*" " *Echo Area 0*" " *Echo Area 1*" " *code-conversion-work*" " *temp*" "*Backtrace*" "*Completions*" "*GNU Emacs*"))
seq-filter(#f(compiled-function (name) #<bytecode -0x18cc9977fe730f87>) (" *Minibuf-1*" "*scratch*" " *Minibuf-0*" "*Messages*" " *Echo Area 0*" " *Echo Area 1*" " *code-conversion-work*" " *temp*" "*Backtrace*" "*Completions*" "*GNU Emacs*"))
ido-make-buffer-list("*Claude*")
#f(compiled-function (item prompt hist &optional default require-match initial) "Perform the `ido-read-buffer' and `ido-read-file-name' functions.\nReturn the name of a buffer or file selected.\nPROMPT is the prompt to give to the user.\nDEFAULT if given is the default item to start with.\nIf REQUIRE-MATCH is non-nil, an existing file must be selected.\nIf INITIAL is non-nil, it specifies the initial input string." #<bytecode 0xbaa6c0b33e2aecf>)(buffer "Create or choose gptel buffer: " ido-buffer-history "*Claude*" nil nil)
ad-Advice-ido-read-internal(#f(compiled-function (item prompt hist &optional default require-match initial) "Perform the `ido-read-buffer' and `ido-read-file-name' functions.\nReturn the name of a buffer or file selected.\nPROMPT is the prompt to give to the user.\nDEFAULT if given is the default item to start with.\nIf REQUIRE-MATCH is non-nil, an existing file must be selected.\nIf INITIAL is non-nil, it specifies the initial input string." #<bytecode 0xbaa6c0b33e2aecf>) buffer "Create or choose gptel buffer: " ido-buffer-history "*Claude*" nil)
apply(ad-Advice-ido-read-internal #f(compiled-function (item prompt hist &optional default require-match initial) "Perform the `ido-read-buffer' and `ido-read-file-name' functions.\nReturn the name of a buffer or file selected.\nPROMPT is the prompt to give to the user.\nDEFAULT if given is the default item to start with.\nIf REQUIRE-MATCH is non-nil, an existing file must be selected.\nIf INITIAL is non-nil, it specifies the initial input string." #<bytecode 0xbaa6c0b33e2aecf>) (buffer "Create or choose gptel buffer: " ido-buffer-history "*Claude*" nil))
ido-read-internal(buffer "Create or choose gptel buffer: " ido-buffer-history "*Claude*" nil)
ido-read-buffer("Create or choose gptel buffer: " "*Claude*" nil #f(compiled-function (b) #<bytecode 0x8be6261920f913b>))
apply(ido-read-buffer ("Create or choose gptel buffer: " "*Claude*" nil #f(compiled-function (b) #<bytecode 0x8be6261920f913b>)))
#f(advice ido-read-buffer :override persp-read-buffer)("Create or choose gptel buffer: " "*Claude*" nil #f(compiled-function (b) #<bytecode 0x8be6261920f913b>))
read-buffer("Create or choose gptel buffer: " "*Claude*" nil #f(compiled-function (b) #<bytecode 0x8be6261920f913b>))
byte-code("\302\303!\304\305\306\3!\10>\204\24\0\307\310\303\5D\"\210\2\311H\"\312\313\2\314\315$\3161;\0\317\306\4!\10>\2043\0\307\310\303\6\6D\"\210\3\320H!0\202D\0\210\321\304\322\4\"!\211\21\323 \205N\0\324 \325 {\326F\207" [cl-struct-gptel-backend-tags gptel-api-key default-value gptel-backend format "*%s*" type-of signal wrong-type-argument 1 read-buffer "Create or choose gptel buffer: " nil #f(compiled-function (b) #<bytecode 0x8be6261920f913b>) (error user-error) gptel--get-api-key 7 read-passwd "%s API key: " use-region-p region-beginning region-end t] 8)
call-interactively(gptel record nil)
command-execute(gptel record)
#f(compiled-function (prefixarg &optional command-name typed) "Read a command name, then read the arguments and call the command.\nTo pass a prefix argument to the command you are\ninvoking, give a prefix argument to `execute-extended-command'.\n\nThis command provides completion when reading the command name.\nWhich completion candidates are shown can be controlled by\ncustomizing `read-extended-command-predicate'." (interactive #f(compiled-function () #<bytecode -0x1f3e06e9f415fca5>)) #<bytecode 0xa5781218b81f91d>)(nil "gptel" "gptel")
ad-Advice-execute-extended-command(#f(compiled-function (prefixarg &optional command-name typed) "Read a command name, then read the arguments and call the command.\nTo pass a prefix argument to the command you are\ninvoking, give a prefix argument to `execute-extended-command'.\n\nThis command provides completion when reading the command name.\nWhich completion candidates are shown can be controlled by\ncustomizing `read-extended-command-predicate'." (interactive #f(compiled-function () #<bytecode -0x1f3e06e9f415fca5>)) #<bytecode 0xa5781218b81f91d>) nil "gptel" "gptel")
apply(ad-Advice-execute-extended-command #f(compiled-function (prefixarg &optional command-name typed) "Read a command name, then read the arguments and call the command.\nTo pass a prefix argument to the command you are\ninvoking, give a prefix argument to `execute-extended-command'.\n\nThis command provides completion when reading the command name.\nWhich completion candidates are shown can be controlled by\ncustomizing `read-extended-command-predicate'." (interactive #f(compiled-function () #<bytecode -0x1f3e06e9f415fca5>)) #<bytecode 0xa5781218b81f91d>) (nil "gptel" "gptel"))
execute-extended-command(nil "gptel" "gptel")
funcall-interactively(execute-extended-command nil "gptel" "gptel")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command) |
Thanks, that's much easier to read. Appears to be some issue with You also mentioned an error with using |
Bingo. Disabling ido-mode it works! (but ido-mode is really used a lot ... strange that no one had this problem before) regarding the other problem ... does not give a backtrace ... only the error: "Claude error: (HTTP/2 400) The request body EDIT: even using the dedicated window obtained with M-x gptel ... I get the above error trying to query anything. EDIT2: My configuration is: (setq |
Please generate a log and paste it here. Run |
Here is it is: { |
Hmm, that log looks fine, I'm not sure what's causing the issue. Could you run |
did and got a very similar log message: { { |
Did you already have gptel installed when you upgraded from Emacs 29 to 30? Or is it a fresh install? |
Fresh install. I already had upgraded to 30 way before installing gptel and had all packages byte compiled to 30. |
@karthink any clue about this ? anything I can try ? No matter what I try I always get "The request body is not valid JSON: Input is a zero-length, empty document: line 1 column 1 (char 0)" from Claude. |
I don't know what's causing the issue, sorry. I don't have access to Emacs 30 (yet), or MacOS or Curl 8.7.1 to test this. Perhaps someone else experiencing a similar problem can provide some insight. I'm also not able to reproduce the issue with I have one question about the encoding: what is the value of the variable |
(utf-8-unix . utf-8-unix) |
That looks fine. Without the ability to reproduce these errors, I'm afraid I'm out of debugging ideas for now. |
* gptel.el (gptel): Check that items passed to the predicate in `read-buffer' when spawning a `gptel' buffer are buffer names.
I think I fixed the ido error, you can try it now. Still no idea about the encoding error. |
@karthink sorry. only now could try it. |
Hi! { I get this error (changed my api key with xxxxxxxxx) gptel-curl--get-args: Args out of range: #s(gptel-anthropic "Claude" "api.anthropic.com" #[0 "� ������B�B�" [gptel--get-api-key "x-api-key" (("anthropic-version" . "2023-06-01") ("anthropic-beta" . "pdfs-2024-09-25") ("anthropic-beta" . "prompt-caching-2024-07-31"))] 3] "https" t "/v1/messages" "sk-ant-apixxxxxxxxxxxxxxxxxxxxxxx |
Run your gptel configuration again. |
You can type in any name you want for the gptel buffer, OR just press |
I'm sorry ... but how do I do that ? |
pressing enter gives me: "Empty string for buffer name is not allowed" It advances and "works" if I write "Claude" - but then I get the last error above |
> Run your gptel configuration again.
I'm sorry ... but how do I do that ?
The simplest way is to restart Emacs.
OR
Select your gptel configuration in your init.el and run M-x eval-region
|
ok .. did that ... unfortunately I return to having the "The request body is not valid JSON: Input is a zero-length, empty document: line 1 column 1 (char 0)" |
I can't reproduce this with |
But I tried disabling flex-ido and leaving only bare bones ido and get the same result |
@karthink tried again today after upgrading gptel and worked! (got for the first time an answer from Claude instead of the error. Regarding IDO mode .. I keep having the same problem .. I get: I cannot select Claude (like I can if I remove ido) and the completions says "0 possible completions" Maybe we can close this issue ? because now gptel seems to work with 30 pretest ... the remaining issue is with ido mode |
Please update gptel first -- errors are often fixed by the time they're reported.
Bug Description
M-x gptel gives:
Wrong type argument: bufferp, nil
M-X gptel-send gives:
Querying Claude...
Claude error: (HTTP/2 400) The request body is not valid JSON: unexpected character: line 1 column 1 (char 0)
Backend
Anthropic
Steps to Reproduce
run M-x gptel
read: "Wrong type argument: bufferp, nil" in minibuffer
Select text
run M-X gptel-send
read on minibuffer:
Querying Claude...
Claude error: (HTTP/2 400) The request body is not valid JSON: unexpected character: line 1 column 1 (char 0)
Additional Context
gptel: 20241029.205 (installed from melpa)
Emacs Version: 30.0.92
OS: macOS 13.7.1
curl: curl 8.7.1
Backtrace
No response
Log Information
No response
The text was updated successfully, but these errors were encountered: