Azure open AI chat/completions endpoint ResponseText contains [doc1], [doc2] along with the text. what does it means

Chandrashekar Machipeddi 0 Reputation points
2024-06-25T11:20:46.16+00:00

Hi,

We are using the Azure Open AI chat/Completions end point to get the search results from the Azure Index.

In the response text we are getting the citations along with the responsetext. In Response we have observed that there are some specific references, below is the sample responseText

"The agreement stipulates that the advance amount for Capital Improvements is $1,000,000.00 [doc3][doc4]. However, the customer has requested that the limit for Capital Improvements Advances be $1,500,000.00 [doc1]."

So we would like to know how doc references (doc1, doc2..) are shown in the response text and also how to tie these references with the citations ?

Regards

Chandra shekar.M

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

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 48,156 Reputation points
    2024-06-30T10:22:58.7366667+00:00

    Hello Chandra,

    Thanks for reaching out to us, the response text containing references like [doc1], [doc2], etc., alongside the regular text indicates the presence of citations or document references related to the information provided in the response. These references are typically placeholders or markers that point to specific documents or sources where the information mentioned in the response can be found.

    1. Meaning of [doc1], [doc2], etc.

    Placeholder References: [doc1], [doc2], etc., are placeholders used within the response text to denote citations or document identifiers. They do not represent the actual document content but rather serve as markers or tags.

    Dynamic Document Links: In some applications or systems, these placeholders might be replaced with actual hyperlinks or references to specific documents when presented to the end user. For example, clicking on [doc1] might lead to a detailed view or summary of the document referenced as "doc1".

    1. Tying References with Citations

    To tie these references ([doc1], [doc2], etc.) with actual citations or documents:

    • Data Integration: Ensure that your application or system has integration logic that associates these placeholders with actual document metadata or links. This integration might involve querying a document database or search index to retrieve detailed information about each referenced document.
    • Response Parsing: When handling the response from the Azure Open AI chat/completions endpoint, your application should parse the response text and identify these placeholders. It can then retrieve corresponding metadata or links from your document management system or database.
    • Display and Interaction: Implement a user interface that dynamically links or displays these references in a meaningful way. Users should be able to interact with these references to access more information about the cited documents.

    Assuming your application receives the response:

    "The agreement stipulates that the advance amount for Capital Improvements is $1,000,000.00 [doc3][doc4]. However, the customer has requested that the limit for Capital Improvements Advances be $1,500,000.00 [doc1]."
    

    Your application could:

    • Parse the response text to identify [doc1], [doc3], etc.
    • Query your document index or database to fetch metadata (like title, summary, link) for each referenced document.
    • Present these references alongside the response text, allowing users to click or hover over them to access more information.

    I hope this helps, please let us know if you have more questions.

    Regards,

    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.