Hi Team,
We are using azure open ai and ai search for using private document answer fetch. We have added the document in storage account and configured index in ai search. Even if the configured document has specific question still we are not getting the answer while using open ai clinet chat completion.
We are using the below chat completions options.
ChatCompletionsOptions chatCompletionsOptions = new()
{
DeploymentName = AzureOpenAIDeploymentId,
Temperature = 0,
MaxTokens = AzureOpenAIParamMaxTokens };
var prompt = $"Instuction: Read the question carefully and try to understand what information the user is looking for. Check the provided documents for any relevant information related to the question. If relevant information is found, extract the most suitable answer in English and provide it to the user.If no relevant information is found in the provided documents or the question is not related to the data in the document, respond with, 'The requested information is not available in the retrieved documents'";
chatCompletionsOptions.Messages.Add(new ChatRequestSystemMessage(prompt));
// Add Previous chat history to the chatCompletionsOptions. Add Request user system message and assistant message.
chatCompletionsOptions.AzureExtensionsOptions = new AzureChatExtensionsOptions()
{
Extensions =
{
new AzureSearchChatExtensionConfiguration ()
{
Authentication = new OnYourDataSystemAssignedManagedIdentityAuthenticationOptions(),
SearchEndpoint = new Uri(AzureSearchEndpoint),
IndexName = indexName,
Strictness = 5,
ShouldRestrictResultScope = true,
RoleInformation = prompt
}
}
};
We have tried the same question in ai search index, and we are seeing the answer in ai search but not getting answer while using
Response<ChatCompletions> responseWithoutStream = await OpenAIClient.GetChatCompletionsAsync(chatCompletionsOptions);