azure.cognitiveservices.knowledge.qnamaker.operations module

class azure.cognitiveservices.knowledge.qnamaker.operations.EndpointKeysOperations(client, config, serializer, deserializer)[source]

Bases: object

EndpointKeysOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
get_keys(custom_headers=None, raw=False, **operation_config)[source]

Gets endpoint keys for an endpoint.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

EndpointKeysDTO or ClientRawResponse if raw=true

Return type:

EndpointKeysDTO or ClientRawResponse

Raises:

ErrorResponseException

refresh_keys(key_type, custom_headers=None, raw=False, **operation_config)[source]

Re-generates an endpoint key.

Parameters:
  • key_type (str) – Type of Key
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

EndpointKeysDTO or ClientRawResponse if raw=true

Return type:

EndpointKeysDTO or ClientRawResponse

Raises:

ErrorResponseException

models = <module 'azure.cognitiveservices.knowledge.qnamaker.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/knowledge/qnamaker/models/__init__.py'>
class azure.cognitiveservices.knowledge.qnamaker.operations.AlterationsOperations(client, config, serializer, deserializer)[source]

Bases: object

AlterationsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
get(custom_headers=None, raw=False, **operation_config)[source]

Download alterations from runtime.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

WordAlterationsDTO or ClientRawResponse if raw=true

Return type:

WordAlterationsDTO or ClientRawResponse

Raises:

ErrorResponseException

replace(word_alterations, custom_headers=None, raw=False, **operation_config)[source]

Replace alterations data.

Parameters:
  • word_alterations (list[AlterationsDTO]) – Collection of word alterations.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

ErrorResponseException

models = <module 'azure.cognitiveservices.knowledge.qnamaker.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/knowledge/qnamaker/models/__init__.py'>
class azure.cognitiveservices.knowledge.qnamaker.operations.KnowledgebaseOperations(client, config, serializer, deserializer)[source]

Bases: object

KnowledgebaseOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
create(create_kb_payload, custom_headers=None, raw=False, **operation_config)[source]

Asynchronous operation to create a new knowledgebase.

Parameters:
  • create_kb_payload (CreateKbDTO) – Post body of the request.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Operation or ClientRawResponse if raw=true

Return type:

Operation or ClientRawResponse

Raises:

ErrorResponseException

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

Deletes the knowledgebase and all its data.

Parameters:
  • kb_id (str) – Knowledgebase id.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

ErrorResponseException

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

Download the knowledgebase.

Parameters:
  • kb_id (str) – Knowledgebase id.
  • environment (str or EnvironmentType) – Specifies whether environment is Test or Prod. Possible values include: ‘Prod’, ‘Test’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

QnADocumentsDTO or ClientRawResponse if raw=true

Return type:

QnADocumentsDTO or ClientRawResponse

Raises:

ErrorResponseException

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

Gets details of a specific knowledgebase.

Parameters:
  • kb_id (str) – Knowledgebase id.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

KnowledgebaseDTO or ClientRawResponse if raw=true

Return type:

KnowledgebaseDTO or ClientRawResponse

Raises:

ErrorResponseException

list_all(custom_headers=None, raw=False, **operation_config)[source]

Gets all knowledgebases for a user.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

KnowledgebasesDTO or ClientRawResponse if raw=true

Return type:

KnowledgebasesDTO or ClientRawResponse

Raises:

ErrorResponseException

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

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

Parameters:
  • kb_id (str) – Knowledgebase id.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

ErrorResponseException

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

Replace knowledgebase contents.

Parameters:
  • kb_id (str) – Knowledgebase id.
  • qn_alist (list[QnADTO]) – 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) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

ErrorResponseException

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

Asynchronous operation to modify a knowledgebase.

Parameters:
  • kb_id (str) – Knowledgebase id.
  • update_kb (UpdateKbOperationDTO) – Post body of the request.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Operation or ClientRawResponse if raw=true

Return type:

Operation or ClientRawResponse

Raises:

ErrorResponseException

models = <module 'azure.cognitiveservices.knowledge.qnamaker.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/knowledge/qnamaker/models/__init__.py'>
class azure.cognitiveservices.knowledge.qnamaker.operations.Operations(client, config, serializer, deserializer)[source]

Bases: object

Operations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
get_details(operation_id, custom_headers=None, raw=False, **operation_config)[source]

Gets details of a specific long running operation.

Parameters:
  • operation_id (str) – Operation id.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Operation or ClientRawResponse if raw=true

Return type:

Operation or ClientRawResponse

Raises:

ErrorResponseException

models = <module 'azure.cognitiveservices.knowledge.qnamaker.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/knowledge/qnamaker/models/__init__.py'>