Share via


Knowledgebase - Replace

取代知識庫內容。

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

URI 參數

名稱 位於 必要 類型 Description
Endpoint
path True

string

支持的認知服務端點 (例如,https://< qnamaker-resource-name >.api.cognitiveservices.azure.com) 。

kbId
path True

string

知識庫標識碼。

要求標頭

名稱 必要 類型 Description
Ocp-Apim-Subscription-Key True

string

要求本文

名稱 必要 類型 Description
qnAList True

QnADTO[]

要新增至知識庫的 Q-A (QnADTO) 清單。 Q-A 標識碼是由服務指派,而且應該省略。

回應

名稱 類型 Description
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

定義

名稱 Description
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 相關聯的內容。

名稱 類型 Description
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

名稱 類型 Description
code

ErrorCodeType

其中一組伺服器定義的錯誤碼。

details

Error[]

導致此錯誤之特定錯誤的詳細數據陣列。

innerError

InnerErrorModel

物件,包含比目前對象有關錯誤的更特定資訊。

message

string

人類看得懂的錯誤表示法。

target

string

錯誤的目標。

ErrorCodeType

其中一組伺服器定義的錯誤碼。

名稱 類型 Description
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

名稱 類型 Description
error

Error

錯誤物件。

InnerErrorModel

物件,包含有關錯誤的更特定資訊。 根據 Microsoft One API 指導方針 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

名稱 類型 Description
code

string

比包含的錯誤所提供的更具體錯誤碼。

innerError

InnerErrorModel

物件,包含比目前對象有關錯誤的更特定資訊。

MetadataDTO

名稱 -元數據的值組。

名稱 類型 Description
name

string

中繼資料名稱。

value

string

中繼資料值。

PromptDTO

提示輸入答案。

名稱 類型 Description
displayOrder

integer

提示的索引 - 用於提示的順序

displayText

string

顯示代表後續問題提示的文字

qna

Qna

QnADTO - QnaId 或 QnADTO 必須存在於 PromptDTO 物件中

qnaId

integer

對應至提示的 Qna 識別碼 - 如果 QnaId 存在,則會忽略 QnADTO 物件。

Qna

QnADTO - QnaId 或 QnADTO 必須存在於 PromptDTO 物件中

名稱 類型 Description
answer

string

回應簡訊

context

Context

QnA 的內容

id

integer

Q-A 的唯一標識碼。

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 物件。

名稱 類型 Description
answer

string

回應簡訊

context

Context

QnA 的內容

id

integer

Q-A 的唯一標識碼。

lastUpdatedTimestamp

string

上次更新 QnA 時的時間戳。

metadata

MetadataDTO[]

與答案相關聯的元數據清單。

questions

string[]

與答案相關聯的問題清單。

source

string

Q-A 編製索引的來源。例如 https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs

ReplaceKbDTO

取代 KB 作業的後文架構。

名稱 類型 Description
qnAList

QnADTO[]

要新增至知識庫的 Q-A (QnADTO) 清單。 Q-A 標識碼是由服務指派,而且應該省略。