[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel 4aa6b7ca79 4/4: gptel-ollama: Fix missing options-pl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel 4aa6b7ca79 4/4: gptel-ollama: Fix missing options-plist (#472) |
Date: |
Tue, 12 Nov 2024 04:00:34 -0500 (EST) |
branch: elpa/gptel
commit 4aa6b7ca79b1548c36e593d0d68d2dfa644fa958
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel-ollama: Fix missing options-plist (#472)
* gptel-ollama.el (gptel--request-data): Set temperature and
max_tokens options correctly when constructing the request
payload.
FIXME: we currently do not merge model/backend-specific
request parameters with the regular parameters recursively, so
these can be lost if there is a model/backend-specific `:options'
field.
---
gptel-ollama.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gptel-ollama.el b/gptel-ollama.el
index 69e403e5b5..1bdc266c90 100644
--- a/gptel-ollama.el
+++ b/gptel-ollama.el
@@ -80,7 +80,8 @@ Intended for internal use only.")
:messages [,@prompts]
:stream ,(or (and gptel-stream gptel-use-curl
(gptel-backend-stream gptel-backend))
- :json-false))))
+ :json-false)))
+ options-plist)
(when gptel-temperature
(setq options-plist
(plist-put options-plist :temperature
@@ -89,6 +90,11 @@ Intended for internal use only.")
(setq options-plist
(plist-put options-plist :num_predict
gptel-max-tokens)))
+ ;; FIXME: These options will be lost if there are model/backend-specific
+ ;; :options, since `gptel--merge-plists' does not merge plist values
+ ;; recursively.
+ (when options-plist
+ (plist-put prompts-plist :options options-plist))
;; Merge request params with model and backend params.
(gptel--merge-plists
prompts-plist