branch: elpa/gptel
commit 885c591932491d76ce8bdc306e389e4efa6b4f7e
Author: Felipe Ochoa <fel...@incquery.com>
Commit: karthink <karthikchikmaga...@gmail.com>

    gptel-curl: Allow curl-args to be a function
    
    * gptel-curl.el (gptel-curl--get-args): In preparation for merging
    support for AWS Bedrock, allow the `curl-args' field of a
    gptel-backend to be a function.
---
 gptel-curl.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gptel-curl.el b/gptel-curl.el
index e2d6f54ddb..1af28fe46e 100644
--- a/gptel-curl.el
+++ b/gptel-curl.el
@@ -90,7 +90,8 @@ REQUEST-DATA is the data to send, TOKEN is a unique 
identifier."
     (append
      gptel-curl--common-args
      gptel-curl-extra-args
-     (gptel-backend-curl-args gptel-backend)
+     (and-let* ((curl-args (gptel-backend-curl-args gptel-backend)))
+       (if (functionp curl-args) (funcall curl-args) curl-args))
      (list (format "-w(%s . %%{size_header})" token))
      (if (length< data-json gptel-curl-file-size-threshold)
          (list (format "-d%s" data-json))

Reply via email to