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.
This commit is contained in:
Marco Minerva
2024-10-14 12:11:25 +02:00
parent 5c0cf1cbd0
commit 3445059746
@@ -37,8 +37,8 @@ public class ChatService(IMemoryCache cache, IChatCompletionService chatCompleti
{ {
var chat = new ChatHistory("""" var chat = new ChatHistory(""""
""" """
You can use only the information provided in this chat to answer questions. 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.
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. Never answer to questions that are not related to this chat.
You must answer in the same language of the user's question. You must answer in the same language of the user's question.
""""); """");