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

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

[elpa] externals/ellama 93014423d1 1/3: Improve code review prompt templ


From: ELPA Syncer
Subject: [elpa] externals/ellama 93014423d1 1/3: Improve code review prompt template and implementation
Date: Thu, 28 Nov 2024 15:58:24 -0500 (EST)

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

    Improve code review prompt template and implementation
    
    Updated the `ellama-code-review-prompt-template` to include a software
    engineer role, enhancing the quality of the output. Additionally,
    modified the `ellama-code-review` function to incorporate context
    addition techniques and now utilizes the `ellama-chat` method instead
    of `ellama-instant`.
---
 ellama.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ellama.el b/ellama.el
index 2d6e27c69a..12eeac38da 100644
--- a/ellama.el
+++ b/ellama.el
@@ -245,7 +245,7 @@ You are a summarizer. You write a summary of the input **IN 
THE SAME LANGUAGE AS
   :group 'ellama
   :type 'string)
 
-(defcustom ellama-code-review-prompt-template "Review the following code and 
make concise suggestions:\n```\n%s\n```"
+(defcustom ellama-code-review-prompt-template "You are professional software 
engineer. Review provided code and make concise suggestions."
   "Prompt template for `ellama-code-review'."
   :group 'ellama
   :type 'string)
@@ -1874,11 +1874,10 @@ ARGS contains keys for fine control.
 (defun ellama-code-review ()
   "Review code in selected region or current buffer."
   (interactive)
-  (let ((text (if (region-active-p)
-                 (buffer-substring-no-properties (region-beginning) 
(region-end))
-               (buffer-substring-no-properties (point-min) (point-max)))))
-    (ellama-instant (format ellama-code-review-prompt-template text)
-                    :provider ellama-coding-provider)))
+  (if (region-active-p)
+      (ellama-context-add-selection)
+    (ellama-context-add-buffer (current-buffer)))
+  (ellama-chat ellama-code-review-prompt-template nil :provider 
ellama-coding-provider))
 
 ;;;###autoload
 (defun ellama-change (change &optional edit-template)



reply via email to

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