summaryrefslogtreecommitdiff
path: root/llm-ollama.el
diff options
context:
space:
mode:
authorSergey Kostyaev <s-kostyaev@users.noreply.github.com>2026-05-01 16:46:20 +0200
committerGitHub <noreply@github.com>2026-05-01 10:46:20 -0400
commit4ef511ad1ce11539e3848edf8a2f0ef439506c01 (patch)
treefc3ff18907dbddc713f4defbe7fd5d17947652ca /llm-ollama.el
parent4f69909fcc81d9d0f54ccb0d44ef3fa6e95ee09c (diff)
Redact provider keys in printed structs (#276)externals/llm
## Summary - wrap string provider keys in zero-argument functions so provider structs do not print raw secrets in backtraces - update key-bearing provider constructors to apply the wrapping at construction time - add a regression test for OpenAI-compatible providers Original issue: https://github.com/s-kostyaev/ellama/issues/318 ## Testing - emacs -Q --batch -L . -L /Users/sergeykostyaev/.emacs.d/elpa/plz-0.9.1 -L /Users/sergeykostyaev/.emacs.d/elpa/plz-event-source-0.1.3 -L /Users/sergeykostyaev/.emacs.d/elpa/plz-media-type-0.2.4 -L /Users/sergeykostyaev/.emacs.d/elpa-old/compat-30.0.2.0 --eval "(setq load-prefer-newer t)" -l llm-test.el -l llm-provider-utils-test.el -l llm-prompt-test.el -l llm-models-test.el --eval "(ert-run-tests-batch-and-exit)" - byte-compilation of touched files with the same load path
Diffstat (limited to 'llm-ollama.el')
-rw-r--r--llm-ollama.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/llm-ollama.el b/llm-ollama.el
index 9048070..bf272c6 100644
--- a/llm-ollama.el
+++ b/llm-ollama.el
@@ -63,7 +63,20 @@ CHAT-MODEL is the model to use for chat queries. It is required.
EMBEDDING-MODEL is the model to use for embeddings. It is required."
(scheme "http") (host "localhost") (port 11434) chat-model embedding-model)
-(cl-defstruct (llm-ollama-authed (:include llm-ollama))
+(cl-defstruct (llm-ollama-authed
+ (:include llm-ollama)
+ (:constructor make-llm-ollama-authed
+ (&key default-chat-temperature
+ default-chat-max-tokens
+ default-chat-non-standard-params
+ (scheme "http")
+ (host "localhost")
+ (port 11434)
+ chat-model
+ embedding-model
+ ((:key raw-key))
+ &aux
+ (key (llm-provider-utils--wrap-key raw-key)))))
"Similar to llm-ollama, but also with a key."
key)