你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Question Answering Projects - Update Sources
更新项目的源。
PATCH {Endpoint}/language/query-knowledgebases/projects/{projectName}/sources?api-version=2021-10-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
Endpoint
|
path | True |
string |
支持的认知服务终结点(例如 https://.api.cognitiveservices.azure.com). |
project
|
path | True |
string maxLength: 100 |
要使用的项目的名称。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
请求正文
名称 | 类型 | 说明 |
---|---|---|
body |
更新项目的源参数。 |
响应
名称 | 类型 | 说明 |
---|---|---|
202 Accepted |
带有用于检查作业状态的 Operation-Location 标头的成功调用结果。 标头 Operation-Location: string |
|
Other Status Codes |
错误响应。 |
安全性
Ocp-Apim-Subscription-Key
类型:
apiKey
在:
header
示例
Successful query
示例请求
PATCH {Endpoint}/language/query-knowledgebases/projects/proj1/sources?api-version=2021-10-01
[
{
"op": "add",
"value": {
"displayName": "source3",
"sourceUri": "https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-support-options?context=/azure/cognitive-services/qnamaker/context/context",
"sourceKind": "url",
"source": "https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-support-options?context=/azure/cognitive-services/qnamaker/context/context"
}
},
{
"op": "replace",
"value": {
"displayName": "source1",
"sourceUri": "https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/overview/overview",
"sourceKind": "url",
"refresh": true,
"source": "https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/overview/overview"
}
},
{
"op": "delete",
"value": {
"displayName": "source2",
"sourceUri": "https://download.microsoft.com/download/2/9/B/29B20383-302C-4517-A006-B0186F04BE28/surface-pro-4-user-guide-EN.pdf",
"sourceKind": "file",
"source": "surface-guide.pdf"
}
}
]
示例响应
Operation-Location: job1
定义
名称 | 说明 |
---|---|
Error |
错误对象。 |
Error |
人工可读错误代码。 |
Error |
错误响应。 |
Inner |
人工可读错误代码。 |
Inner |
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。 |
source |
源的内容类型。 |
source |
支持的源类型。 |
update |
更新资产的作类型。 |
Update |
更新源记录。 |
Update |
要更新的源。 |
Error
错误对象。
名称 | 类型 | 说明 |
---|---|---|
code |
服务器定义的错误代码集之一。 |
|
details |
Error[] |
导致此报告错误的特定错误的详细信息数组。 |
innererror |
包含与当前对象有关错误的更具体信息的对象。 |
|
message |
string |
错误的人工可读表示形式。 |
target |
string |
错误的目标。 |
ErrorCode
人工可读错误代码。
值 | 说明 |
---|---|
AzureCognitiveSearchIndexLimitReached | |
AzureCognitiveSearchIndexNotFound | |
AzureCognitiveSearchNotFound | |
AzureCognitiveSearchThrottling | |
Forbidden | |
InternalServerError | |
InvalidArgument | |
InvalidRequest | |
NotFound | |
OperationNotFound | |
ProjectNotFound | |
ServiceUnavailable | |
TooManyRequests | |
Unauthorized |
ErrorResponse
错误响应。
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
InnerErrorCode
人工可读错误代码。
值 | 说明 |
---|---|
AzureCognitiveSearchNotFound | |
AzureCognitiveSearchThrottling | |
ExtractionFailure | |
InvalidParameterValue | |
InvalidRequest | |
KnowledgeBaseNotFound |
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 |
错误目标。 |
sourceContentStructureKind
源的内容类型。
值 | 说明 |
---|---|
unstructured |
sourceKind
支持的源类型。
值 | 说明 |
---|---|
file | |
url |
updateOperationKind
更新资产的作类型。
值 | 说明 |
---|---|
add | |
delete | |
replace |
UpdateQnaSourceRecord
更新源记录。
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
contentStructureKind | Unstructured |
源的内容类型。 |
|
displayName |
string minLength: 1maxLength: 200 |
源的友好名称。 |
|
refresh |
boolean |
用于从源刷新数据的布尔标志。 |
|
source |
string |
唯一源标识符。 文件的名称(如果是“file”源);否则,如果它是“url”源,则为完整 URL。 |
|
sourceKind | url |
支持的源类型。 |
|
sourceUri |
string (uri) |
文件或 URL 的 URI 位置。 |
UpdateSourceRecord
要更新的源。
名称 | 类型 | 说明 |
---|---|---|
op |
更新资产的作类型。 |
|
value |
更新源记录。 |