通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Question Answering Projects - Update Sources

更新项目的源。

PATCH {Endpoint}/language/authoring/query-knowledgebases/projects/{projectName}/sources?api-version=2023-04-01

URI 参数

名称 必需 类型 说明
Endpoint
path True

string (uri)

支持的认知服务终结点(例如,https://< resource-name.api.cognitiveservices.azure.com>)。

projectName
path True

string

maxLength: 100
pattern: ^(?=[a-zA-Z0-9])[a-zA-Z0-9-]{0,98}[a-zA-Z0-9]$

要使用的项目的名称。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

请求正文

名称 类型 说明
body

UpdateSourceRecord[]

更新项目的源参数。

响应

名称 类型 说明
202 Accepted

已接受请求进行处理,但尚未完成处理。

标头

Operation-Location: string

Other Status Codes

ErrorResponse

意外错误响应。

标头

x-ms-error-code: string

安全性

Ocp-Apim-Subscription-Key

类型: apiKey
在: header

OAuth2Auth

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
https://cognitiveservices.azure.com/.default

示例

Successful query

示例请求

PATCH {Endpoint}/language/authoring/query-knowledgebases/projects/proj1/sources?api-version=2023-04-01

[
  {
    "op": "add",
    "value": {
      "displayName": "source3",
      "source": "https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-support-options?context=/azure/cognitive-services/qnamaker/context/context",
      "sourceKind": "url",
      "sourceUri": "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",
      "refresh": true,
      "source": "https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/overview/overview",
      "sourceKind": "url",
      "sourceUri": "https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/overview/overview"
    }
  },
  {
    "op": "delete",
    "value": {
      "displayName": "source2",
      "source": "surface-guide.pdf",
      "sourceKind": "file",
      "sourceUri": "https://download.microsoft.com/download/2/9/B/29B20383-302C-4517-A006-B0186F04BE28/surface-pro-4-user-guide-EN.pdf"
    }
  }
]

示例响应

Operation-Location: https:///language/authoring/query-knowledgebases/projects/proj1/sources/jobs/job1?api-version=2023-04-01

定义

名称 说明
Error

错误对象。

ErrorCode

人工可读错误代码。

ErrorResponse

错误响应。

InnerErrorCode

人工可读错误代码。

InnerErrorModel

包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

sourceContentStructureKind

源的内容结构类型。

sourceKind

支持的源类型。

updateOperationKind

更新资产的作类型。

UpdateQnaSourceRecord

更新源记录。

UpdateSourceRecord

来源待更新。

Error

错误对象。

名称 类型 说明
code

ErrorCode

服务器定义的错误代码集之一。

details

Error[]

导致此报告错误的特定错误的详细信息数组。

innererror

InnerErrorModel

包含与当前对象有关错误的更具体信息的对象。

message

string

错误的人工可读表示形式。

target

string

错误的目标。

ErrorCode

人工可读错误代码。

说明
InvalidRequest

请求错误无效

InvalidArgument

参数错误无效

Unauthorized

未经授权的访问错误

Forbidden

禁止访问错误

NotFound

找不到错误

ProjectNotFound

项目找不到错误

OperationNotFound

找不到操作错误

AzureCognitiveSearchNotFound

Azure 认知搜索找不到错误

AzureCognitiveSearchIndexNotFound

Azure 认知搜索索引找不到错误

TooManyRequests

请求过多错误

AzureCognitiveSearchThrottling

Azure 认知搜索限制错误

AzureCognitiveSearchIndexLimitReached

Azure 认知搜索索引限制达到错误

InternalServerError

内部服务器错误

ServiceUnavailable

服务不可用错误

Timeout

超时错误

QuotaExceeded

超出配额错误

Conflict

冲突错误

Warning

警告错误

ErrorResponse

错误响应。

名称 类型 说明
error

Error

错误对象。

InnerErrorCode

人工可读错误代码。

说明
InvalidRequest

请求错误无效

InvalidParameterValue

参数值错误无效

KnowledgeBaseNotFound

知识库找不到错误

AzureCognitiveSearchNotFound

Azure 认知搜索找不到错误

AzureCognitiveSearchThrottling

Azure 认知搜索限制错误

ExtractionFailure

提取失败错误

InvalidRequestBodyFormat

请求正文格式错误无效

EmptyRequest

空请求错误

MissingInputDocuments

缺少输入文档错误

InvalidDocument

文档错误无效

ModelVersionIncorrect

模型版本错误错误

InvalidDocumentBatch

文档批处理错误无效

UnsupportedLanguageCode

不支持的语言代码错误

InvalidCountryHint

国家/地区提示错误无效

InnerErrorModel

包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

名称 类型 说明
code

InnerErrorCode

服务器定义的错误代码集之一。

details

object

错误详细信息。

innererror

InnerErrorModel

包含与当前对象有关错误的更具体信息的对象。

message

string

错误消息。

target

string

错误目标。

sourceContentStructureKind

源的内容结构类型。

说明
unstructured

非。

sourceKind

支持的源类型。

说明
file

文件源。

url

URI 源。

updateOperationKind

更新资产的作类型。

说明
add

添加作。

delete

删除作。

replace

替换作。

UpdateQnaSourceRecord

更新源记录。

名称 类型 默认值 说明
contentStructureKind

sourceContentStructureKind

unstructured

源的内容结构类型。

displayName

string

minLength: 1
maxLength: 200

源的友好名称。

refresh

boolean

布尔标志,用于刷新源中的数据。

source

string

唯一源标识符。 如果文件是“文件”源,则为文件名称;否则,如果它是“url”源,则为完整的 URL。

sourceKind

sourceKind

支持的源类型。

sourceUri

string (uri)

文件或 url 的 URI 位置。

UpdateSourceRecord

来源待更新。

名称 类型 说明
op

updateOperationKind

更新资产的作类型。

value

UpdateQnaSourceRecord

更新源记录。