[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ellama 62344f5633 5/5: Add llm name to generated ellama
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ellama 62344f5633 5/5: Add llm name to generated ellama name |
Date: |
Sun, 7 Jan 2024 18:57:58 -0500 (EST) |
branch: externals/ellama
commit 62344f56337d10c39f8a8f1f92d45b8be3618363
Author: Sergey Kostyaev <sskostyaev@gmail.com>
Commit: Sergey Kostyaev <sskostyaev@gmail.com>
Add llm name to generated ellama name
---
NEWS.org | 2 ++
ellama.el | 11 ++++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/NEWS.org b/NEWS.org
index 84d2ceedec..0074bdcf0c 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,5 @@
+* Version 0.5.6
+- Add llm name to generated ellama name.
* Version 0.5.5
- Add ellama-chat-done-callback.
* Version 0.5.4
diff --git a/ellama.el b/ellama.el
index 311108f2e4..355b8ba700 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.6.0") (spinner "1.7.4"))
-;; Version: 0.5.5
+;; Version: 0.5.6
;; SPDX-License-Identifier: GPL-3.0-or-later
;; Created: 8th Oct 2023
@@ -290,8 +290,8 @@ It should be a function with single argument generated text
string."
;; If ellama-enable-keymap is nil, remove the key bindings
(define-key global-map (kbd ellama-keymap-prefix) nil))))
-(defun ellama-generate-name (action prompt)
- "Generate name for ellama ACTION according to PROMPT."
+(defun ellama-generate-name (provider action prompt)
+ "Generate name for ellama ACTION by PROVIDER according to PROMPT."
(let ((prompt-words (split-string prompt)))
(string-join
(flatten-tree
@@ -299,7 +299,8 @@ It should be a function with single argument generated text
string."
(seq-take prompt-words ellama-name-prompt-words-count)
(if (> (length prompt-words) ellama-name-prompt-words-count)
"..."
- nil)))
+ nil)
+ (format "(%s)" (llm-name provider))))
" ")))
(defun ellama--cancel-current-request (&rest _)
@@ -458,7 +459,7 @@ Will call `ellama-chat-done-callback' on TEXT."
(defun ellama-instant (prompt)
"Prompt ellama for PROMPT to reply instantly."
- (let* ((buffer-name (ellama-generate-name real-this-command prompt))
+ (let* ((buffer-name (ellama-generate-name ellama-provider real-this-command
prompt))
(buffer (get-buffer-create (if (get-buffer buffer-name)
(make-temp-name (concat buffer-name "
"))
buffer-name))))