KnowledgebaseOperations Class

KnowledgebaseOperations operations.

Inheritance
builtins.object
KnowledgebaseOperations

Constructor

KnowledgebaseOperations(client, config, serializer, deserializer)

Parameters

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

create_kb_payload
CreateKbDTO
Required

Post body of the request.

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Operation or ClientRawResponse if raw=true

Return type

Exceptions

delete

Deletes the knowledgebase and all its data.

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

Parameters

kb_id
str
Required

Knowledgebase id.

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

download

Download the knowledgebase.

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

Parameters

kb_id
str
Required

Knowledgebase id.

environment
str or EnvironmentType
Required

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

source
str
Required
default value: None

The source property filter to apply.

changed_since
str
Required
default value: None

The last changed status property filter to apply.

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

QnADocumentsDTO or ClientRawResponse if raw=true

Return type

Exceptions

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

kb_id
str
Required

Knowledgebase id.

generate_answer_payload
QueryDTO
Required

Post body of the request.

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

QnASearchResultList or ClientRawResponse if raw=true

Return type

Exceptions

get_details

Gets details of a specific knowledgebase.

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

Parameters

kb_id
str
Required

Knowledgebase id.

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

KnowledgebaseDTO or ClientRawResponse if raw=true

Return type

Exceptions

list_all

Gets all knowledgebases for a user.

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

Parameters

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

KnowledgebasesDTO or ClientRawResponse if raw=true

Return type

Exceptions

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

kb_id
str
Required

Knowledgebase id.

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

replace

Replace knowledgebase contents.

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

Parameters

kb_id
str
Required

Knowledgebase id.

qn_alist
list[QnADTO]
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
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

train

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

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

Parameters

kb_id
str
Required

Knowledgebase id.

feedback_records
list[FeedbackRecordDTO]
Required
default value: None

List of feedback records.

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

update

Asynchronous operation to modify a knowledgebase.

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

Parameters

kb_id
str
Required

Knowledgebase id.

update_kb
UpdateKbOperationDTO
Required

Post body of the request.

custom_headers
dict
Required
default value: None

headers that will be added to the request

raw
bool
Required
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Operation or ClientRawResponse if raw=true

Return type

Exceptions

Attributes

models

models = <module 'azure.cognitiveservices.knowledge.qnamaker.models' from 'c:\\hostedtoolcache\\windows\\python\\3.6.8\\x64\\lib\\site-packages\\azure\\cognitiveservices\\knowledge\\qnamaker\\models\\__init__.py'>