karthink / gptel

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

Issue with `gptel-rewrite-menu` #421

Closed frmsaul closed 1 month ago

frmsaul commented 1 month ago

I'm getting this error

error in process sentinel: Wrong type argument: sequencep, claude-3-5-sonnet-20240620 when trying to rewrite a piece of code.

I have this in my

(setq
 gptel-model 'claude-3-5-sonnet-20240620
 gptel-backend (gptel-make-anthropic "Claude"
                 :stream t :key "sk-ant-..."))

gptel and gptel-add and gptel-send work perfectly.

karthink commented 1 month ago

Can you generate a backtrace? Run M-x toggle-debug-on-error and reproduce the error.

ProjectMoon commented 1 month ago

Same issue here with ollama.

concat("[" "agnosis" ":" aitana:instruct "] " "REWRITE" " READY ✓\n")
(setq hint-str (concat "[" (progn (or (progn (and (memq (type-of gptel-backend) cl-struct-gptel-backend-tags) t)) (signal 'wrong-type-argument (list 'gptel-backend gptel-backend))) (aref gptel-backend 1)) ":" gptel-model "] " (upcase action-str) " READY ✓\n"))

Maybe it's an issue with concatenating the new symbol model names?

karthink commented 1 month ago

Maybe it's an issue with concatenating the new symbol model names?

Yup that was it, thanks for catching it. Should be fixed now.

karthink commented 1 month ago

Please confirm so we can close this.

frmsaul commented 1 month ago

This is what i get when i toggle-debug-on-error

Debugger entered--Lisp error: (wrong-type-argument sequencep claude-3-5-sonnet-20240620)
  #f(compiled-function (response info) #<bytecode 0x147c01ab7ead6c28>)("useEffect(refreshContacts, [refreshContacts]);" (:token "11bc97df47078ef7717d00b0f7051b39" :backend #s(gptel-anthropic :name "Claude" :host "api.anthropic.com" :header #f(compiled-function () #<bytecode -0xe445108c2ef34c8>) :protocol "https" :stream t :endpoint "/v1/messages" :key "MYKEY.." :models (claude-3-5-sonnet-20240620 claude-3-sonnet-20240229 claude-3-haiku-20240307 claude-3-opus-20240229) :url "https://api.anthropic.com/v1/messages" :curl-args nil) :parser #f(compiled-function (backend response info) #<bytecode -0x16f219888cb58d14>) :callback #f(compiled-function (response info) #<bytecode 0x147c01ab7ead6c28>) :transformer nil :data (:model "claude-3-5-sonnet-20240620" :system "You are a typescript programmer. Generate only cod..." :stream :json-false :max_tokens 1024 :messages [(:role "user" :content "useEffect(() => {\n    refreshContacts();\n  }, [ref...")] :temperature 1.0) :buffer #<buffer page.tsx<contacts_v2>> :position #<marker at 773 in page.tsx<contacts_v2>> :context #<overlay from 705 to 773 in page.tsx<contacts_v2>> :status "HTTP/2 200"))
  gptel-curl--sentinel(#<process gptel-curl> "finished\n")
karthink commented 1 month ago

@frmsaul I updated gptel, is this on the latest commit?

ProjectMoon commented 1 month ago

Can confirm it works now after pulling the latest.

frmsaul commented 1 month ago

nice! Works for me now too. thanks. Closing the issue.