你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Knowledgebase - Replace

替换知识库内容。

PUT {Endpoint}/qnamaker/v5.0-preview.2/knowledgebases/{kbId}

URI 参数

名称 必需 类型 说明
Endpoint
path True

string

支持的认知服务终结点 (例如,https://< qnamaker-resource-name >.api.cognitiveservices.azure.com) 。

kbId
path True

string

知识库 ID。

请求头

名称 必需 类型 说明
Ocp-Apim-Subscription-Key True

string

请求正文

名称 必需 类型 说明
qnAList True

QnADTO[]

要添加到知识库的 Q-A (QnADTO) 的列表。 Q-A ID 由服务分配,应省略。

响应

名称 类型 说明
204 No Content

HTTP 204 无内容。

Other Status Codes

ErrorResponse

错误响应。

安全性

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

示例

Successful query

Sample Request

PUT {Endpoint}/qnamaker/v5.0-preview.2/knowledgebases/9d091697-fb8c-4ed5-9ac0-35bf8273bfff


{
  "qnAList": [
    {
      "id": 0,
      "answer": "You can change the default message if you use the QnAMakerDialog. See this for details: https://docs.botframework.com/en-us/azure-bot-service/templates/qnamaker/#navtitle",
      "source": "Custom Editorial",
      "questions": [
        "How can I change the default message from QnA Maker?"
      ],
      "metadata": []
    },
    {
      "id": 0,
      "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": [
        "How do I programmatically create a KB?"
      ],
      "metadata": [
        {
          "name": "category",
          "value": "api"
        }
      ]
    }
  ]
}

Sample Response

定义

名称 说明
Context

与要更新的 Qna 关联的上下文。

Error

错误对象。 根据 Microsoft One API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

ErrorCodeType

服务器定义的一组错误代码中的一个。

ErrorResponse

错误响应。 根据 Microsoft One API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

InnerErrorModel

包含有关错误的更具体信息的对象。 根据 Microsoft One API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

MetadataDTO

名称 - 元数据的值对。

PromptDTO

提示输入答案。

Qna

QnADTO - QnaId 或 QnADTO 需要存在于 PromptDTO 对象中

QnADTO

Q-A 对象。

ReplaceKbDTO

替换 KB 操作的后正文架构。

Context

与要更新的 Qna 关联的上下文。

名称 类型 说明
isContextOnly

boolean

标记提示是否仅与上一个问题相关。 true - 不要将此 QnA 作为没有上下文 false 的查询的搜索结果包括在内 - 忽略上下文并在搜索结果中包含此 QnA

promptsToAdd

PromptDTO[]

要添加到 qna 的提示列表。

promptsToDelete

integer[]

与要删除的 qna 关联的提示列表

Error

错误对象。 根据 Microsoft One API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

名称 类型 说明
code

ErrorCodeType

服务器定义的一组错误代码中的一个。

details

Error[]

有关导致此项报告错误的特定错误的详细信息数组。

innerError

InnerErrorModel

一个 对象,该对象包含比当前对象更具体的错误信息。

message

string

错误的用户可读表示形式。

target

string

错误的目标。

ErrorCodeType

服务器定义的一组错误代码中的一个。

名称 类型 说明
BadArgument

string

EndpointKeysError

string

ExtractionFailure

string

Forbidden

string

KbNotFound

string

NotFound

string

OperationNotFound

string

QnaRuntimeError

string

QuotaExceeded

string

SKULimitExceeded

string

ServiceError

string

Unauthorized

string

Unspecified

string

ValidationFailure

string

ErrorResponse

错误响应。 根据 Microsoft One API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

名称 类型 说明
error

Error

错误对象。

InnerErrorModel

包含有关错误的更具体信息的对象。 根据 Microsoft One API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

名称 类型 说明
code

string

比包含的错误提供的错误代码更具体的代码。

innerError

InnerErrorModel

一个 对象,该对象包含比当前对象更具体的错误信息。

MetadataDTO

名称 - 元数据的值对。

名称 类型 说明
name

string

元数据名称。

value

string

元数据值。

PromptDTO

提示输入答案。

名称 类型 说明
displayOrder

integer

提示索引 - 用于对提示进行排序

displayText

string

显示用于表示后续问题提示的文本

qna

Qna

QnADTO - QnaId 或 QnADTO 需要存在于 PromptDTO 对象中

qnaId

integer

对应于提示的 Qna ID - 如果存在 QnaId,则忽略 QnADTO 对象。

Qna

QnADTO - QnaId 或 QnADTO 需要存在于 PromptDTO 对象中

名称 类型 说明
answer

string

回复短信

context

Context

QnA 的上下文

id

integer

Q-A 的唯一 ID。

lastUpdatedTimestamp

string

上次更新 QnA 时的时间戳。

metadata

MetadataDTO[]

与答案关联的元数据列表。

questions

string[]

与答案关联的问题列表。

source

string

Q-A 从中编制索引的源。例如 https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs

QnADTO

Q-A 对象。

名称 类型 说明
answer

string

回复短信

context

Context

QnA 的上下文

id

integer

Q-A 的唯一 ID。

lastUpdatedTimestamp

string

上次更新 QnA 时的时间戳。

metadata

MetadataDTO[]

与答案关联的元数据列表。

questions

string[]

与答案关联的问题列表。

source

string

Q-A 从中编制索引的源。例如 https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs

ReplaceKbDTO

替换 KB 操作的后正文架构。

名称 类型 说明
qnAList

QnADTO[]

要添加到知识库的 Q-A (QnADTO) 的列表。 Q-A ID 由服务分配,应省略。