From e0a2ed557dd5644d101807c2728d51f84134d150 Mon Sep 17 00:00:00 2001 From: jerryjzhang Date: Fri, 20 Sep 2024 18:21:43 +0800 Subject: [PATCH] [improvement][chat-server]Iterate LLM prompt in the MemoryReviewTask. --- .../chat/server/memory/MemoryReviewTask.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/chat/server/src/main/java/com/tencent/supersonic/chat/server/memory/MemoryReviewTask.java b/chat/server/src/main/java/com/tencent/supersonic/chat/server/memory/MemoryReviewTask.java index 2946f9af5..2a02f0be7 100644 --- a/chat/server/src/main/java/com/tencent/supersonic/chat/server/memory/MemoryReviewTask.java +++ b/chat/server/src/main/java/com/tencent/supersonic/chat/server/memory/MemoryReviewTask.java @@ -29,18 +29,17 @@ public class MemoryReviewTask { private static final String INSTRUCTION = "" - + "#Role: You are a senior data engineer experienced in writing SQL.\n" - + "#Task: Your will be provided with a user question and the SQL written by junior engineer," - + "please take a review and give your opinion.\n" - + "#Rules: " + + "\n#Role: You are a senior data engineer experienced in writing SQL." + + "\n#Task: Your will be provided with a user question and the SQL written by junior engineer," + + "please take a review and give your opinion." + + "\n#Rules: " + "1.ALWAYS follow the output format: `opinion=(POSITIVE|NEGATIVE),comment=(your comment)`." - + "2.ALWAYS recognize `数据日期` as the date field." - + "3.IGNORE `数据日期` if not expressed in the `Question`." - + "#Question: %s\n" - + "#Schema: %s\n" - + "#SideInfo: %s\n" - + "#SQL: %s\n" - + "#Response: "; + + "2.NO NEED to include date filter in the where clause if not explicitly expressed in the `Question`." + + "\n#Question: %s" + + "\n#Schema: %s" + + "\n#SideInfo: %s" + + "\n#SQL: %s" + + "\n#Response: "; private static final Pattern OUTPUT_PATTERN = Pattern.compile("opinion=(.*),.*comment=(.*)");