Question: Is it possible to constrain AskAsync to the uploaded documents alone #1053
Unanswered
andy-praneshai
asked this question in
1. Q&A
Replies: 1 comment
-
You can try defining a custom RAG prompt, for example: var context = new RequestContext();
context.SetArg(Constants.CustomContext.Rag.Prompt, """
Facts:
{{$facts}}
======
Given only the timestamped facts above, provide a very short answer, include the relevant dates in brackets.
If you don't have sufficient information, reply with '{{$notFound}}'.
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
- 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.
Question: {{$input}}
Answer:
""");
var answer = await kernelMemory.AskAsync(question, context: context); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I used Kernel memory to upload documents to an Azure AI Search vector database. It generally works....however, when I ask unrelated questions such as "Who is Barry Bonds?", it responds with an answer even though none of the documents have this information. Is it possible to constrain AskAsync to only the documents?
Beta Was this translation helpful? Give feedback.
All reactions