Skip to content
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

feature request: additional curl arguments #283

Open
xeechou opened this issue Apr 8, 2024 · 5 comments
Open

feature request: additional curl arguments #283

xeechou opened this issue Apr 8, 2024 · 5 comments

Comments

@xeechou
Copy link

xeechou commented Apr 8, 2024

Hello, great package, however my proxy setup(out of my control) requires curl arguments like -k or --ssl-no-revoske to work. Would you be able to add additional user argument to curl. Thanks.

@xeechou xeechou changed the title (feature request) additional curl arguments feature request: additional curl arguments Apr 8, 2024
@karthink
Copy link
Owner

karthink commented Apr 8, 2024

This is available via the :curl-args slot of a gptel backend definition.

For example:

(gptel-make-openai "ChatGPT-no-ssl-check"
   :key 'gptel-api-key
   :stream t
   :models '("gpt-3.5-turbo" "gpt-3.5-turbo-16k" "gpt-4"
             "gpt-4-turbo-preview" "gpt-4-32k" "gpt-4-1106-preview"
             "gpt-4-0125-preview")
   :curl-args '("--ssl-no-revoke" "-k"))

If you want this globally, you can add it to gptel-curl--common-args instead, which see.

@xeechou
Copy link
Author

xeechou commented Apr 9, 2024

hi thanks. I can't change gptel-curl--common-args though. it's a constant.

@karthink
Copy link
Owner

karthink commented Apr 9, 2024 via email

@karthink
Copy link
Owner

karthink commented Apr 9, 2024

On second thought I don't want to make gptel-curl--common-args customizable, since removing things from it will break gptel. I suggest adding :curl-args to the gptel backend you want to use.

For ChatGPT in particular, you can use the code I provided above, OR add it to the pre-defined backend using:

(setf (gptel-backend-curl-args gptel--openai)
      '("--ssl-no-revoke" "-k"))

For any other LLM provider you can add :curl-args to the setup code provided in the README.

@xeechou
Copy link
Author

xeechou commented Apr 12, 2024

yes it did work with :curl-args however I have to add it to every backend I use..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants