azureazure-web-app-serviceazure-openaiazure-ai

How to Display File Name along with Reference in Azure OpenAI Web Application


I am working on azure ai search and azure openAI. I have created azure ai search service called cent****service1. After this, I created skillset called text split skill. After this, I created index called azureblob-index1 with azure blob storage where there is container called rg where all important documents are stored. Now, when I created chat playround with azure ai search service and index, then when I am asking questions, it is giving answer like:

Write a short Paragraph on Centelon R&D? answer I got is: Ce***** research and development (R&D) efforts are focused on driving innovation and collaboration, with a strong emphasis on leveraging new-age technologies and best practices. The company has received recognition for its work in AI for the pharmaceutical industry, including the receipt of R&D tax credits. Additionally, cen**** has demonstrated its commitment to innovation through the development of a humanoid robot for hospitals and the implementation of solutions in large language models for tasks such as code generation, test data creation, and document querying. These achievements underscore ****** dedication to pushing the boundaries of technology and contributing to impactful advancements in various domains 1 .

References: Citation1

This citation when we click displays reference document.

As discussed, If there are let's say 100's of documents, so If I want to see the name of the document along with reference of the document, Is it possible?

If it is possible, please let me know.

The Fields that I have used in my index are:

content (String)
metadata_storage_content_type (String)
metadata_storage_size (Int64)
metadata_storage_last_modified (DateTimeOffset)
metadata_storage_path (String)
metadata_author (String)
metadata_title (String)
metadata_creation_date (DateTimeOffset)
language (String)
split_text (StringCollection)
keywords (String)
summary (String)
section_titles (String)
metadata_file_type (String)
merged_content (String)
text (StringCollection)
layoutText (StringCollection)
metadata_storage_file_extension (String)
metadata_content_type (String)
metadata_language (String)

Everything is working except that document name, how can I display it in the web application so that it will be easy for user to navigate that this question and answer that it gave belongs to this specific document.


Solution

  • By default, the file name will be automatically mapped for citation results if you have the correct field name like filename.

    When you integrating with azure open ai the below fields should be mapped.

    content data

    file name

    title

    URL

    If you getting no mapping like shown in below image.

    enter image description here

    Then go back to Data source section and map the details with your index field.

    enter image description here

    After check marking click on Next to map the fields.

    enter image description here

    Content data: Select the fields that used for your query search(content)

    File name: Select the field holding file name, if is not present rebuild the index with filename field. (metadata_storage_name or metadata_storage_path)

    Title: Select the title field(metadata_title)

    URL: Select storage path field(metadata_storage_path)

    Next, save the data source and give the search query.

    Output:

    enter image description here