[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel 43f625ecb9 209/273: gptel-openai: curl-args slot in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel 43f625ecb9 209/273: gptel-openai: curl-args slot in gptel-backend (#221) |
Date: |
Wed, 1 May 2024 10:02:25 -0400 (EDT) |
branch: elpa/gptel
commit 43f625ecb90d7955431f670877d6d7c213ecef04
Author: r0man <roman@burningswell.com>
Commit: GitHub <noreply@github.com>
gptel-openai: curl-args slot in gptel-backend (#221)
gptel-openai.el (gptel-backend, gptel-make-openai,
gptel-make-azure): Add a curl-args slot to the backend struct for
additional Curl arguments.
Usage example: This can be used to set the `--cert` and `--key`
options in a custom backend that uses mutal TLS to communicate
with an OpenAI proxy/gateway.
gptel-curl.el (gptel-curl--get-args): Add backend-specific
curl-args when creating HTTP requests.
gptel-gemini.el (gptel-make-gemini): Add a curl-args slot to the
constructor.
gptel-kagi.el (gptel-make-kagi): Ditto.
gptel-ollama.el (gptel-make-ollama): Ditto.
---
gptel-curl.el | 1 +
gptel-gemini.el | 5 ++++-
gptel-kagi.el | 5 ++++-
gptel-ollama.el | 5 ++++-
gptel-openai.el | 14 +++++++++++---
5 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/gptel-curl.el b/gptel-curl.el
index 353d2c4a72..c696f0fbec 100644
--- a/gptel-curl.el
+++ b/gptel-curl.el
@@ -66,6 +66,7 @@ PROMPTS is the data to send, TOKEN is a unique identifier."
(gptel--log data "request body"))
(append
gptel-curl--common-args
+ (gptel-backend-curl-args gptel-backend)
(list (format "-w(%s . %%{size_header})" token))
(if (length< data gptel-curl-file-size-threshold)
(list (format "-d%s" data))
diff --git a/gptel-gemini.el b/gptel-gemini.el
index 90119a3cfc..ab52a61015 100644
--- a/gptel-gemini.el
+++ b/gptel-gemini.el
@@ -111,7 +111,7 @@
;;;###autoload
(cl-defun gptel-make-gemini
- (name &key header key (stream nil)
+ (name &key curl-args header key (stream nil)
(host "generativelanguage.googleapis.com")
(protocol "https")
(models '("gemini-pro"))
@@ -121,6 +121,8 @@
Keyword arguments:
+CURL-ARGS (optional) is a list of additional Curl arguments.
+
HOST (optional) is the API host, defaults to
\"generativelanguage.googleapis.com\".
@@ -145,6 +147,7 @@ KEY (optional) is a variable whose value is the API key, or
function that returns the key."
(declare (indent 1))
(let ((backend (gptel--make-gemini
+ :curl-args curl-args
:name name
:host host
:header header
diff --git a/gptel-kagi.el b/gptel-kagi.el
index f89066ea97..98b191feb6 100644
--- a/gptel-kagi.el
+++ b/gptel-kagi.el
@@ -120,7 +120,7 @@
;;;###autoload
(cl-defun gptel-make-kagi
- (name &key stream key
+ (name &key curl-args stream key
(host "kagi.com")
(header (lambda () `(("Authorization" . ,(concat "Bot "
(gptel--get-api-key))))))
(models '("fastgpt"
@@ -132,6 +132,8 @@
Keyword arguments:
+CURL-ARGS (optional) is a list of additional Curl arguments.
+
HOST is the Kagi host (with port), defaults to \"kagi.com\".
MODELS is a list of available Kagi models: only fastgpt is supported.
@@ -159,6 +161,7 @@ Example:
(declare (indent 1))
stream ;Silence byte-compiler
(let ((backend (gptel--make-kagi
+ :curl-args curl-args
:name name
:host host
:header header
diff --git a/gptel-ollama.el b/gptel-ollama.el
index e9c2dca6bc..f501e7bd5e 100644
--- a/gptel-ollama.el
+++ b/gptel-ollama.el
@@ -101,7 +101,7 @@ Ollama models.")
;;;###autoload
(cl-defun gptel-make-ollama
- (name &key header key models stream
+ (name &key curl-args header key models stream
(host "localhost:11434")
(protocol "http")
(endpoint "/api/generate"))
@@ -109,6 +109,8 @@ Ollama models.")
Keyword arguments:
+CURL-ARGS (optional) is a list of additional Curl arguments.
+
HOST is where Ollama runs (with port), defaults to localhost:11434
MODELS is a list of available model names.
@@ -140,6 +142,7 @@ Example:
:stream t)"
(declare (indent 1))
(let ((backend (gptel--make-ollama
+ :curl-args curl-args
:name name
:host host
:header header
diff --git a/gptel-openai.el b/gptel-openai.el
index 627ff38732..bf0825fed6 100644
--- a/gptel-openai.el
+++ b/gptel-openai.el
@@ -49,7 +49,7 @@
(gptel-backend (:constructor gptel--make-backend)
(:copier gptel--copy-backend))
name host header protocol stream
- endpoint key models url)
+ endpoint key models url curl-args)
;;; OpenAI (ChatGPT)
(cl-defstruct (gptel-openai (:constructor gptel--make-openai)
@@ -115,7 +115,7 @@
;;;###autoload
(cl-defun gptel-make-openai
- (name &key models stream key
+ (name &key curl-args models stream key
(header
(lambda () (when-let (key (gptel--get-api-key))
`(("Authorization" . ,(concat "Bearer " key))))))
@@ -126,6 +126,8 @@
Keyword arguments:
+CURL-ARGS (optional) is a list of additional Curl arguments.
+
HOST (optional) is the API host, typically \"api.openai.com\".
MODELS is a list of available model names.
@@ -147,6 +149,7 @@ KEY (optional) is a variable whose value is the API key, or
function that returns the key."
(declare (indent 1))
(let ((backend (gptel--make-openai
+ :curl-args curl-args
:name name
:host host
:header header
@@ -166,7 +169,7 @@ function that returns the key."
;;; Azure
;;;###autoload
(cl-defun gptel-make-azure
- (name &key host
+ (name &key curl-args host
(protocol "https")
(header (lambda () `(("api-key" . ,(gptel--get-api-key)))))
(key 'gptel-api-key)
@@ -175,6 +178,8 @@ function that returns the key."
Keyword arguments:
+CURL-ARGS (optional) is a list of additional Curl arguments.
+
HOST is the API host.
MODELS is a list of available model names.
@@ -207,6 +212,7 @@ Example:
:models \\='(\"gpt-3.5-turbo\" \"gpt-4\"))"
(declare (indent 1))
(let ((backend (gptel--make-openai
+ :curl-args curl-args
:name name
:host host
:header header
@@ -230,6 +236,8 @@ Example:
Keyword arguments:
+CURL-ARGS (optional) is a list of additional Curl arguments.
+
HOST is where GPT4All runs (with port), typically localhost:8491
MODELS is a list of available model names.
- [nongnu] elpa/gptel 50a2498259 126/273: README: Tweak instructions for local LLMs, mention #120, (continued)
- [nongnu] elpa/gptel 50a2498259 126/273: README: Tweak instructions for local LLMs, mention #120, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel ec0e461b35 128/273: gptel-curl: Increased curl timeout (#127), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d5949ef428 140/273: gptel-curl: handle large Curl payloads with a temp file (#137), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 0ea3c7fb15 143/273: gptel-transient: Improve suffix message editor, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel ce75072f9d 152/273: gptel: Bump version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3af2650342 170/273: gptel-transient: save window state when ediff, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel e67ed41e31 173/273: README: Specify: no key needed for llama backend, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 1fcb4606a2 184/273: Fix compilation warning in gptel-openai.el, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel b3d028d074 185/273: Add .gitignore, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5465271541 207/273: gptel: Add gpt-4-0125-preview to model list (Fix #215), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 43f625ecb9 209/273: gptel-openai: curl-args slot in gptel-backend (#221),
ELPA Syncer <=
- [nongnu] elpa/gptel d502ad8ecb 222/273: test-gptel-org: Add markdown conversion tests, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9925dc91b4 223/273: gptel: Improve markdown converter, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel dade9ec8e1 231/273: gptel: Add introspection commands, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 7e6b106516 233/273: gptel-transient: Change menu display, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 26326c302e 249/273: gptel-anthropic: Parsing fix, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 22f7043c32 242/273: gptel: Fix gptel-end-of-response, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 94b13e78ec 239/273: gptel-transient: enable additional directive by default, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f24ec164cd 251/273: gptel: Adjust doc-string, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5d74ec4de0 254/273: gptel: Set system message correctly in gptel-request, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 53ee34653e 252/273: gptel-openai: Typo in gptel--json-read, ELPA Syncer, 2024/05/01