你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
KnowledgebaseOperations 类
知识库操作。
- 继承
-
builtins.objectKnowledgebaseOperations
构造函数
KnowledgebaseOperations(client, config, serializer, deserializer)
参数
名称 | 说明 |
---|---|
client
必需
|
服务请求的客户端。 |
config
必需
|
服务客户端的配置。 |
serializer
必需
|
对象模型序列化程序。 |
deserializer
必需
|
对象模型反序列化程序。 |
方法
create |
用于创建新知识库的异步操作。 |
delete |
删除知识库及其所有数据。 |
download |
下载知识库。 |
generate_answer |
GenerateAnswer 调用以查询知识库 (QnA Maker 托管) 。 |
get_details |
获取特定知识库的详细信息。 |
list_all |
获取用户的所有知识库。 |
publish |
将知识库测试索引中的所有更改发布到其生产索引。 |
replace |
替换知识库内容。 |
train |
训练调用以将建议添加到知识库 (QnAMaker 托管) 。 |
update |
用于修改知识库的异步操作。 |
create
用于创建新知识库的异步操作。
create(create_kb_payload, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
create_kb_payload
必需
|
发布请求正文。 |
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
<xref:msrest.pipeline.ClientRawResponse>
|
如果 raw=true,则 Operation 或 ClientRawResponse |
例外
类型 | 说明 |
---|---|
delete
删除知识库及其所有数据。
delete(kb_id, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
kb_id
必需
|
知识库 ID。 |
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
None,
<xref:msrest.pipeline.ClientRawResponse>
|
如果 raw=true,则为 None 或 ClientRawResponse |
例外
类型 | 说明 |
---|---|
download
下载知识库。
download(kb_id, environment, source=None, changed_since=None, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
kb_id
必需
|
知识库 ID。 |
environment
必需
|
指定环境是 Test 还是 Prod。可能的值包括:“Prod”、“Test” |
source
|
要应用的源属性筛选器。 默认值: None
|
changed_since
|
要应用的最后一个更改状态属性筛选器。 默认值: None
|
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
<xref:msrest.pipeline.ClientRawResponse>
|
QnADocumentsDTO 或 ClientRawResponse(如果 raw=true) |
例外
类型 | 说明 |
---|---|
generate_answer
GenerateAnswer 调用以查询知识库 (QnA Maker 托管) 。
generate_answer(kb_id, generate_answer_payload, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
kb_id
必需
|
知识库 ID。 |
generate_answer_payload
必需
|
发布请求正文。 |
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
<xref:msrest.pipeline.ClientRawResponse>
|
QnASearchResultList 或 ClientRawResponse(如果 raw=true) |
例外
类型 | 说明 |
---|---|
get_details
获取特定知识库的详细信息。
get_details(kb_id, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
kb_id
必需
|
知识库 ID。 |
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
<xref:msrest.pipeline.ClientRawResponse>
|
如果 raw=true,则 KnowledgebaseDTO 或 ClientRawResponse |
例外
类型 | 说明 |
---|---|
list_all
获取用户的所有知识库。
list_all(custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
<xref:msrest.pipeline.ClientRawResponse>
|
如果 raw=true,则知识库DTO 或 ClientRawResponse |
例外
类型 | 说明 |
---|---|
publish
将知识库测试索引中的所有更改发布到其生产索引。
publish(kb_id, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
kb_id
必需
|
知识库 ID。 |
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
None,
<xref:msrest.pipeline.ClientRawResponse>
|
如果 raw=true,则为 None 或 ClientRawResponse |
例外
类型 | 说明 |
---|---|
replace
替换知识库内容。
replace(kb_id, qn_alist, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
kb_id
必需
|
知识库 ID。 |
qn_alist
必需
|
要添加到知识库的 Q-A (QnADTO) 的列表。 Q-A ID 由服务分配,应省略。 |
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
None,
<xref:msrest.pipeline.ClientRawResponse>
|
如果 raw=true,则为 None 或 ClientRawResponse |
例外
类型 | 说明 |
---|---|
train
训练调用以将建议添加到知识库 (QnAMaker 托管) 。
train(kb_id, feedback_records=None, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
kb_id
必需
|
知识库 ID。 |
feedback_records
|
反馈记录列表。 默认值: None
|
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
None,
<xref:msrest.pipeline.ClientRawResponse>
|
如果 raw=true,则为 None 或 ClientRawResponse |
例外
类型 | 说明 |
---|---|
update
用于修改知识库的异步操作。
update(kb_id, update_kb, custom_headers=None, raw=False, **operation_config)
参数
名称 | 说明 |
---|---|
kb_id
必需
|
知识库 ID。 |
update_kb
必需
|
发布请求正文。 |
custom_headers
|
将添加到请求的标头 默认值: None
|
raw
|
返回直接响应以及反序列化的响应 默认值: False
|
operation_config
必需
|
操作配置替代。 |
返回
类型 | 说明 |
---|---|
<xref:msrest.pipeline.ClientRawResponse>
|
如果 raw=true,则 Operation 或 ClientRawResponse |
例外
类型 | 说明 |
---|---|
属性
models
models = <module 'azure.cognitiveservices.knowledge.qnamaker.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\cognitiveservices\\knowledge\\qnamaker\\models\\__init__.py'>
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈