How do I include a URL and the Document Name using Azure's Cognitive Search and Azure OpenAI
Zafar Issadeen
0
Reputation points
When calling Azure's OpenAI with Cognitive Search I am requesting for the UrlField Name in the Field Mapping which is returning null. I have tested this in the Azure Open AI Chat Playground and this same field (metadata_storage_path) is returning a URL. Am I doing something wrong?
openAiClient = new OpenAIClient(
new Uri(_OpenAIEndPoint),
new AzureKeyCredential(_OpenAIAPIKey));
chatCompletionOptions = new ChatCompletionsOptions
{
Messages = { new ChatMessage(ChatRole.System, _PrimingPromptForOpenAI) },
AzureExtensionsOptions = new AzureChatExtensionsOptions()
{
Extensions =
{
new AzureCognitiveSearchChatExtensionConfiguration()
{
SearchEndpoint = new Uri(_CognitiveSearchURL),
SearchKey = new AzureKeyCredential(_AzureKeyCredential),
IndexName = _AzureSearchIndex,
SemanticConfiguration = _SemanticConfig,
FieldMappingOptions = new AzureCognitiveSearchIndexFieldMappingOptions {UrlFieldName = "metadata_storage_path"}
}
},
}
};