你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Question Answering Projects - Update Qnas
更新项目的 QnA。
PATCH {Endpoint}/language/authoring/query-knowledgebases/projects/{projectName}/qnas?api-version=2023-04-15-preview
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
project
|
path | True |
string |
要使用的项目的名称。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
body |
更新项目的 QnAs 参数。 |
响应
名称 | 类型 | 说明 |
---|---|---|
202 Accepted |
成功的调用结果,其中包含用于检查作业状态的 Operation-Location 标头。 标头 Operation-Location: string |
|
Other Status Codes |
错误响应。 |
安全性
AADToken
这些是 Azure Active Directory OAuth2 流
若要实现方案,建议查看
笔记
- 此安全定义 要求 使用
x-ms-client-id
标头来指示应用程序请求访问的 Azure Maps 资源。 这可以从 地图管理 API获取。
Authorization URL
特定于 Azure 公有云实例。 主权云具有唯一的授权 URL 和 Azure Active Directory 配置。
* Azure 基于角色的访问控制是通过 Azure 门户、PowerShell、CLI、Azure SDK 或 REST API 从 Azure 管理平面 配置的。
* 使用 azure Maps Web SDK
- 目前,Azure Active Directory v1.0 或 v2.0 支持工作、学校和来宾,但不支持个人帐户。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
https://cognitiveservices.azure.com/.default | https://cognitiveservices.azure.com/.default |
Ocp-Apim-Subscription-Key
语言服务资源的订阅密钥。
类型:
apiKey
在:
header
示例
Successful query
示例请求
PATCH {Endpoint}/language/authoring/query-knowledgebases/projects/proj1/qnas?api-version=2023-04-15-preview
[
{
"op": "add",
"value": {
"id": 3,
"answer": "ans3",
"source": "source1",
"questions": [
"question 3.1",
"question 3.2"
],
"metadata": {
"k1": "v1",
"k2": "v2"
},
"dialog": {
"isContextOnly": false,
"prompts": [
{
"displayOrder": 1,
"qnaId": 11,
"displayText": "prompt 3.1"
},
{
"displayOrder": 2,
"qnaId": 21,
"displayText": "prompt 3.2"
}
]
}
}
},
{
"op": "replace",
"value": {
"id": 1,
"answer": "ans4",
"source": "source1",
"questions": [
"question 4.1",
"question 4.2"
]
}
},
{
"op": "delete",
"value": {
"id": 2,
"answer": "ans2",
"source": "source1",
"questions": [
"question 2.1",
"question 2.2"
]
}
}
]
示例响应
Operation-Location: https:///language/authoring/query-knowledgebases/projects/proj1/qnas/jobs/job1?api-version=2023-04-15-preview
定义
名称 | 说明 |
---|---|
Error |
错误对象。 |
Error |
人工可读错误代码。 |
Error |
错误响应。 |
Inner |
人工可读错误代码。 |
Inner |
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。 |
Qna |
与 QnA 记录关联的对话框。 |
Qna |
提示输入答案。 |
Qna |
QnA 记录。 |
Suggested |
主动学习功能建议的问题。 |
Suggested |
主动学习建议的问题群集详细信息。 |
update |
更新资产的操作类型。 |
Update |
要更新的 QnA 记录。 |
Error
错误对象。
名称 | 类型 | 说明 |
---|---|---|
code |
服务器定义的错误代码集之一。 |
|
details |
Error[] |
导致此报告错误的特定错误的详细信息数组。 |
innererror |
包含与当前对象有关错误的更具体信息的对象。 |
|
message |
string |
错误的人工可读表示形式。 |
target |
string |
错误的目标。 |
ErrorCode
人工可读错误代码。
名称 | 类型 | 说明 |
---|---|---|
AzureCognitiveSearchIndexLimitReached |
string |
|
AzureCognitiveSearchIndexNotFound |
string |
|
AzureCognitiveSearchNotFound |
string |
|
AzureCognitiveSearchThrottling |
string |
|
Conflict |
string |
|
Forbidden |
string |
|
InternalServerError |
string |
|
InvalidArgument |
string |
|
InvalidRequest |
string |
|
NotFound |
string |
|
OperationNotFound |
string |
|
ProjectNotFound |
string |
|
QuotaExceeded |
string |
|
ServiceUnavailable |
string |
|
Timeout |
string |
|
TooManyRequests |
string |
|
Unauthorized |
string |
|
Warning |
string |
ErrorResponse
错误响应。
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
InnerErrorCode
人工可读错误代码。
名称 | 类型 | 说明 |
---|---|---|
AzureCognitiveSearchNotFound |
string |
|
AzureCognitiveSearchThrottling |
string |
|
EmptyRequest |
string |
|
ExtractionFailure |
string |
|
InvalidCountryHint |
string |
|
InvalidDocument |
string |
|
InvalidDocumentBatch |
string |
|
InvalidParameterValue |
string |
|
InvalidRequest |
string |
|
InvalidRequestBodyFormat |
string |
|
KnowledgeBaseNotFound |
string |
|
MissingInputDocuments |
string |
|
ModelVersionIncorrect |
string |
|
UnsupportedLanguageCode |
string |
InnerErrorModel
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。
名称 | 类型 | 说明 |
---|---|---|
code |
服务器定义的错误代码集之一。 |
|
details |
object |
错误详细信息。 |
innererror |
包含与当前对象有关错误的更具体信息的对象。 |
|
message |
string |
错误信息。 |
target |
string |
错误目标。 |
QnaDialog
与 QnA 记录关联的对话框。
名称 | 类型 | 说明 |
---|---|---|
isContextOnly |
boolean |
如果提示仅与前面的问题相关,则进行标记。 如果为 true,请不要将此 QnA 作为没有上下文的查询的答案;否则,忽略上下文并在答案中包含此 QnA。 |
prompts |
与答案关联的提示列表。 |
QnaPrompt
提示输入答案。
名称 | 类型 | 说明 |
---|---|---|
displayOrder |
integer |
提示的索引。 它用于对提示进行排序。 |
displayText |
string |
显示用于表示后续问题提示的文本。 |
qna |
QnA 记录。 QnAId 或 QnA 记录需要出现在提示中。 |
|
qnaId |
integer |
对应于提示的 QnA 的 ID。 |
QnaRecord
QnA 记录。
名称 | 类型 | 说明 |
---|---|---|
activeLearningSuggestions |
QnA 的活动学习建议列表。 |
|
answer |
string |
回答文本。 |
dialog |
QnA 的上下文。 |
|
id |
integer |
QnA 的唯一 ID。 |
metadata |
object |
与答案关联的元数据,可用于对问题答案进行分类或筛选。 |
questions |
string[] |
与答案关联的问题列表。 |
source |
string |
QnA 的索引来源,例如 https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs。 |
SuggestedQuestion
主动学习功能建议的问题。
名称 | 类型 | 说明 |
---|---|---|
autoSuggestedCount |
integer |
主动学习算法自动建议问题次数。 |
question |
string |
主动学习功能建议的问题。 |
userSuggestedCount |
integer |
用户显式建议问题次数。 |
SuggestedQuestionsCluster
主动学习建议的问题群集详细信息。
名称 | 类型 | 说明 |
---|---|---|
clusterHead |
string |
通过主动学习聚类分析算法选择为建议问题聚类的头的问题。 |
suggestedQuestions |
QnA 的所有建议问题的列表。 |
updateOperationKind
更新资产的操作类型。
名称 | 类型 | 说明 |
---|---|---|
add |
string |
|
delete |
string |
|
replace |
string |
UpdateQnaRecord
要更新的 QnA 记录。
名称 | 类型 | 说明 |
---|---|---|
op |
更新资产的操作类型。 |
|
value |
QnA 记录。 |