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

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

[elpa] externals/ellama 904959ddfd 4/8: Add `:provider` keyword to strin


From: ELPA Syncer
Subject: [elpa] externals/ellama 904959ddfd 4/8: Add `:provider` keyword to string list extraction functions
Date: Sun, 26 Jan 2025 15:58:25 -0500 (EST)

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

    Add `:provider` keyword to string list extraction functions
    
    Enhance `ellama-extract-string-list` and
    `ellama-extract-string-list-async`. Added support for optional
    arguments in both functions to allow fine control over the extraction
    process. Introduced new keyword argument `:provider` to specify an LLM
    provider for generation, defaulting to existing providers if not
    specified.
---
 ellama.el | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/ellama.el b/ellama.el
index bbe782a3e1..d8d508a36b 100644
--- a/ellama.el
+++ b/ellama.el
@@ -2206,10 +2206,14 @@ otherwise prompt user for URL to summarize."
                            (:data (:type array :items (:type string)))
                            :required (data))))
 
-(defun ellama-extract-string-list (elements input)
+(defun ellama-extract-string-list (elements input &rest args)
   "Extract list of ELEMENTS from INPUT syncronously.
-Return list of strings."
-  (let ((provider (or ellama-extraction-provider ellama-provider)))
+Return list of strings. ARGS contains keys for fine control.
+
+:provider PROVIDER -- PROVIDER is an llm provider for generation."
+  (let ((provider (or (plist-get args :provider)
+                     ellama-extraction-provider
+                     ellama-provider)))
     (plist-get (json-parse-string
                (llm-chat
                 provider
@@ -2218,10 +2222,14 @@ Return list of strings."
                :array-type 'list)
               :data)))
 
-(defun ellama-extract-string-list-async (elements callback input)
+(defun ellama-extract-string-list-async (elements callback input &rest args)
   "Extract list of ELEMENTS from INPUT asyncronously.
-Call CALLBACK on result list of strings."
-  (let ((provider (or ellama-extraction-provider ellama-provider)))
+Call CALLBACK on result list of strings. ARGS contains keys for fine control.
+
+:provider PROVIDER -- PROVIDER is an llm provider for generation."
+  (let ((provider (or (plist-get args :provider)
+                     ellama-extraction-provider
+                     ellama-provider)))
     (llm-chat-async
      provider
      (ellama--make-extract-string-list-prompt elements input)



reply via email to

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