karthink / gptel

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

Add curl-args slot to gptel-backend #221

Closed r0man closed 4 months ago

r0man commented 4 months ago

This slot is used to append backend specific options to the curl arguments used to make HTTP requests. The backend specific arguments are appended after gptel-curl--common-args.

My use case for this feature is to set the --cert and --key options in a custom backend that uses mutal TLS to communicate with an OpenAI proxy/gateway.

karthink commented 4 months ago

Thank you, this looks good. Unfortunately, we'll have to update the docstrings and signatures of all the constructors to include curl-args:

  1. gptel-make-openai and gptel-make-azure in gptel-openai.el.

2.gptel-make-ollama in gptel-ollama.el.

  1. gptel-make-kagi in gptel-kagi.el.

  2. gptel-make-gemini in gptel-gemini.el.

i can update 2 through 4 after the PR is merged. Could you add it to the constructors in gptel-openai.el?

r0man commented 4 months ago

Hi @karthink,

I now added an optional curl-args to all constructors and initialize the backends with it.

karthink commented 4 months ago

Cheers @r0man!

r0man commented 4 months ago

Hi @karthink, thanks for merging this. Can I ask you for 1 last thing: Could you please cut a release (tag a new version) with this change included? I would like to release the custom back-end I built on top of this to my colleagues. Some of them might use MELPA stable, and I would like them to be able to try it without any friction. Thanks in advance, Roman.

karthink commented 4 months ago

Released v0.7.0, thanks for the PR @r0man

r0man commented 4 months ago

Perfect, thank you! :heart: