emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ellama 9694f797f2 2/4: Fix chat on model switching


From: ELPA Syncer
Subject: [elpa] externals/ellama 9694f797f2 2/4: Fix chat on model switching
Date: Tue, 13 Feb 2024 09:57:58 -0500 (EST)

branch: externals/ellama
commit 9694f797f25f363d55fb9381ec5d145c73086b43
Author: Sergey Kostyaev <sskostyaev@gmail.com>
Commit: Sergey Kostyaev <sskostyaev@gmail.com>

    Fix chat on model switching
    
    Fixes #73
---
 ellama.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/ellama.el b/ellama.el
index ae500febd8..ed0c520e79 100644
--- a/ellama.el
+++ b/ellama.el
@@ -488,7 +488,7 @@ CONTEXT contains context for next request."
 
 (defun ellama-generate-name (provider action prompt)
   "Generate name for ellama ACTION by PROVIDER according to PROMPT."
-  (funcall ellama-naming-scheme provider action prompt))
+  (replace-regexp-in-string "/" "_" (funcall ellama-naming-scheme provider 
action prompt)))
 
 (defvar ellama--new-session-context nil)
 
@@ -805,8 +805,10 @@ failure (with BUFFER current).
 
 :on-done ON-DONE -- ON-DONE a function that's called with the full response 
text
 when the request completes (with BUFFER current)."
-  (let* ((provider (or (plist-get args :provider) ellama-provider))
-        (session (plist-get args :session))
+  (let* ((session (plist-get args :session))
+        (provider (if session
+                      (ellama-session-provider session)
+                    (or (plist-get args :provider) ellama-provider)))
         (buffer (or (plist-get args :buffer)
                     (when (ellama-session-p session)
                       (ellama-get-session-buffer (ellama-session-id session)))
@@ -1224,7 +1226,8 @@ buffer."
     (setq ellama-provider
          (eval (alist-get
                 (completing-read "Select model: " variants)
-                providers nil nil #'string=)))))
+                providers nil nil #'string=)))
+    (setq ellama--current-session-id nil)))
 
 (provide 'ellama)
 ;;; ellama.el ends here.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]