KnowledgebaseOperations Class

KnowledgebaseOperations operations.

Inheritance
builtins.object
KnowledgebaseOperations

Constructor

KnowledgebaseOperations(client, config, serializer, deserializer)

Parameters

Name Description
client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Methods

create

Asynchronous operation to create a new knowledgebase.

delete

Deletes the knowledgebase and all its data.

download

Download the knowledgebase.

generate_answer

GenerateAnswer call to query knowledgebase (QnA Maker Managed).

get_details

Gets details of a specific knowledgebase.

list_all

Gets all knowledgebases for a user.

publish

Publishes all changes in test index of a knowledgebase to its prod index.

replace

Replace knowledgebase contents.

train

Train call to add suggestions to knowledgebase (QnAMaker Managed).

update

Asynchronous operation to modify a knowledgebase.

create

Asynchronous operation to create a new knowledgebase.

create(create_kb_payload, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
create_kb_payload
Required

Post body of the request.

custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

Operation or ClientRawResponse if raw=true

Exceptions

Type Description

delete

Deletes the knowledgebase and all its data.

delete(kb_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
kb_id
Required
str

Knowledgebase id.

custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

download

Download the knowledgebase.

download(kb_id, environment, source=None, changed_since=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
kb_id
Required
str

Knowledgebase id.

environment
Required

Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'

source
str

The source property filter to apply.

Default value: None
changed_since
str

The last changed status property filter to apply.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

QnADocumentsDTO or ClientRawResponse if raw=true

Exceptions

Type Description

generate_answer

GenerateAnswer call to query knowledgebase (QnA Maker Managed).

generate_answer(kb_id, generate_answer_payload, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
kb_id
Required
str

Knowledgebase id.

generate_answer_payload
Required

Post body of the request.

custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

QnASearchResultList or ClientRawResponse if raw=true

Exceptions

Type Description

get_details

Gets details of a specific knowledgebase.

get_details(kb_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
kb_id
Required
str

Knowledgebase id.

custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

KnowledgebaseDTO or ClientRawResponse if raw=true

Exceptions

Type Description

list_all

Gets all knowledgebases for a user.

list_all(custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

KnowledgebasesDTO or ClientRawResponse if raw=true

Exceptions

Type Description

publish

Publishes all changes in test index of a knowledgebase to its prod index.

publish(kb_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
kb_id
Required
str

Knowledgebase id.

custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

replace

Replace knowledgebase contents.

replace(kb_id, qn_alist, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
kb_id
Required
str

Knowledgebase id.

qn_alist
Required

List of Q-A (QnADTO) to be added to the knowledgebase. Q-A Ids are assigned by the service and should be omitted.

custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

train

Train call to add suggestions to knowledgebase (QnAMaker Managed).

train(kb_id, feedback_records=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
kb_id
Required
str

Knowledgebase id.

feedback_records

List of feedback records.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

update

Asynchronous operation to modify a knowledgebase.

update(kb_id, update_kb, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
kb_id
Required
str

Knowledgebase id.

update_kb
Required

Post body of the request.

custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

Operation or ClientRawResponse if raw=true

Exceptions

Type Description

Attributes

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'>