How do I include a URL and the Document Name using Azure's Cognitive Search and Azure OpenAI

Zafar Issadeen 0 Reputation points
2023-11-02T12:27:59.3433333+00:00

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?

image

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"}
                                                              
                                
                              
                               
                            }
                          },


                }
            };
Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
798 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,438 questions
{count} votes