From 711d4a314fb514ffe627df8027b8386030abac6d Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Tue, 22 Apr 2025 11:19:32 +0200 Subject: [PATCH] Enhance chat responses and update package versions Updated `ChatService.cs` to improve user guidance for unavailable information responses. Added multiple phrases to ensure clarity and context relevance. Modified `SqlDatabaseVectorSearch.csproj` to upgrade `Microsoft.SemanticKernel` from `1.45.0` to `1.47.0`, and incremented versions for `Swashbuckle.AspNetCore.SwaggerUI` and `TinyHelpers.AspNetCore` to `8.1.1` and `4.0.25`, respectively, for bug fixes and improvements. --- SqlDatabaseVectorSearch/Services/ChatService.cs | 8 +++++++- SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/SqlDatabaseVectorSearch/Services/ChatService.cs b/SqlDatabaseVectorSearch/Services/ChatService.cs index 303bb07..049c08f 100644 --- a/SqlDatabaseVectorSearch/Services/ChatService.cs +++ b/SqlDatabaseVectorSearch/Services/ChatService.cs @@ -114,7 +114,13 @@ public class ChatService(IChatCompletionService chatCompletionService, Tokenizer { 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. - 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". + 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 + - I'm sorry, I don't know the answer to that question + - I don't have that information + - I don't know + - Given the context, I can't answer that question + - I'my sorry, I don't have enough information to answer that question Never answer to questions that are not related to this chat. You must answer 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. """); diff --git a/SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj b/SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj index 5be3f56..fa56b10 100644 --- a/SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj +++ b/SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj @@ -23,12 +23,12 @@ - + - - + +