Knowledgebase - Download
Unduh basis pengetahuan.
GET {Endpoint}/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna
GET {Endpoint}/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna?source={source}&changedSince={changedSince}
Parameter URI
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
Endpoint
|
path | True |
|
Titik akhir Cognitive Services yang didukung (misalnya, https://< qnamaker-resource-name> .api.cognitiveservices.azure.com). |
|
environment
|
path | True |
Menentukan apakah lingkungan adalah Uji atau Prod. |
|
|
kb
|
path | True |
|
Id pangkalan pengetahuan. |
|
changed
|
query |
|
properti changedSince digunakan untuk mengembalikan semua QnA yang dibuat atau diperbarui setelah durasi waktu tertentu. Pengguna dapat memfilter QnA menurut detik (s), menit (m), jam (h) dan hari (d). Pengguna dapat menggunakan nilai integral apa pun bersama dengan akhiran untuk waktu. Misalnya, nilai 5m mengembalikan semua pasangan TJ yang diperbarui atau dibuat dalam 5 menit terakhir. |
|
|
source
|
query |
|
Filter properti sumber yang akan diterapkan. Nilai sampel: Editorial, smartLight%20FAQ.tsv . |
Header Permintaan
| Name | Required | Type | Description |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | True |
|
Respons
| Name | Type | Description |
|---|---|---|
| 200 OK |
Koleksi semua Q-A di pangkalan pengetahuan. |
|
| Other Status Codes |
Respons kesalahan. |
Keamanan
Ocp-Apim-Subscription-Key
Type:
apiKey
In:
header
Contoh
Successful query
Sample Request
GET {Endpoint}/qnamaker/v4.0/knowledgebases/9d091697-fb8c-4ed5-9ac0-35bf8273bfff/Test/qna
Sample Response
{
"qnaDocuments": [
{
"id": 1,
"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": [],
"context": {
"isContextOnly": false,
"prompts": []
}
},
{
"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": [
"How do I programmatically create a KB?"
],
"metadata": [
{
"name": "category",
"value": "api"
}
],
"context": {
"isContextOnly": false,
"prompts": [
{
"displayOrder": 1,
"qnaId": 3,
"displayText": "Update KB"
}
]
}
},
{
"id": 3,
"answer": "You can use our REST apis to update your KB. See here for details: https://docs.microsoft.com/en-us/rest/api/cognitiveservices/qnamaker/knowledgebase/update",
"source": "Editorial",
"questions": [
"How do I programmatically update my KB?"
],
"metadata": [
{
"name": "category",
"value": "api"
}
],
"context": {
"isContextOnly": false,
"prompts": [
{
"displayOrder": 1,
"qnaId": 4,
"displayText": "Refresh Endpoint Keys"
}
]
}
},
{
"id": 4,
"answer": "You can use our REST apis to refresh endpoint keys. See here for details: https://docs.microsoft.com/en-us/rest/api/cognitiveservices/qnamaker/endpointkeys/refreshkeys",
"source": "Editorial",
"questions": [
"How do I programmatically refresh endpoint keys?"
],
"metadata": [],
"context": {
"isContextOnly": false,
"prompts": []
}
}
]
}
Definisi
| Context |
Konteks QnA |
|
Environment |
Menentukan apakah lingkungan adalah Uji atau Prod. |
| Error |
Objek kesalahan. Sesuai panduan Microsoft One API - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. |
|
Error |
Salah satu set kode kesalahan yang ditentukan server. |
|
Error |
Respons kesalahan. Sesuai panduan Microsoft One API - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. |
|
Inner |
Objek yang berisi informasi yang lebih spesifik tentang kesalahan tersebut. Sesuai panduan Microsoft One API - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. |
| MetadataDTO |
Nama - pasangan nilai metadata. |
| PromptDTO |
Minta jawaban. |
| Qna |
QnADTO - Baik QnaId atau QnADTO perlu ada dalam objek PromptDTO |
|
Qn |
Daftar QnADTO |
| QnADTO |
Objek Q-A. |
Context
Konteks QnA
| Name | Type | Description |
|---|---|---|
| isContextOnly |
|
Untuk menandai apakah perintah hanya relevan dengan pertanyaan sebelumnya atau tidak. true - Jangan sertakan QnA ini sebagai hasil pencarian untuk kueri tanpa konteks false - mengabaikan konteks dan menyertakan QnA ini dalam hasil pencarian |
| prompts |
Daftar perintah yang terkait dengan jawabannya. |
EnvironmentType
Menentukan apakah lingkungan adalah Uji atau Prod.
| Name | Type | Description |
|---|---|---|
| Prod |
|
|
| Test |
|
Error
Objek kesalahan. Sesuai panduan Microsoft One API - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
| Name | Type | Description |
|---|---|---|
| code |
Salah satu set kode kesalahan yang ditentukan server. |
|
| details |
|
Array detail tentang kesalahan tertentu yang menyebabkan kesalahan yang dilaporkan ini. |
| innerError |
Objek yang berisi informasi yang lebih spesifik daripada objek saat ini tentang kesalahan. |
|
| message |
|
Representasi kesalahan yang dapat dibaca manusia. |
| target |
|
Target kesalahan. |
ErrorCodeType
Salah satu set kode kesalahan yang ditentukan server.
| Name | Type | Description |
|---|---|---|
| BadArgument |
|
|
| EndpointKeysError |
|
|
| ExtractionFailure |
|
|
| Forbidden |
|
|
| KbNotFound |
|
|
| NotFound |
|
|
| OperationNotFound |
|
|
| QnaRuntimeError |
|
|
| QuotaExceeded |
|
|
| SKULimitExceeded |
|
|
| ServiceError |
|
|
| Unauthorized |
|
|
| Unspecified |
|
|
| ValidationFailure |
|
ErrorResponse
Respons kesalahan. Sesuai panduan Microsoft One API - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
| Name | Type | Description |
|---|---|---|
| error |
Objek kesalahan. |
InnerErrorModel
Objek yang berisi informasi yang lebih spesifik tentang kesalahan tersebut. Sesuai panduan Microsoft One API - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
| Name | Type | Description |
|---|---|---|
| code |
|
Kode kesalahan yang lebih spesifik daripada yang disediakan oleh kesalahan yang berisi. |
| innerError |
Objek yang berisi informasi yang lebih spesifik daripada objek saat ini tentang kesalahan. |
MetadataDTO
Nama - pasangan nilai metadata.
| Name | Type | Description |
|---|---|---|
| name |
|
Nama metadata. |
| value |
|
Nilai metadata. |
PromptDTO
Minta jawaban.
| Name | Type | Description |
|---|---|---|
| displayOrder |
|
Indeks perintah - digunakan dalam urutan perintah |
| displayText |
|
Teks ditampilkan untuk mewakili petunjuk pertanyaan tindak lanjut |
| qna |
QnADTO - Baik QnaId atau QnADTO perlu ada dalam objek PromptDTO |
|
| qnaId |
|
Id Qna yang sesuai dengan perintah - jika QnaId ada, objek QnADTO diabaikan. |
Qna
QnADTO - Baik QnaId atau QnADTO perlu ada dalam objek PromptDTO
QnADocumentsDTO
Daftar QnADTO
| Name | Type | Description |
|---|---|---|
| qnaDocuments |
|
Daftar jawaban. |
QnADTO
Objek Q-A.
| Name | Type | Description |
|---|---|---|
| answer |
|
Teks jawaban |
| context |
Konteks QnA |
|
| id |
|
Id unik untuk Q-A. |
| metadata |
Daftar metadata yang terkait dengan jawabannya. |
|
| questions |
|
Daftar pertanyaan yang terkait dengan jawabannya. |
| source |
|
Sumber tempat Q-A diindeks. Misalnya. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs |