branch: externals/ellama
commit 8b6db08f89349ea56e17a04c01afcb3641f781be
Merge: 76b8287006 da2063e49f
Author: Sergey Kostyaev <s-kosty...@users.noreply.github.com>
Commit: GitHub <nore...@github.com>

    Merge pull request #222 from 
s-kostyaev/add-fill-provider-from-current-session
    
    Add transient suffix for loading model from current session
---
 NEWS.org  |  2 ++
 ellama.el | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/NEWS.org b/NEWS.org
index 00d30a1822..4e456291cc 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,5 @@
+* Version 1.1.7
+- Added transient suffix to load model from the current session.
 * Version 1.1.6
 - Add system message support to ~ellama-stream~, ~ellama-chat~ and
   ~ellama-instant~.
diff --git a/ellama.el b/ellama.el
index 2b3c258f5d..5858552902 100644
--- a/ellama.el
+++ b/ellama.el
@@ -6,7 +6,7 @@
 ;; URL: http://github.com/s-kostyaev/ellama
 ;; Keywords: help local tools
 ;; Package-Requires: ((emacs "28.1") (llm "0.22.0") (spinner "1.7.4") 
(transient "0.7") (compat "29.1") (posframe "1.4.0"))
-;; Version: 1.1.6
+;; Version: 1.1.7
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;; Created: 8th Oct 2023
 
@@ -2694,6 +2694,14 @@ Call CALLBACK on result list of strings.  ARGS contains 
keys for fine control.
          (completing-read "Select provider: "
                           (mapcar #'prin1-to-string ellama-provider-list))))))
 
+(transient-define-suffix ellama-transient-model-get-from-current-session ()
+  "Fill transient model from current session."
+  (interactive)
+  (when ellama--current-session-id
+    (ellama-fill-transient-ollama-model
+     (with-current-buffer (ellama-get-session-buffer 
ellama--current-session-id)
+       (ellama-session-provider ellama--current-session)))))
+
 (transient-define-suffix ellama-transient-set-provider ()
   "Set transient model to provider."
   (interactive)
@@ -2711,6 +2719,8 @@ Call CALLBACK on result list of strings.  ARGS contains 
keys for fine control.
   [["Model"
     ("f" "Load from provider" ellama-transient-model-get-from-provider
      :transient t)
+    ("F" "Load from current session" 
ellama-transient-model-get-from-current-session
+     :transient t)
     ("m" "Set Model" ellama-transient-set-ollama-model
      :transient t
      :description (lambda () (format "Model (%s)" 
ellama-transient-ollama-model-name)))

Reply via email to