karthink / gptel

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

No match data because no search succeeded #430

Open Charlescad opened 1 day ago

Charlescad commented 1 day ago

Bug Description

Hello, when i throw gptel-send i receive this error:

Debugger entered--Lisp error: (error "No match data, because no search succeeded")

f(compiled-function (backend info) #<bytecode -0x3b6bfcdf811e44b>)

(nil (:token "d3e321dc4e0079fc4d4bf0d656aaa9c9" :backend #s(gptel-gemini :name "Gemini" :host "generativelanguage.googleapis.com" :header nil :protocol "https" :stream t :endpoint "/v1beta/models" :key "SECRET" :models (gemini-pro gemini-1.5-flash gemini-1.5-pro-latest) :url #f(compiled-function () #<bytecode -0x12021f2cddcb5cce>) :curl-args nil) :parser #f(compiled-function (backend info) #<bytecode -0x3b6bfcdf811e44b>) :callback gptel-curl--stream-insert-response :transformer nil :data (:contents [( :role "user" :parts [(:text "You are a large language model living in Emacs and...") (:text "my test")])] :safetySettings [(:category "HARM_CATEGORY_HARASSMENT" :threshold "BLOCK_NONE") (:category "HARM_CATEGORY_SEXUALLY_EXPLICIT" :threshold "BLOCK_NONE") (:category "HARM_CATEGORY_DANGEROUS_CONTENT" :threshold "BLOCK_NONE") (:category "HARM_CATEGORY_HATE_SPEECH" :threshold "BLOCK_NONE")] :generationConfig (:temperature 1.0)) :buffer #<buffer Gemini> :position #<marker at 8 in Gemini> :http-status "200" :status "HTTP/1.1 200 Connection established"))

gptel-curl--stream-filter(# "(d3e321dc4e0079fc4d4bf0d656aaa9c9 . 125)")

I installed it via

Backend

None

Steps to Reproduce

  1. Install package-install gpt-el

  2. Setup with gemini (gptel-make-gemini "Gemini" :key "YOUR_GEMINI_API_KEY" :stream t) (setq gptel-model 'gemini-pro gptel-backend (gptel-make-gemini "Gemini" :key "YOUR_GEMINI_API_KEY" :stream t))

  3. write "my test"

  4. gptel-send

Additional Context

Emacs 28.2 installed on windows via msys2 curl on msys2

Log Information

No response

Backtrace

Debugger entered--Lisp error: (error "No match data, because no search succeeded")
#f(compiled-function (backend info) #<bytecode -0x3b6bfcdf811e44b>)
(nil (:token "d3e321dc4e0079fc4d4bf0d656aaa9c9"
         :backend #s(gptel-gemini
             :name "Gemini"
             :host "generativelanguage.googleapis.com"
             :header nil
             :protocol "https"
             :stream t
             :endpoint "/v1beta/models"
             :key "SECRET"
             :models (gemini-pro gemini-1\.5-flash gemini-1\.5-pro-latest)
             :url #f(compiled-function () #<bytecode -0x12021f2cddcb5cce>)
             :curl-args nil)
         :parser #f(compiled-function (backend info) #<bytecode -0x3b6bfcdf811e44b>)
         :callback gptel-curl--stream-insert-response
         :transformer nil
         :data (:contents [(
                :role "user"
                      :parts [(:text "You are a large language model living in Emacs and...") (:text "my test")])]
                  :safetySettings [(:category "HARM_CATEGORY_HARASSMENT" :threshold "BLOCK_NONE")
                           (:category "HARM_CATEGORY_SEXUALLY_EXPLICIT" :threshold "BLOCK_NONE")
                           (:category "HARM_CATEGORY_DANGEROUS_CONTENT" :threshold "BLOCK_NONE")
                           (:category "HARM_CATEGORY_HATE_SPEECH" :threshold "BLOCK_NONE")]
                  :generationConfig (:temperature 1.0))
         :buffer #<buffer *Gemini*>
         :position #<marker at 8 in *Gemini*>
         :http-status "200"
         :status "HTTP/1.1 200 Connection established"))

gptel-curl--stream-filter(#<process gptel-curl> "(d3e321dc4e0079fc4d4bf0d656aaa9c9 . 125)")
karthink commented 1 day ago

It will help to look at the response. Can you log it and add it here?

Charlescad commented 11 hours ago

I lcopy / pasted there what I receive in Message, is it what you meant?

Send your query with C-c RET! Querying Gemini... error in process filter: string-trim: Wrong type argument: stringp, nil error in process filter: Wrong type argument: stringp, nil

karthink commented 8 hours ago

No, I meant:

  1. Turn on logging with (setq gptel-log-level 'info)
  2. Use gptel and produce this error
  3. Check the *gptel-log* buffer
  4. Remove your API key from the log, if it's present, and paste the result here