Git Product home page Git Product logo

Comments (18)

karthink avatar karthink commented on May 24, 2024

Hi Jon,

I renamed some functions recently to appease the byte-compiler and linter. Could you try uninstalling (package-delete) and reinstalling (package-install-file on the directory) this package and running a fresh Emacs session? Or equivalent if you're using Straight/Elpaca/some other package manager or loading files manually.

from gptel.

JonatanSahar avatar JonatanSahar commented on May 24, 2024

Hi,
I did a straight-pull-package, I hope that's equivalent.. I'm on doom so
that's usually abstracted away for me :)
Now I get the following error on startup:

Debugger entered--Lisp error: (no-catch emacs-version-changed nil)
throw(emacs-version-changed nil)
(if (equal (emacs-version) "GNU Emacs 28.1.90 (build 2,
x86_64-w64-mingw32)\n o...") nil (throw 'emacs-version-changed nil))
(unless (equal (emacs-version) "GNU Emacs 28.1.90 (build 2,
x86_64-w64-mingw32)\n o...") (throw 'emacs-version-changed nil))
eval((unless (equal (emacs-version) "GNU Emacs 28.1.90 (build 2,
x86_64-w64-mingw32)\n o...") (throw 'emacs-version-changed nil)))
byte-code("\300\301\302\303\304E\305BB!\207" [eval unless equal
(emacs-version) "GNU Emacs 28.1.90 (build 2, x86_64-w64-mingw32)\n o..."
((throw 'emacs-version-changed nil))] 5)
(straight-use-package '(gptel :host github :repo "karthink/gptel"))
load-with-code-conversion("c:/Users/Jonathan/.doom.d/config.el"
"c:/Users/Jonathan/.doom.d/config.el" nil t)
load("/.doom.d/config" nil nomessage)
(condition-case e (load path noerror 'nomessage) ((debug doom-error)
(signal (car e) (cdr e))) ((debug error) (setq path (locate-file path
load-path (get-load-suffixes))) (signal (cond ((not (and path (featurep
...))) 'error) ((file-in-directory-p path (expand-file-name "cli"
doom-core-dir)) 'doom-cli-error) ((file-in-directory-p path doom-core-dir)
'doom-core-error) ((file-in-directory-p path doom-user-dir)
'doom-user-error) ((file-in-directory-p path doom-profile-dir)
'doom-profile-error) ((file-in-directory-p path doom-modules-dir)
'doom-module-error) ('doom-error)) (list path e))))
doom-load("
/.doom.d/config")

from gptel.

karthink avatar karthink commented on May 24, 2024

I'm not sure how you're expected to update packages when using Doom, but I'm guessing straight-pull-all is not the way? It will probably break stuff.

from gptel.

schmudde avatar schmudde commented on May 24, 2024

Thanks for your work on this. I have the exact same problem.

I tried quitting Emacs and re-installing. I'm managing the package manually as described in your README:

(add-to-list 'load-path "/path/to/gptel/")
(require 'gptel)

When running Emacs again, I still had the same error. That's when I set M-x customize-groupGptel Use Curl: off and now I'm able to use the package.

I'm on PopOS and running Emacs in the Terminal. Let me know what else I can do to help debug.

from gptel.

JonatanSahar avatar JonatanSahar commented on May 24, 2024

from gptel.

karthink avatar karthink commented on May 24, 2024

I'm on PopOS and running Emacs in the Terminal. Let me know what else I can do to help debug.

Could you run (setq gptel--debug t) and try using it with Curl? The HTTP response from ChatGPT should pop up in a buffer. If it doesn't that's helpful too. There are multiple silent-failure bugs (possibly related) that I'm trying to reproduce here.

from gptel.

karthink avatar karthink commented on May 24, 2024

@JonatanSahar Is curl + gptel still a problem for you?

from gptel.

JonatanSahar avatar JonatanSahar commented on May 24, 2024

from gptel.

karthink avatar karthink commented on May 24, 2024

@JonatanSahar Is this still an issue?

from gptel.

JonatanSahar avatar JonatanSahar commented on May 24, 2024

from gptel.

JonatanSahar avatar JonatanSahar commented on May 24, 2024

from gptel.

schmudde avatar schmudde commented on May 24, 2024

I'm on PopOS and running Emacs in the Terminal. Let me know what else I can do to help debug.

Could you run (setq gptel--debug t) and try using it with Curl? The HTTP response from ChatGPT should pop up in a buffer. If it doesn't that's helpful too. There are multiple silent-failure bugs (possibly related) that I'm trying to reproduce here.

I removed my custom install and switched to the MELPA package (GPTEL 0.3.6) using package-list-package. I'm using the same Emacs/Pop_OS as I wrote the last time (GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2022-01-24, modified by Debian) and it doesn't work. So - per your suggestion - I ran (setq gptel--debug t) and got this response:

HTTP/1.1 400 Bad Request
Date: Mon, 19 Jun 2023 19:23:36 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 167
Connection: keep-alive
vary: Origin
x-request-id: 3bd93220eb6f16ba4f081a0798b27431
strict-transport-security: max-age=15724800; includeSubDomains
CF-Cache-Status: DYNAMIC
Server: cloudflare
CF-RAY: 7d9e25c08b4f3755-MXP
alt-svc: h3=":443"; ma=86400

{
    "error": {
        "message": "you must provide a model parameter",
        "type": "invalid_request_error",
        "param": null,
        "code": null
    }
}

I'm running vanilla Emacs, but perhaps the compile log will lend some insights into what is special about the system:

Leaving directory ‘/home/schmudde/.emacs.d/elpa/gptel-0.3.6’

Compiling file /home/schmudde/.emacs.d/elpa/gptel-0.3.6/gptel-curl.el at Mon Jun 19 21:17:01 2023
Entering directory ‘/home/schmudde/.emacs.d/elpa/gptel-0.3.6/’

In gptel-curl--get-args:
gptel-curl.el:53:46:Warning: ‘token’ is an obsolete variable (as of 25.1); use
    'token instead

In gptel-curl-get-response:
gptel-curl.el:78:63:Warning: ‘token’ is an obsolete variable (as of 25.1); use
    'token instead
gptel-curl.el:84:33:Warning: ‘token’ is an obsolete variable (as of 25.1); use
    'token instead

In gptel-abort:
gptel-curl.el:109:56:Warning: ‘buf’ is an obsolete variable (as of 25.1); use
    'buf instead
gptel-curl.el:117:30:Warning: ‘buf’ is an obsolete variable (as of 25.1); use
    'buf instead
gptel-curl.el:120:72:Warning: ‘buf’ is an obsolete variable (as of 25.1); use
    'buf instead
gptel-curl.el:120:72:Warning: ‘buf’ is an obsolete variable (as of 25.1); use
    'buf instead
gptel-curl.el:123:1:Warning: Unused lexical argument ‘status’
gptel-curl.el:175:1:Warning: Unused lexical variable ‘status-str’
gptel-curl.el:203:1:Warning: Unused lexical variable ‘content-str’
gptel-curl.el:203:1:Warning: Unused lexical variable ‘response’
gptel-curl.el:262:1:Warning: Unused lexical argument ‘status’

In gptel-curl--parse-response:
gptel-curl.el:287:24:Warning: ‘buf’ is an obsolete variable (as of 25.1); use
    'buf instead
gptel-curl.el:290:24:Warning: ‘token’ is an obsolete variable (as of 25.1);
    use 'token instead

Compiling file /home/schmudde/.emacs.d/elpa/gptel-0.3.6/gptel-transient.el at Mon Jun 19 21:17:01 2023
gptel-transient.el:89:72:Warning: ‘buf’ is an obsolete variable (as of 25.1);
    use 'buf instead
gptel-transient.el:90:52:Warning: ‘buf’ is an obsolete variable (as of 25.1);
    use 'buf instead

Compiling file /home/schmudde/.emacs.d/elpa/gptel-0.3.6/gptel.el at Mon Jun 19 21:17:02 2023
gptel.el:69:1:Warning: defgroup for ‘gptel’ fails to specify containing group

In gptel--stream-convert-markdown->org:
gptel.el:718:50:Error: missing value for ‘in-src-block’ at end of setq

from gptel.

PalaceChan avatar PalaceChan commented on May 24, 2024

(it might be helpful for gptel--debug t to also show the curl command that is being used so that it's easier to troubleshoot the command in the shell directly? e.g. I've added a small print before here to show the curl command that is being sent vs only the response + headers -- maybe surrounding that with (when gptel--debug... could be useful?)

from gptel.

pmontrasio avatar pmontrasio commented on May 24, 2024

I'm also stuck with you must provide a model parameter

My elisp is very rusty. I put a

    (message "curl %s" args)

on the line before

    (with-current-buffer (process-buffer process)

but it does not log anything into *Messages*.

I'm using version 20230623.2344 from Melpa after the version from March stopped working yesterday. I didn't investigate the reason, I assumed that the API changed (I saw an announcement of new models.) Maybe it changed beyond the reach of the June version too.

from gptel.

karthink avatar karthink commented on May 24, 2024

@pmontrasio Could you try with with the latest version after running (setq gptel--debug t)?

from gptel.

pmontrasio avatar pmontrasio commented on May 24, 2024

I installed from melpa with M-x package-list-packages and the install button

Warning (bytecomp): reference to free variable ‘mc/cmds-to-run-for-all’
Warning (bytecomp): reference to free variable ‘mc/cmds-to-run-once’
Warning (bytecomp): reference to free variable ‘mc--default-cmds-to-run-for-all’
Warning (bytecomp): reference to free variable ‘mc--default-cmds-to-run-once’
Leaving directory ‘/home/me/.emacs.d/elpa/gptel-20230721.433’

Compiling file /home/me/.emacs.d/elpa/gptel-20230721.433/gptel-curl.el at Fri Jul 21 12:05:27 2023
Entering directory ‘/home/me/.emacs.d/elpa/gptel-20230721.433/’

Compiling file /home/me/.emacs.d/elpa/gptel-20230721.433/gptel-transient.el at Fri Jul 21 12:05:27 2023

Compiling file /home/me/.emacs.d/elpa/gptel-20230721.433/gptel.el at Fri Jul 21 12:05:27 2023

In gptel--stream-convert-markdown->org:
gptel.el:872:50:Error: missing value for ‘in-src-block’ at end of setq

Then (setq gptel--debug t) in *scratch*

Then M-x gptel

I sent Hi and got

HTTP/2 400 
date: Fri, 21 Jul 2023 10:07:13 GMT
content-type: application/json; charset=utf-8
content-length: 167
vary: Origin
x-request-id: 86954ccda2298e8603fb1be855f497c1
strict-transport-security: max-age=15724800; includeSubDomains
cf-cache-status: DYNAMIC
server: cloudflare
cf-ray: 7ea2a2b95f7a0e1d-MXP
alt-svc: h3=":443"; ma=86400

{
    "error": {
        "message": "you must provide a model parameter",
        "type": "invalid_request_error",
        "param": null,
        "code": null
    }
}
(8aa2385e00ebb7c86714e7022a2f6df1 . 352)

I made other attempts with several combinations of the setq command, closing the ChatGPT buffer, opening it. Always the same outcome.

from gptel.

karthink avatar karthink commented on May 24, 2024

Is this error still present in the latest version of gptel?

from gptel.

karthink avatar karthink commented on May 24, 2024

I am closing this now since gptel has changed significantly in the past few months. Feel free to re-open if the error still persists.

from gptel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.