无法更新QnA制造商中的知识

时间:2020-06-01 09:22:20

标签: azure azure-cognitive-services qnamaker

无法更新QnA制造商中的知识,而我能够将数据添加到我的知识库中。下面是与更新相关的REQUEST对象 参考:https://github.com/Azure-Samples/cognitive-services-qnamaker-java/blob/master/update-knowledge-base.java



    {
      "update": {
        "qnaList": [
          {
            "id": 0,
            "answer": "[92 Newcastle Court Roanoke, VA 24012](https://www.google.com/)",
            "questions": [
              "Where is Virginia  located",
              "What is the address of Roanoke",
              "Roanoke  address",
              "Roanoke location"
            ],
            "metadata": [
              {
                "name": "fragmenttype",
                "value": "location"
              },
              {
                "name": "locationname",
                "value": "Roanoke"
              },
              {
                "name": "type",
                "value": "locationinfo"
              }
            ]
          },
          {
            "id": 1,
            "answer": "[880 Oakwood St.Billerica, MA 01821](https://www.google.com/)",
            "questions": [
              "Where is Billerica  located",
              "What is the address of Billerica",
              "Billerica  address",
              "Billerica location"
            ],
            "metadata": [
              {
                "name": "fragmenttype",
                "value": "location"
              },
              {
                "name": "locationname",
                "value": "Billerica"
              },
              {
                "name": "type",
                "value": "locationinfo"
              }
            ]
          }
        ]
      }
    }

,错误响应为:



    {
        "error": {
            "code": 12,
            "message": "Parameter is null",
            "target": null,
            "details": null,
            "innerError": null
        }
    }

1 个答案:

答案 0 :(得分:1)

您的API调用应采用以下格式。 可以找到更多信息here

 "update": {
    "name": "QnA Maker FAQ Prompts Bot",
    "qnaList": [
      {
        "id": 2,
        "answer": "You can use our REST apis to create a KB. See here for details: https://docs.microsoft.com/en-us/rest/api/cognitiveservices/qnamaker/knowledgebase/create",
        "source": "Custom Editorial",
        "questions": {
          "add": [],
          "delete": []
        },
        "metadata": {
          "add": [],
          "delete": []
        }
      }
    ]
}