Missing document links in responses from OpenAIClient with AzureCognitiveSearch extension

AdityaSa 801 Reputation points
2023-09-30T06:19:30.8833333+00:00

I am using the OpenAIClient with the AzureCognitiveSearch extension, which has populated its index with the SharePoint indexer. When the responses come back, we get normal citations in the response, such as [doc1], [doc2], etc., but the actual reference later does not give the URL/filename. It returns 'Link to Document 1', 'Link to Document 2', etc. How can we replace 'Link to Document 1' with the actual document name/URI? Where do we get this information as it is passed into the request by the extension?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,328 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ramr-msft 17,621 Reputation points
    2023-09-30T16:05:09.2933333+00:00

    @Aditya56 Thanks for the question, Can you please share the code and JSON payload.

    The following link demonstrates the general end-to-end data flow of fetching citation information from the context messages of a response

    https://learn.microsoft.com/en-us/azure/ai-services/openai/use-your-data-quickstart?tabs=command-line&pivots=programming-language-csharp#without-response-streaming

    0 comments No comments

  2. Ramr-msft 17,621 Reputation points
    2023-10-04T14:59:58.06+00:00

    Thanks, The citation information is present on the "context" field of response messages (delta for streaming) and the JSON payload that features citation information is available there.

    User's image

    0 comments No comments