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

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

[elpa] externals/elisa 4a4d1db359: Improve prompt template for prompt re


From: ELPA Syncer
Subject: [elpa] externals/elisa 4a4d1db359: Improve prompt template for prompt rewriting
Date: Wed, 6 Nov 2024 15:58:05 -0500 (EST)

branch: externals/elisa
commit 4a4d1db3594a53fd90fcd453cf642d96f70a70ff
Author: Sergey Kostyaev <kostyaev.sergey2@wb.ru>
Commit: Sergey Kostyaev <kostyaev.sergey2@wb.ru>

    Improve prompt template for prompt rewriting
    
    Add qwen 2.5 3b to recommended models.
---
 NEWS.org   |  2 ++
 README.org | 19 ++++++++++++++-----
 elisa.el   | 33 ++++++++++++++++++---------------
 3 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index b1136917b5..0bb2df16d7 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,5 @@
+* Version 1.1.1
+- Improve prompt template for prompt rewriting.
 * Version 1.1.0
 - Add complex documents (like pdf, odt, doc etc.) support using 
[[https://tika.apache.org][Apache Tika]].
 * Version 1.0.4
diff --git a/README.org b/README.org
index ed89aedae1..b1176d571d 100644
--- a/README.org
+++ b/README.org
@@ -87,6 +87,7 @@ I prefer this models:
 
 #+begin_src shell
   ollama pull gemma2:9b-instruct-q6_K
+  ollama pull qwen2.5:3b
   ollama pull chatfire/bge-m3:q8_0
 #+end_src
 
@@ -214,12 +215,20 @@ Example configuration.
     (require 'llm-ollama)
     ;; gemma 2 works very good in my use cases
     ;; it also boasts strong multilingual capabilities
+    ;; (setopt elisa-chat-provider
+    ;;           (make-llm-ollama
+    ;;            :chat-model "gemma2:9b-instruct-q6_K"
+    ;;            :embedding-model "chatfire/bge-m3:q8_0"
+    ;;            ;; set context window to 8k
+    ;;            :default-chat-non-standard-params '(("num_ctx" . 8192))))
+    ;;
+    ;; qwen 2.5 3b works good in my test cases and provide longer context
     (setopt elisa-chat-provider
-           (make-llm-ollama
-            :chat-model "gemma2:9b-instruct-q6_K"
-            :embedding-model "chatfire/bge-m3:q8_0"
-            ;; set context window to 8k
-            :default-chat-non-standard-params '(("num_ctx" . 8192))))
+         (make-llm-ollama
+          :chat-model "qwen2.5:3b"
+          :embedding-model "chatfire/bge-m3:q8_0"
+          :default-chat-temperature 0.1
+          :default-chat-non-standard-params '(("num_ctx" . 32768))))
     ;; this embedding model has stong multilingual capabilities
     (setopt elisa-embeddings-provider (make-llm-ollama :embedding-model 
"chatfire/bge-m3:q8_0"))
     :config
diff --git a/elisa.el b/elisa.el
index 01bf9bbdb7..5a1c4ab725 100644
--- a/elisa.el
+++ b/elisa.el
@@ -6,7 +6,7 @@
 ;; URL: http://github.com/s-kostyaev/elisa
 ;; Keywords: help local tools
 ;; Package-Requires: ((emacs "29.2") (ellama "0.11.2") (llm "0.9.1") (async 
"1.9.8") (plz "0.9"))
-;; Version: 1.1.0
+;; Version: 1.1.1
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;; Created: 18th Feb 2024
 
@@ -178,22 +178,25 @@ LLM together with context."
   :type 'string)
 
 (defcustom elisa-rewrite-prompt-template
-  "You are professional search agent. With given context and user
-prompt you need to create new prompt for search. It should be
-concise and useful without additional context. Response with
-prompt only. You should replace all words like 'this' or 'it' to
-its values to make search successful. If user prompt contains
-question your prompt should also be in form of question. For
-example:
-
-- What is pony?
-- Pony is ...
-- How to buy it?
+  "<INSTRUCTIONS>
+You are professional search agent. With given context and user
+prompt you need to create new prompt for search **IN THE SAME
+LANGUAGE AS ORIGINAL USER PROMPT**. It should be concise and
+useful without additional context. Response with prompt only. You
+should replace all words like 'this' or 'it' to its values to
+make search successful. If user prompt contains question your
+prompt should also be in form of question.
+ </INSTRUCTIONS>
+<EXAMPLE>
+ - What is pony?
+ - Pony is ...
+ - How to buy it?
 
 How to buy a pony?
-
- User prompt:
-%s"
+</EXAMPLE>
+<USER_PROMPT>
+%s
+</USER_PROMPT>"
   "Prompt template for prompt rewriting."
   :type 'string)
 



reply via email to

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