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.
This commit is contained in:
Marco Minerva
2025-04-22 11:19:32 +02:00
parent d8e699730d
commit 711d4a314f
2 changed files with 10 additions and 4 deletions
@@ -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.
""");
@@ -23,12 +23,12 @@
<PackageReference Include="Microsoft.ML.Tokenizers" Version="1.0.2" />
<PackageReference Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" Version="1.0.2" />
<PackageReference Include="Microsoft.ML.Tokenizers.Data.O200kBase" Version="1.0.2" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.45.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.47.0" />
<PackageReference Include="MimeMapping" Version="3.1.0" />
<PackageReference Include="MinimalHelpers.Routing.Analyzers" Version="1.1.3" />
<PackageReference Include="PdfPig" Version="0.1.10" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="8.1.0" />
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.0.23" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="8.1.1" />
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.0.25" />
</ItemGroup>
</Project>