From b1aa81e4ecba6d6927dc9a98c73c910475c60191 Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Thu, 20 Feb 2025 10:06:11 +0100 Subject: [PATCH] Enhance question reformulation in ChatService Updated the `embeddingQuestion` string to require that the reformulated question explicitly contains the subject of the original question. The reformulation must also be in the same language as the user's question and should not include phrases like "in this chat" or "search for." --- SqlDatabaseVectorSearch/Services/ChatService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/SqlDatabaseVectorSearch/Services/ChatService.cs b/SqlDatabaseVectorSearch/Services/ChatService.cs index 172cd96..25da2b6 100644 --- a/SqlDatabaseVectorSearch/Services/ChatService.cs +++ b/SqlDatabaseVectorSearch/Services/ChatService.cs @@ -23,6 +23,7 @@ public class ChatService(IChatCompletionService chatCompletionService, Tokenizer --- {question} --- + The reformulation must always explicitly contain the subject of the question. You must reformulate the question in the same language of the user's question. For example, it the user asks a question in English, the answer must be in English. Never add "in this chat", "in the context of this chat", "in the context of our conversation", "search for" or something like that in your answer. """;