Hello @Brent Kauffman ,
You have to give a user
query that gives at least single document from index. If you give more generalized query, analysis query or size of document related you won't get the results.
For hotels sample index i gave below kind of query
messages.Add(new Dictionary<string, string>
{
{ "role", "user" },
{ "content", @"
Give me hotel name having parking spaces." }
});
and it gave set of documents and upon making chat completion call passing those documents got the successful output.
Alter Chat completion code like below.
messages.Add(new Dictionary<string, string>
{
{ "role", "assistant" },
{ "content", (retrievalResult.Value.Response[0].Content[0] as KnowledgeAgentMessageTextContent).Text }
});
List<ChatMessage> chatMessages = messages
.Select<Dictionary<string, string>, ChatMessage>(m => m["role"] switch
{
"user" => new UserChatMessage(m["content"]),
"assistant" => new AssistantChatMessage(m["content"]),
"system" => new SystemChatMessage(m["content"]),
_ => null
})
.Where(m => m != null)
.ToList();
var result = await chatClient.CompleteChatAsync(chatMessages);
Console.WriteLine($"[ASSISTANT]: {result.Value.Content[0].Text.Replace(".", "\n")}");
And as per instruction it gives below output when there is empty results from agent upon making chat completion call with that agent's message.
In your case if it's empty then there are no results from index for your query, so try giving query like some keywords it should match in search index.
If you could provide the queries and data, you trying it will help us to make further investigation or do let us know if you have any questions in comments
Thank you