From cee5893d79c599825edbfa0fdcfa46bec27a6fc2 Mon Sep 17 00:00:00 2001 From: Karthik Chikmagalur Date: Tue, 7 Nov 2023 20:20:54 -0800 Subject: [PATCH] gptel: Appease the byte compiler. --- gptel-ollama.el | 14 +++++++------- gptel.el | 6 +++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gptel-ollama.el b/gptel-ollama.el index ee15c12..dac5e8c 100644 --- a/gptel-ollama.el +++ b/gptel-ollama.el @@ -31,6 +31,12 @@ (:copier nil) (:include gptel-backend))) +(defvar-local gptel--ollama-context nil + "Context for ollama conversations. + +This variable holds the context array for conversations with +Ollama models.") + (cl-defmethod gptel-curl--parse-stream ((_backend gptel-ollama) info) ";TODO: " (when (bobp) @@ -47,7 +53,7 @@ (unless (eq done json-false) (with-current-buffer (plist-get info :buffer) (setq gptel--ollama-context (map-elt content :context))) - (end-of-buffer)))) + (goto-char (point-max))))) (error (forward-line 0))) (apply #'concat (nreverse content-strs)))) @@ -140,12 +146,6 @@ Example: nil nil #'equal) backend)))) -(defvar-local gptel--ollama-context nil - "Context for ollama conversations. - -This variable holds the context array for conversations with -Ollama models.") - (provide 'gptel-ollama) ;;; gptel-ollama.el ends here diff --git a/gptel.el b/gptel.el index 0be1e25..c91db71 100644 --- a/gptel.el +++ b/gptel.el @@ -540,7 +540,11 @@ opening the file." position context (stream nil) (in-place nil) (system gptel--system-message)) - "Request a response from ChatGPT for PROMPT. + "Request a response from the `gptel-backend' for PROMPT. + +Note: This function is not fully self-contained. Consider +let-binding the parameters `gptel-backend' and `gptel-model' +around calls to it as required. If PROMPT is - a string, it is used to create a full prompt suitable for