[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ellama 1d5c5ecdb1 13/37: Add function to run chat with
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ellama 1d5c5ecdb1 13/37: Add function to run chat with llm using blueprint |
Date: |
Sat, 8 Mar 2025 06:58:35 -0500 (EST) |
branch: externals/ellama
commit 1d5c5ecdb1315237cb6960a327e00d21159507c7
Author: Sergey Kostyaev <sskostyaev@gmail.com>
Commit: Sergey Kostyaev <sskostyaev@gmail.com>
Add function to run chat with llm using blueprint
Added `ellama-blueprint-run` function which allows running a chat with an
LLM
starting with a specified blueprint and optional pre-filled variables. The
function uses a temporary buffer to insert the content of the selected
blueprint, replaces placeholders with provided arguments, and then sends the
buffer to a new chat session.
---
ellama.el | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/ellama.el b/ellama.el
index 331124a4d5..3faf5acc0d 100644
--- a/ellama.el
+++ b/ellama.el
@@ -1307,6 +1307,31 @@ Then kill current buffer."
(defvar ellama-blueprint-buffer "*ellama-blueprint-buffer*"
"Buffer for prompt blueprint.")
+;;;###autoload
+(defun ellama-blueprint-run (blueprint &optional args)
+ "Run chat with llm starting with BLUEPRINT with prefilled variables.
+
+ARGS contains plist with variables to prefill."
+ (let* ((collection (seq-union
+ ellama-blueprints
+ (ellama-community-prompts-ensure)
+ (lambda (blueprint1 blueprint2)
+ (string=
+ (plist-get blueprint1 :act)
+ (plist-get blueprint2 :act)))))
+ (prompt (cl-find-if (lambda (el)
+ (string= blueprint (plist-get el :act)))
+ collection))
+ (content (plist-get prompt :prompt)))
+ (with-temp-buffer
+ (insert content)
+ (when args
+ (dolist (var (ellama-blueprint-get-variable-list))
+ (ellama-blueprint-set-variable
+ var
+ (plist-get args (intern (concat ":" var))))))
+ (ellama-send-buffer-to-new-chat))))
+
;;;###autoload
(defun ellama-blueprint-select (&optional args)
"Select a prompt from the prompt collection.
- [elpa] externals/ellama updated (19bf5ed03f -> e370c3f23a), ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 829aa9aca4 02/37: Add command to create new blueprint from existing one, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 96e970566a 06/37: Change ellama-blueprint-mode parent to text-mode, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama a276b01f0a 14/37: Add blueprints documentation to readme, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 2f151d2b39 28/37: Update summarization prompt template and function, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 2b2f4242b0 18/37: Trim prefix for ellama-code-complete, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama db415af6ac 09/37: Refactor blueprint creation functions and add transient menu, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama c2256c633d 25/37: Extracted ellama context management functionality to a new file, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 1d5c5ecdb1 13/37: Add function to run chat with llm using blueprint,
ELPA Syncer <=
- [elpa] externals/ellama 7ff0c82d73 11/37: Fix linter warning, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 078a94f1d8 10/37: Remove debug messages from `ellama.el`, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama d3e3e38cc3 26/37: Remove fill-region from ellama-blueprint-select, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama f373c50e3f 03/37: WIP: highlight variables in `ellama-blueprint-mode`, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama c4edfd05ef 05/37: Fix typo in buffer variable name, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 376f0dc63c 15/37: Remove optional argument in prompt selection function, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 97cebc8714 20/37: Fix syntax in documentation, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 447c4ddd88 17/37: Enhance ellama-complete filtering, ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 286a714692 34/37: Imrove `ellama-transient-set-system` docstring., ELPA Syncer, 2025/03/08
- [elpa] externals/ellama 9f614f397d 36/37: Add transient menu for blueprint mode commands, ELPA Syncer, 2025/03/08