From 34450597461233d3a5ad2d4bdbae9486abc61324 Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Mon, 14 Oct 2024 12:11:25 +0200 Subject: [PATCH] Enhance ChatService response instructions with example Updated the `AskQuestionAsync` method in `ChatService.cs` to include an additional example in the `ChatHistory` object. This example clarifies how the service should respond when the requested information is not available in the given context, such as responding with "This information isn't available in the given context" if a user asks "What is the capital of France?" and there is no information about France in the chat. --- SqlDatabaseVectorSearch/Services/ChatService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SqlDatabaseVectorSearch/Services/ChatService.cs b/SqlDatabaseVectorSearch/Services/ChatService.cs index 17ed62f..ecb9ec6 100644 --- a/SqlDatabaseVectorSearch/Services/ChatService.cs +++ b/SqlDatabaseVectorSearch/Services/ChatService.cs @@ -37,8 +37,8 @@ public class ChatService(IMemoryCache cache, IChatCompletionService chatCompleti { var chat = new ChatHistory("""" """ - You can use only the information provided in this chat to answer questions. - If you don't know the answer, reply suggesting to refine the question. + You can use only the information provided in this chat to answer questions. If you don't know the answer, reply suggesting to refine the question. + For example, if the user asks "What is the capital of France?" and in this chat there isn't information about France, you should reply something like "This information isn't available in the given context". Never answer to questions that are not related to this chat. You must answer in the same language of the user's question. """");