從 QNA Maker 知識庫取得答案

注意

Azure Open AI On Your Data 會利用大型語言模型 (LLM) 來產生與 QnA Maker 類似的結果。 如果您想要將 QnA Maker 專案移轉至 Azure Open AI On Your Data,請參閱我們的 指南

注意

QnA Maker 服務即將於 2025 年 3 月 31 日淘汰。 較新版的問題和解答功能現在隨附於 Azure AI 語言。 如需瞭解語言服務內的問題解答功能,請參閱問題解答。 從 2022 年 10 月 1 日開始,您將無法建立新的 QnA Maker 資源。 如需將現有 QnA Maker 知識庫移轉至問題解答的相關資訊,請參閱移轉指南

注意

本文件不適用於最新版本。 若要瞭解如何使用最新的問題解答 API,請參閱問題解答撰寫指南

這個以 cURL 為基礎的快速入門會逐步引導您從知識庫取得答案。

必要條件

  • 您必須具有
    • 最新 cURL
    • 如尚未擁有 Azure 訂用帳戶,請在開始之前先建立免費帳戶
  • 在 Azure 入口網站中建立 QnA Maker 資源。 請記住您在建立資源時選取的 Microsoft Entra 識別碼、訂用帳戶、QnA 資源名稱。
  • 先前的快速入門中已定型並發佈的知識庫,其中具有問題與答案並已使用中繼資料和閒聊資料加以設定。

注意

當您準備好從知識庫產生問題的答案時,就必須定型發佈知識庫。 發佈知識庫時,[發佈] 頁面會顯示用來產生答案的 HTTP 要求設定。 [cURL] 索引標籤會顯示從命令列工具產生答案所需的設定。

使用中繼資料來篩選答案

使用先前的知識庫來根據中繼資料快速查詢答案。

  1. 從知識庫的 [設定] 頁面,選取 [CURL] 索引標籤來查看用來從知識庫產生答案的 cURL 命令範例。

  2. 將命令複製到可編輯的環境 (例如文字檔) 以便編輯命令。 如下所示編輯問題值,以將 service:qna_maker 的中繼資料作為 QnA 配對的篩選條件。

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'top':30, 'question':'size','strictFilters': [{'name':'service','value':'qna_maker'}]}"
    

    此問題就只有一個字 size,其可以傳回兩個 QnA 配對的其中一個。 strictFilters 陣列會辨別回應,而將回應減少到只剩 qna_maker 答案。

  3. 回應只會包含符合篩選準則的答案。 下列 cURL 回應已經過格式化,以方便您閱讀:

    {
        "answers": [
            {
                "questions": [
                    "How large a knowledge base can I create?",
                    "What is the max size of a knowledge base?",
                    "How many GB of data can a knowledge base hold?"
                ],
                "answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.",
                "score": 68.76,
                "id": 3,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [
                    {
                        "name": "link_in_answer",
                        "value": "true"
                    },
                    {
                        "name": "service",
                        "value": "qna_maker"
                    }
                ],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": null
    }
    

    如果有不符合搜尋字詞但符合篩選條件的問答組,則不會傳回。 相反地,會傳回一般性答案 No good match found in KB.

使用 debug 查詢屬性

注意

不建議針對任何相依性使用 Debug 屬性。 已新增此屬性以協助產品小組進行疑難排解。

偵錯資訊可協助您了解所傳回答案的判斷方式。 此資訊雖然有用,但並非必要。 若要使用偵錯資訊來產生答案,請新增 debug 屬性:

Debug: {Enable:true}
  1. 編輯 cURL 命令以納入 debug 屬性來查看詳細資訊。

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'size', 'Debug':{'Enable':true}}"
    
  2. 回應包含答案的相關資訊。 在下列 JSON 輸出中,某些偵錯詳細資料已取代為省略號以求簡潔。

    {
        "answers": [
            {
                "questions": [
                    "How do I share a knowledge base with others?"
                ],
                "answer": "Sharing works at the level of a QnA Maker service, that is, all knowledge bases in the service will be shared.",
                "score": 56.07,
                "id": 5,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": {
            "userQuery": {
                "question": "How do I programmatically update my Knowledge Base?",
                "top": 1,
                "userId": null,
                "strictFilters": [],
                "isTest": false,
                "debug": {
                    "enable": true,
                    "recordL1SearchLatency": false,
                    "mockQnaL1Content": null
                },
                "rankerType": 0,
                "context": null,
                "qnaId": 0,
                "scoreThreshold": 0.0
            },
            "rankerInfo": {
                "specialFuzzyQuery": "how do i programmatically~6 update my knowledge base",
                "synonyms": "what s...",
                "rankerLanguage": "English",
                "rankerFileName": "https://qnamakerstore.blob.core.windows.net/qnamakerdata/rankers/ranker-English.ini",
                "rankersDirectory": "D:\\home\\site\\wwwroot\\Data\\QnAMaker\\rd0003ffa60fc45.24.0\\RankerData\\Rankers",
                "allQnAsfeatureValues": {
                    "WordnetSimilarity": {
                        "5": 0.54706300120043716,...
                    },
                    ...
                },
                "rankerVersion": "V2",
                "rankerModelType": "TreeEnsemble",
                "rankerType": 0,
                "indexResultsCount": 25,
                "reRankerResultsCount": 1
            },
            "runtimeVersion": "5.24.0",
            "indexDebugInfo": {
                "indexDefinition": {
                    "name": "064a4112-bd65-42e8-b01d-141c4c9cd09e",
                    "fields": [...
                    ],
                    "scoringProfiles": [],
                    "defaultScoringProfile": null,
                    "corsOptions": null,
                    "suggesters": [],
                    "analyzers": [],
                    "tokenizers": [],
                    "tokenFilters": [],
                    "charFilters": [],
                    "@odata.etag": "\"0x8D7A920EA5EE6FE\""
                },
                "qnaCount": 117,
                "parameters": {},
                "azureSearchResult": {
                    "continuationToken": null,
                    "@odata.count": null,
                    "@search.coverage": null,
                    "@search.facets": null,
                    "@search.nextPageParameters": null,
                    "value": [...],
                    "@odata.nextLink": null
                }
            },
            "l1SearchLatencyInMs": 0,
            "qnaL1Results": {...}
        },
        "activeLearningEnabled": true
    }
    

使用測試知識庫

如果您想要從測試知識庫取得答案,請使用 isTest 主體屬性。

屬性是布林值。

isTest:true

cURL 命令看起來像這樣:

curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'size', 'IsTest':true}"

JSON 回應會使用與所發佈知識庫查詢相同的結構描述。

注意

如果測試知識庫和所發佈的知識庫完全相同,但因為資源的所有知識庫會共用測試索引,所以其中可能還是會有些微變化。

使用 cURL 查詢閒聊答案

  1. 在支援 cURL 的終端機中,將 Thank you 之類以 Bot 對話結尾的使用者陳述作為問題。 除此之外,沒有任何其他要設定的屬性。

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'thank you'}"
    
  2. 執行 Curl 命令並接收 JSON 回應,包括分數和答案。

    {
      "answers": [
          {
              "questions": [
                  "I thank you",
                  "Oh, thank you",
                  "My sincere thanks",
                  "My humblest thanks to you",
                  "Marvelous, thanks",
                  "Marvelous, thank you kindly",
                  "Marvelous, thank you",
                  "Many thanks to you",
                  "Many thanks",
                  "Kthx",
                  "I'm grateful, thanks",
                  "Ahh, thanks",
                  "I'm grateful for that, thank you",
                  "Perfecto, thanks",
                  "I appreciate you",
                  "I appreciate that",
                  "I appreciate it",
                  "I am very thankful for that",
                  "How kind, thank you",
                  "Great, thanks",
                  "Great, thank you",
                  "Gracias",
                  "Gotcha, thanks",
                  "Gotcha, thank you",
                  "Awesome thanks!",
                  "I'm grateful for that, thank you kindly",
                  "thank you pal",
                  "Wonderful, thank you!",
                  "Wonderful, thank you very much",
                  "Why thank you",
                  "Thx",
                  "Thnx",
                  "That's very kind",
                  "That's great, thanks",
                  "That is lovely, thanks",
                  "That is awesome, thanks!",
                  "Thanks bot",
                  "Thanks a lot",
                  "Okay, thanks!",
                  "Thank you so much",
                  "Perfect, thanks",
                  "Thank you my friend",
                  "Thank you kindly",
                  "Thank you for that",
                  "Thank you bot",
                  "Thank you",
                  "Right on, thanks very much",
                  "Right on, thanks a lot",
                  "Radical, thanks",
                  "Rad, thanks",
                  "Rad thank you",
                  "Wonderful, thanks!",
                  "Thanks"
              ],
              "answer": "You're welcome.",
              "score": 100.0,
              "id": 75,
              "source": "qna_chitchat_Professional.tsv",
              "metadata": [
                  {
                      "name": "editorial",
                      "value": "chitchat"
                  }
              ],
              "context": {
                  "isContextOnly": false,
                  "prompts": []
              }
          }
      ],
      "debugInfo": null,
      "activeLearningEnabled": true
    }
    

    由於 Thank you 的問題完全符合閒聊問題,因此QnA Maker 完全信賴 100 這個分數。 QnA Maker 也會傳回所有相關問題,以及包含閒聊中繼資料標記的中繼資料屬性。

使用閾值和預設答案

您可以針對答案要求最小的閾值。 如果不符合閾值,便傳回預設的答案。

  1. 新增 threshold 屬性來要求閾值為 80% 以上的 size 答案。 因為問題的分數是 71%,所以知識庫應該不會找到該答案。 結果會傳回您在建立知識庫時所提供的預設答案。

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'size', 'scoreThreshold':80.00}"
    
  2. 執行 cURL 命令並接收 JSON 回應。

    {
        "answers": [
            {
                "questions": [],
                "answer": "No good match found in KB.",
                "score": 0.0,
                "id": -1,
                "source": null,
                "metadata": []
            }
        ],
        "debugInfo": null,
        "activeLearningEnabled": true
    }
    

    QnA Maker 會傳回代表沒有信心的 0 分。 它也會傳回預設答案。

  3. 將閾值變更為 60%,然後再次要求查詢:

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'size', 'scoreThreshold':60.00}"
    

    傳回的 JSON 找到了答案。

    {
        "answers": [
            {
                "questions": [
                    "How large a knowledge base can I create?",
                    "What is the max size of a knowledge base?",
                    "How many GB of data can a knowledge base hold?"
                ],
                "answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.",
                "score": 71.1,
                "id": 3,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [
                    {
                        "name": "link_in_answer",
                        "value": "true"
                    },
                    {
                        "name": "server",
                        "value": "qna_maker"
                    }
                ],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": null,
        "activeLearningEnabled": true
    }
    

使用非結構化資料來源

我們現可支援新增無法用來擷取 QnA 非結構化文件的能力。 當擷取回應給查詢時,使用者可以選擇在 GenerateAnswer API 中包含或排除非結構化資料集。 我們不支援 GA 服務中的非結構化資料集,該資料集只包含在自訂問題解答中。

這個以 Postman 為基礎的快速入門會逐步引導您從知識庫取得答案。

必要條件

  • 您必須具有
    • 最新的 Postman \(英文\)。
    • 如尚未擁有 Azure 訂用帳戶,請在開始之前先建立免費帳戶
  • 在 Azure 入口網站中建立 QnA Maker 資源。 請記住您在建立資源時選取的 Microsoft Entra 識別碼、訂用帳戶、QnA 資源名稱。
  • 先前的快速入門中已定型並發佈的知識庫,其中具有問題與答案並已使用中繼資料和閒聊資料加以設定。

注意

當您準備好從知識庫產生問題的答案時,就必須定型發佈知識庫。 發佈知識庫時,[發佈] 頁面會顯示用來產生答案的 HTTP 要求設定。 [Postman] 索引標籤會顯示為了產生答案所需的設定。

針對要求來設定 Postman

本快速入門會針對 Postman 的 POST 要求使用相同設定,然後根據您所嘗試查詢的內容來設定為傳送至服務的 POST 主體 JSON。

使用此程序來設定 Postman,然後閱讀後續各節以設定 POST 主體 JSON。

  1. 從知識庫的 [設定] 頁面,選取 [Postman] 索引標籤來查看用來從知識庫產生答案的設定。 複製下列要用於 Postman 的資訊。

    名稱 設定 目的和值
    POST /knowledgebases/replace-with-your-knowledge-base-id/generateAnswer 這是 URL 的 HTTP 方法和路由。
    Host https://YOUR-RESOURCE_NAME.azurewebsites.net/qnamaker 這是 URL 的主機。 串連 Host 和 Post 值,以取得完整的 generateAnswer URL。
    Authorization EndpointKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 用來向 Azure 授權要求的標頭值。
    Content-type application/json 內容的標頭值。
    {"question":"<Your question>"} POST 要求的主體,會作為 JSON 物件。 根據查詢的目的而定,在下列各節中,此值會有所變更。

    重要

    完成時,請記得從程式碼中移除金鑰,且不要公開張貼金鑰。 在生產環境中,請使用安全的方式來儲存和存取您的認證,例如 Azure Key Vault。 如需詳細資訊,請參閱 Azure AI 服務安全性一文。

  2. 開啟 Postman,並使用所發佈知識庫的設定來建立新的基本 POST 要求。 在下列各節中,修改 POST 主體 JSON 以將查詢變更為您的知識庫。

使用中繼資料來篩選答案

先前的快速入門已將中繼資料新增至兩個 QnA 配對,以區別兩個不同的問題。 將中繼資料新增至查詢,從而將篩選條件限制為只有相關的 QnA 配對。

  1. 在 Postman 中,藉由使用 service:qna_maker 的名稱/值組來新增 strictFilters 屬性,從而只變更查詢 JSON。 主體 JSON 應該是:

    {
        'question':'size',
        'strictFilters': [
            {
                'name':'service','value':'qna_maker'
            }
        ]
    }
    

    此問題就只有一個字 size,其可以傳回兩個問答組的其中一個。 strictFilters 陣列會辨別回應,而將回應減少到只剩 qna_maker 答案。

  2. 回應只會包含符合篩選準則的答案。

    下列回應已經過格式化,以方便您閱讀:

    {
        "answers": [
            {
                "questions": [
                    "How large a knowledge base can I create?",
                    "What is the max size of a knowledge base?",
                    "How many GB of data can a knowledge base hold?"
                ],
                "answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.",
                "score": 68.76,
                "id": 3,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [
                    {
                        "name": "link_in_answer",
                        "value": "true"
                    },
                    {
                        "name": "service",
                        "value": "qna_maker"
                    }
                ],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": null
    }
    

    如果有不符合搜尋詞彙但符合篩選條件的問答組,則不會傳回。 相反地,會傳回一般性答案 No good match found in KB.

使用 debug 查詢屬性

注意

不建議針對任何相依性使用 Debug 屬性。 已新增此屬性以協助產品小組進行疑難排解。

偵錯資訊可協助您了解所傳回答案的判斷方式。 此資訊雖然有用,但並非必要。 若要使用偵錯資訊來產生答案,請新增 debug 屬性:

  1. 在 Postman 中,藉由新增 debug 屬性而僅變更本文 JSON。 JSON 應為:

    {
        'question':'size',
        'Debug': {
            'Enable':true
        }
    
    }
    
  2. 回應包含答案的相關資訊。 在下列 JSON 輸出中,某些偵錯詳細資料已取代為省略號。

    {
        "answers": [
            {
                "questions": [
                    "How do I share a knowledge base with others?"
                ],
                "answer": "Sharing works at the level of a QnA Maker service, that is, all knowledge bases in the service will be shared.",
                "score": 56.07,
                "id": 5,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": {
            "userQuery": {
                "question": "How do I programmatically update my Knowledge Base?",
                "top": 1,
                "userId": null,
                "strictFilters": [],
                "isTest": false,
                "debug": {
                    "enable": true,
                    "recordL1SearchLatency": false,
                    "mockQnaL1Content": null
                },
                "rankerType": 0,
                "context": null,
                "qnaId": 0,
                "scoreThreshold": 0.0
            },
            "rankerInfo": {
                "specialFuzzyQuery": "how do i programmatically~6 update my knowledge base",
                "synonyms": "what s...",
                "rankerLanguage": "English",
                "rankerFileName": "https://qnamakerstore.blob.core.windows.net/qnamakerdata/rankers/ranker-English.ini",
                "rankersDirectory": "D:\\home\\site\\wwwroot\\Data\\QnAMaker\\rd0003ffa60fc45.24.0\\RankerData\\Rankers",
                "allQnAsfeatureValues": {
                    "WordnetSimilarity": {
                        "5": 0.54706300120043716,...
                    },
                    ...
                },
                "rankerVersion": "V2",
                "rankerModelType": "TreeEnsemble",
                "rankerType": 0,
                "indexResultsCount": 25,
                "reRankerResultsCount": 1
            },
            "runtimeVersion": "5.24.0",
            "indexDebugInfo": {
                "indexDefinition": {
                    "name": "064a4112-bd65-42e8-b01d-141c4c9cd09e",
                    "fields": [...
                    ],
                    "scoringProfiles": [],
                    "defaultScoringProfile": null,
                    "corsOptions": null,
                    "suggesters": [],
                    "analyzers": [],
                    "tokenizers": [],
                    "tokenFilters": [],
                    "charFilters": [],
                    "@odata.etag": "\"0x8D7A920EA5EE6FE\""
                },
                "qnaCount": 117,
                "parameters": {},
                "azureSearchResult": {
                    "continuationToken": null,
                    "@odata.count": null,
                    "@search.coverage": null,
                    "@search.facets": null,
                    "@search.nextPageParameters": null,
                    "value": [...],
                    "@odata.nextLink": null
                }
            },
            "l1SearchLatencyInMs": 0,
            "qnaL1Results": {...}
        },
        "activeLearningEnabled": true
    }
    

使用測試知識庫

如果您想要從測試知識庫取得答案,請使用 isTest 主體屬性。

在 Postman 中,藉由新增 isTest 屬性以便只變更主體 JSON。 JSON 應為:

{
    'question':'size',
    'isTest': true
}

JSON 回應會使用與所發佈知識庫查詢相同的結構描述。

注意

如果測試知識庫和所發佈的知識庫完全相同,但因為資源的所有知識庫會共用測試索引,所以其中可能還是會有些微變化。

查詢閒聊答案

  1. 在 Postman 中,只將本文 JSON 變更為以對話結尾的使用者陳述。 JSON 應為:

    {
        'question':'thank you'
    }
    
  2. 回應包含分數和答案。

    {
      "answers": [
          {
              "questions": [
                  "I thank you",
                  "Oh, thank you",
                  "My sincere thanks",
                  "My humblest thanks to you",
                  "Marvelous, thanks",
                  "Marvelous, thank you kindly",
                  "Marvelous, thank you",
                  "Many thanks to you",
                  "Many thanks",
                  "Kthx",
                  "I'm grateful, thanks",
                  "Ahh, thanks",
                  "I'm grateful for that, thank you",
                  "Perfecto, thanks",
                  "I appreciate you",
                  "I appreciate that",
                  "I appreciate it",
                  "I am very thankful for that",
                  "How kind, thank you",
                  "Great, thanks",
                  "Great, thank you",
                  "Gracias",
                  "Gotcha, thanks",
                  "Gotcha, thank you",
                  "Awesome thanks!",
                  "I'm grateful for that, thank you kindly",
                  "thank you pal",
                  "Wonderful, thank you!",
                  "Wonderful, thank you very much",
                  "Why thank you",
                  "Thx",
                  "Thnx",
                  "That's very kind",
                  "That's great, thanks",
                  "That is lovely, thanks",
                  "That is awesome, thanks!",
                  "Thanks bot",
                  "Thanks a lot",
                  "Okay, thanks!",
                  "Thank you so much",
                  "Perfect, thanks",
                  "Thank you my friend",
                  "Thank you kindly",
                  "Thank you for that",
                  "Thank you bot",
                  "Thank you",
                  "Right on, thanks very much",
                  "Right on, thanks a lot",
                  "Radical, thanks",
                  "Rad, thanks",
                  "Rad thank you",
                  "Wonderful, thanks!",
                  "Thanks"
              ],
              "answer": "You're welcome.",
              "score": 100.0,
              "id": 75,
              "source": "qna_chitchat_Professional.tsv",
              "metadata": [
                  {
                      "name": "editorial",
                      "value": "chitchat"
                  }
              ],
              "context": {
                  "isContextOnly": false,
                  "prompts": []
              }
          }
      ],
      "debugInfo": null,
      "activeLearningEnabled": true
    }
    

    由於 Thank you 的問題完全符合閒聊問題,因此QnA Maker 完全信賴 100 這個分數。 QnA Maker 也會傳回所有相關問題,以及包含閒聊中繼資料標記的中繼資料屬性。

使用閾值和預設答案

您可以針對答案要求最小的閾值。 如果不符合閾值,便傳回預設的答案。

  1. 在 Postman 中,只將本文 JSON 變更為以對話結尾的使用者陳述。 JSON 應為:

    {
        'question':'size',
        'scoreThreshold':80.00
    }
    

    因為問題的分數是 71%,所以知識庫應該不會找到該答案,而是會傳回您在建立知識庫時所提供的預設答案。

    傳回的 JSON 回應 (包括分數和答案) 是:

    {
        "answers": [
            {
                "questions": [],
                "answer": "No good match found in KB.",
                "score": 0.0,
                "id": -1,
                "source": null,
                "metadata": []
            }
        ],
        "debugInfo": null,
        "activeLearningEnabled": true
    }
    

    QnA Maker 會傳回代表沒有信心的 0 分。 它也會傳回預設答案。

  2. 將閾值變更為 60%,然後再次要求查詢:

    {
        'question':'size',
        'scoreThreshold':60.00
    }
    

    傳回的 JSON 找到了答案。

    {
        "answers": [
            {
                "questions": [
                    "How large a knowledge base can I create?",
                    "What is the max size of a knowledge base?",
                    "How many GB of data can a knowledge base hold?"
                ],
                "answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.",
                "score": 71.1,
                "id": 3,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [
                    {
                        "name": "link_in_answer",
                        "value": "true"
                    },
                    {
                        "name": "server",
                        "value": "qna_maker"
                    }
                ],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": null,
        "activeLearningEnabled": true
    }
    

使用非結構化資料來源。

我們現可支援新增無法用來擷取 QnA 非結構化文件的能力。 當擷取回應給查詢時,使用者可以選擇在 GenerateAnswer API 中包含或排除非結構化資料集。 我們不支援 GA 服務中的非結構化資料集。 只有自訂問題解答才支援此功能。

下一步

深入了解中繼資料: