microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.58k stars 2.46k forks source link

make it possible to open the citation link refer to the metadata of Azure BLOB storage file #424

Open k-suminaga opened 9 months ago

k-suminaga commented 9 months ago

Hello Teams. I would like to express my utmost respect for the significant contributions made by the participants of this repository.

I've made modifications to our fork repository related to this issue. I'd appreciate it if you could consider merging these changes into the main repository.

  1. set URL for the file as a metadata in Azure BLOB storage.

image

  1. utilize URL info from metadata for citation link.

image

  1. open url with new tab when click link

image

lauramartinazure commented 9 months ago

Hey! I am trying to reproduce this - how did you reference the new 'url' metadata in your Azure AI Studio indexer?

k-suminaga2 commented 9 months ago

@lauramartinazure

how did you reference the new 'url' metadata in your Azure AI Studio indexer?

We added fieldMappings setting.

{
  "@odata.context": "https://a1b2-cs-test-01.search.windows.net/$metadata#indexers/$entity",
  "@odata.etag": "\"0x8DBF202DF18629A\"",
  "name": "c2h1-indexer",
  "description": "",
  "dataSourceName": "c2h1",
  "skillsetName": null,
  "targetIndexName": "c2h1-index",
  "disabled": null,
  "schedule": null,
  "parameters": {
    "batchSize": null,
    "maxFailedItems": 0,
    "maxFailedItemsPerBatch": 0,
    "base64EncodeKeys": null,
    "configuration": {
      "dataToExtract": "contentAndMetadata",
      "parsingMode": "default"
    }
  },
  "fieldMappings": [
    {
      "sourceFieldName": "metadata_storage_path",
      "targetFieldName": "metadata_storage_path",
      "mappingFunction": {
        "name": "base64Encode",
        "parameters": null
      }
    },
+ {
+   "sourceFieldName": "url",
+   "targetFieldName": "url",
+   "mappingFunction": null
+ }
  ],
  "outputFieldMappings": [],
  "cache": null,
  "encryptionKey": null
}

We also added a url field to the corresponding index.

image

Then we searched for related text and the URL was returned.

image

Thank you.

lauramartinazure commented 9 months ago

@k-suminaga2 did you create your index and indexer directly in Azure Search Service or was this automatically configured through the Azure AI Studio GUI?

Thanks!

k-suminaga2 commented 9 months ago

@lauramartinazure I created index and indexer directly in Azure Search Service.

Thank you.

Matleo commented 4 months ago

Ist this post related to the "AZURE_SEARCH_URL_COLUMN" ENV Variable?

Why is it "not currently in use?" Do you plan on making this ENV Variable usable?

image

Screenshot taken from here: https://github.com/microsoft/sample-app-aoai-chatGPT/blob/main/README.md