When a link is included in an Azure AI chat response, the link is not valid

KIDU 0 Reputation points
2023-12-01T05:05:08.8366667+00:00

Hello

I am developing a chatbot for Teams using the "gpt-35-turbo-16k" model of Azure AI Chat.

We are currently training the chatbot to use a cognitive search index as a data source and verifying the content of the responses.

If a hyperlink is included in the response text, the URL will be only the title name and the link will not be valid.

For links, I would like to specify the full path address "metadata_spo_item_weburi" in the index as the URL.

What should I do?

http request


https://***.openai.azure.com/openai/deployments/***/extensions/chat/completions?api-version=2023-09-01-preview
{
  "dataSources": [
    {
      "parameters": {
        "endpoint": "https://***.search.windows.net",
        "indexName": "sharepoint-index",
        "key": "****",
        "queryType": "semantic",
        "semanticConfiguration": "semantic**",
        "topNDocuments": 10,
        "fieldsMapping": {
          "titleField": "metadata_spo_item_name",
          "urlField": "metadata_spo_item_weburi",
          "filepathField": "metadata_spo_item_weburi",
          "inScope": true,
          "contentFields": [
            "content"
          ],
          "contentFieldsSeparator": "\n"
        }
      },
      "type": "AzureCognitiveSearch"
    }
  ],
  "messages": [
    {
      "content": "PM研修の資料一覧をください",
      "role": "user"
    }
  ],
  "temperature": 0,
  "top_p": 1,
  "frequency_penalty": 1,
  "presence_penalty": 0.4,
  "max_tokens": 2000,
  "stop": null
}


{
  "id": "***",
  "model": "gpt-35-turbo-16k",
  "created": 1111,
  "object": "extensions.chat.completion",
  "choices": [
    {
      "index": 0,
      "finish_reason": "stop",
      "message": {
        "role": "assistant",
        "content": "以下はPM研修の資料一覧です:\n\n1. [03_PM研修_リスク管理の実践.pptx](03_PM研修_リスク管理の実践.pptx)\n   -。\n\n2. [02_PM研修_ト゛キュメントの実践.pptx](file:///02_PM研修_ト゛キュメントの実践.pptx)\n   ",
        "end_turn": true,
        "context": {
          "messages": [
            {
              "role": "tool",
              "content": "****",
              "end_turn": false
            }
          ]
        }
      }
    }
  ]
}

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

1 answer

Sort by: Most helpful
  1. KIDU 0 Reputation points
    2023-12-01T10:11:43.96+00:00

    thank you for contacting.

    There is no problem with the cognitive search index, and the URL is included in the URL field.

    index

       "value": [
         {
           "@search.score": 1,
           "metadata_spo_item_name": "doc1.pptx",
           "metadata_spo_item_weburi": "https://***.sharepoint.com/sites/**/_layouts/15/Doc.aspx?sourcedoc=*******
           ....
         },
    

    The problem is that the link included in the GPT answer is as follows.

    ["metadata_spo_item_name"] (file://"metadata_spo_item_name")

    ex) [doc1.pptx] (file://doc1.pptx)

    I would like to change this to the pattern below.

    "metadata_spo_item_name"
    ex) [doc1.pptx] (https://.sharepoint.com/sites/**/_layouts/15/Doc.aspx?sourcedoc=*******)


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.