Azure OpenAI responses based on documents in SharePoint

Jamil Hallal 21 Reputation points
2023-08-06T22:12:44.5133333+00:00

My data is a list of documents in SharePoint. I'm using one index in coginitive search to index all documents. The document library in SharePoint contains all documents uploaded by different users. how can I configure azure openai to only return responses from documents uploaded by a the user himself? Which means a can user can analyze or summarize his own documents only with no access to documents uploaded by someone else. I tried to add filter to the cognitive search in the datasources passed to openai but it didn't work, here is the code of the request that didn't work:

{
  "dataSources": [
    {
      "type": "AzureCognitiveSearch",
      "parameters": {
        "endpoint": "https://mycognitivesearch-openai.search.windows.net/indexes/myindex/docs?api-version=2023-07-01-Preview&search=*&filter=search.ismatch(%27abc title%27%2C%20%27title%27)",
        "key": "mykey",
        "indexName": "myindex",
        "roleInformation": "You are an AI assistant that helps people find information."
      }
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": "what is machine learning?"
    }
  ]
}

In the previous syntax, I tried to filter the data returned by the cognitive search to make sure OpenAI will analyze only chunks with title 'abc title' but it didn't work, i was still able to ask and receive answers of documents uploaded by someone else which should not be the case. Is there a way to add filter syntax to the cognitive search when passing the dataSources to Azure OpenAI?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,081 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.