azure.cognitiveservices.knowledge.qnamaker.models module

exception azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException(deserialize, response, *args)[source]

Bases: msrest.exceptions.HttpOperationError

Server responsed with exception of type: ‘ErrorResponse’.

Parameters
  • deserialize – A deserializer

  • response – Server response to be deserialized.

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTOAdd(*, qna_list=None, urls=None, files=None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.create_kb_input_dto_py3.CreateKbInputDTO

An instance of CreateKbInputDTO for add operation.

Parameters
  • qna_list (list[QnADTO]) – List of QNA to be added to the index. Ids are generated by the service and should be omitted.

  • urls (list[str]) – List of URLs to be added to knowledgebase.

  • files (list[FileDTO]) – List of files to be added to knowledgebase.

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTODelete(*, ids=None, sources=None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.delete_kb_contents_dto_py3.DeleteKbContentsDTO

An instance of DeleteKbContentsDTO for delete Operation.

Parameters
  • ids (list[int]) – List of Qna Ids to be deleted

  • sources (list[str]) – List of sources to be deleted from knowledgebase.

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTOUpdate(*, name: str = None, qna_list=None, urls=None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.update_kb_contents_dto_py3.UpdateKbContentsDTO

An instance of UpdateKbContentsDTO for Update Operation.

Parameters
  • name (str) – Friendly name for the knowledgebase.

  • qna_list (list[UpdateQnaDTO]) – List of Q-A (UpdateQnaDTO) to be added to the knowledgebase.

  • urls (list[str]) – List of existing URLs to be refreshed. The content will be extracted again and re-indexed.

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTO(*, add=None, delete=None, update=None, **kwargs)[source]

Bases: msrest.serialization.Model

Contains list of QnAs to be updated.

Parameters
class azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTOQuestions(*, add=None, delete=None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.update_questions_dto_py3.UpdateQuestionsDTO

List of questions associated with the answer.

Parameters
  • add (list[str]) – List of questions to be added

  • delete (list[str]) – List of questions to be deleted.

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTOMetadata(*, delete=None, add=None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.update_metadata_dto_py3.UpdateMetadataDTO

List of metadata associated with the answer to be updated.

Parameters
  • delete (list[MetadataDTO]) – List of Metadata associated with answer to be deleted

  • add (list[MetadataDTO]) – List of metadata associated with answer to be added

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTO(*, id: int = None, answer: str = None, source: str = None, questions=None, metadata=None, **kwargs)[source]

Bases: msrest.serialization.Model

PATCH Body schema for Update Qna List.

Parameters
class azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbContentsDTO(*, name: str = None, qna_list=None, urls=None, **kwargs)[source]

Bases: msrest.serialization.Model

PATCH body schema for Update operation in Update Kb.

Parameters
  • name (str) – Friendly name for the knowledgebase.

  • qna_list (list[UpdateQnaDTO]) – List of Q-A (UpdateQnaDTO) to be added to the knowledgebase.

  • urls (list[str]) – List of existing URLs to be refreshed. The content will be extracted again and re-indexed.

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateQuestionsDTO(*, add=None, delete=None, **kwargs)[source]

Bases: msrest.serialization.Model

PATCH Body schema for Update Kb which contains list of questions to be added and deleted.

Parameters
  • add (list[str]) – List of questions to be added

  • delete (list[str]) – List of questions to be deleted.

class azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO(*, name: str, value: str, **kwargs)[source]

Bases: msrest.serialization.Model

Name - value pair of metadata.

All required parameters must be populated in order to send to Azure.

Parameters
  • name (str) – Required. Metadata name.

  • value (str) – Required. Metadata value.

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateMetadataDTO(*, delete=None, add=None, **kwargs)[source]

Bases: msrest.serialization.Model

PATCH Body schema to represent list of Metadata to be updated.

Parameters
  • delete (list[MetadataDTO]) – List of Metadata associated with answer to be deleted

  • add (list[MetadataDTO]) – List of metadata associated with answer to be added

class azure.cognitiveservices.knowledge.qnamaker.models.DeleteKbContentsDTO(*, ids=None, sources=None, **kwargs)[source]

Bases: msrest.serialization.Model

PATCH body schema of Delete Operation in UpdateKb.

Parameters
  • ids (list[int]) – List of Qna Ids to be deleted

  • sources (list[str]) – List of sources to be deleted from knowledgebase.

class azure.cognitiveservices.knowledge.qnamaker.models.QnADTO(*, answer: str, questions, id: int = None, source: str = None, metadata=None, **kwargs)[source]

Bases: msrest.serialization.Model

Q-A object.

All required parameters must be populated in order to send to Azure.

Parameters
class azure.cognitiveservices.knowledge.qnamaker.models.FileDTO(*, file_name: str, file_uri: str, **kwargs)[source]

Bases: msrest.serialization.Model

DTO to hold details of uploaded files.

All required parameters must be populated in order to send to Azure.

Parameters
  • file_name (str) – Required. File name. Supported file types are “.tsv”, “.pdf”, “.txt”, “.docx”, “.xlsx”.

  • file_uri (str) – Required. Public URI of the file.

class azure.cognitiveservices.knowledge.qnamaker.models.CreateKbInputDTO(*, qna_list=None, urls=None, files=None, **kwargs)[source]

Bases: msrest.serialization.Model

Input to create KB.

Parameters
  • qna_list (list[QnADTO]) – List of QNA to be added to the index. Ids are generated by the service and should be omitted.

  • urls (list[str]) – List of URLs to be added to knowledgebase.

  • files (list[FileDTO]) – List of files to be added to knowledgebase.

class azure.cognitiveservices.knowledge.qnamaker.models.QnADocumentsDTO(*, qna_documents=None, **kwargs)[source]

Bases: msrest.serialization.Model

List of QnADTO.

Parameters

qna_documents (list[QnADTO]) – List of answers.

class azure.cognitiveservices.knowledge.qnamaker.models.CreateKbDTO(*, name: str, qna_list=None, urls=None, files=None, **kwargs)[source]

Bases: msrest.serialization.Model

Post body schema for CreateKb operation.

All required parameters must be populated in order to send to Azure.

Parameters
  • name (str) – Required. Friendly name for the knowledgebase.

  • qna_list (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.

  • urls (list[str]) – List of URLs to be used for extracting Q-A.

  • files (list[FileDTO]) – List of files from which to Extract Q-A.

class azure.cognitiveservices.knowledge.qnamaker.models.ReplaceKbDTO(*, qn_alist, **kwargs)[source]

Bases: msrest.serialization.Model

Post body schema for Replace KB operation.

All required parameters must be populated in order to send to Azure.

Parameters

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.

class azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseError(*, code, message: str = None, target: str = None, details=None, inner_error=None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.error_py3.Error

The error object.

All required parameters must be populated in order to send to Azure.

Parameters
  • code (str or ErrorCodeType) – Required. One of a server-defined set of error codes. Possible values include: ‘BadArgument’, ‘Forbidden’, ‘NotFound’, ‘KbNotFound’, ‘Unauthorized’, ‘Unspecified’, ‘EndpointKeysError’, ‘QuotaExceeded’, ‘QnaRuntimeError’, ‘SKULimitExceeded’, ‘OperationNotFound’, ‘ServiceError’, ‘ValidationFailure’, ‘ExtractionFailure’

  • message (str) – A human-readable representation of the error.

  • target (str) – The target of the error.

  • details (list[Error]) – An array of details about specific errors that led to this reported error.

  • inner_error (InnerErrorModel) – An object containing more specific information than the current object about the error.

class azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponse(*, error=None, **kwargs)[source]

Bases: msrest.serialization.Model

Error response. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

Parameters

error (ErrorResponseError) – The error object.

class azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel(*, code: str = None, inner_error=None, **kwargs)[source]

Bases: msrest.serialization.Model

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

Parameters
  • code (str) – A more specific error code than was provided by the containing error.

  • inner_error (InnerErrorModel) – An object containing more specific information than the current object about the error.

class azure.cognitiveservices.knowledge.qnamaker.models.Error(*, code, message: str = None, target: str = None, details=None, inner_error=None, **kwargs)[source]

Bases: msrest.serialization.Model

The error object. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

All required parameters must be populated in order to send to Azure.

Parameters
  • code (str or ErrorCodeType) – Required. One of a server-defined set of error codes. Possible values include: ‘BadArgument’, ‘Forbidden’, ‘NotFound’, ‘KbNotFound’, ‘Unauthorized’, ‘Unspecified’, ‘EndpointKeysError’, ‘QuotaExceeded’, ‘QnaRuntimeError’, ‘SKULimitExceeded’, ‘OperationNotFound’, ‘ServiceError’, ‘ValidationFailure’, ‘ExtractionFailure’

  • message (str) – A human-readable representation of the error.

  • target (str) – The target of the error.

  • details (list[Error]) – An array of details about specific errors that led to this reported error.

  • inner_error (InnerErrorModel) – An object containing more specific information than the current object about the error.

class azure.cognitiveservices.knowledge.qnamaker.models.Operation(*, operation_state=None, created_timestamp: str = None, last_action_timestamp: str = None, resource_location: str = None, user_id: str = None, operation_id: str = None, error_response=None, **kwargs)[source]

Bases: msrest.serialization.Model

Record to track long running operation.

Parameters
  • operation_state (str or OperationStateType) – Operation state. Possible values include: ‘Failed’, ‘NotStarted’, ‘Running’, ‘Succeeded’

  • created_timestamp (str) – Timestamp when the operation was created.

  • last_action_timestamp (str) – Timestamp when the current state was entered.

  • resource_location (str) – Relative URI to the target resource location for completed resources.

  • user_id (str) – User Id

  • operation_id (str) – Operation Id.

  • error_response (ErrorResponse) – Error details in case of failures.

class azure.cognitiveservices.knowledge.qnamaker.models.KnowledgebaseDTO(*, id: str = None, host_name: str = None, last_accessed_timestamp: str = None, last_changed_timestamp: str = None, last_published_timestamp: str = None, name: str = None, user_id: str = None, urls=None, sources=None, **kwargs)[source]

Bases: msrest.serialization.Model

Response schema for CreateKb operation.

Parameters
  • id (str) – Unique id that identifies a knowledgebase.

  • host_name (str) – URL host name at which the knowledgebase is hosted.

  • last_accessed_timestamp (str) – Time stamp at which the knowledgebase was last accessed (UTC).

  • last_changed_timestamp (str) – Time stamp at which the knowledgebase was last modified (UTC).

  • last_published_timestamp (str) – Time stamp at which the knowledgebase was last published (UTC).

  • name (str) – Friendly name of the knowledgebase.

  • user_id (str) – User who created / owns the knowledgebase.

  • urls (list[str]) – URL sources from which Q-A were extracted and added to the knowledgebase.

  • sources (list[str]) – Custom sources from which Q-A were extracted or explicitly added to the knowledgebase.

class azure.cognitiveservices.knowledge.qnamaker.models.KnowledgebasesDTO(*, knowledgebases=None, **kwargs)[source]

Bases: msrest.serialization.Model

Collection of knowledgebases owned by a user.

Parameters

knowledgebases (list[KnowledgebaseDTO]) – Collection of knowledgebase records.

class azure.cognitiveservices.knowledge.qnamaker.models.AlterationsDTO(*, alterations, **kwargs)[source]

Bases: msrest.serialization.Model

Collection of words that are synonyms.

All required parameters must be populated in order to send to Azure.

Parameters

alterations (list[str]) – Required. Words that are synonymous with each other.

class azure.cognitiveservices.knowledge.qnamaker.models.WordAlterationsDTO(*, word_alterations, **kwargs)[source]

Bases: msrest.serialization.Model

Collection of word alterations.

All required parameters must be populated in order to send to Azure.

Parameters

word_alterations (list[AlterationsDTO]) – Required. Collection of word alterations.

class azure.cognitiveservices.knowledge.qnamaker.models.EndpointKeysDTO(*, primary_endpoint_key: str = None, secondary_endpoint_key: str = None, installed_version: str = None, last_stable_version: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Schema for EndpointKeys generate/refresh operations.

Parameters
  • primary_endpoint_key (str) – Primary Access Key.

  • secondary_endpoint_key (str) – Secondary Access Key.

  • installed_version (str) – Current version of runtime.

  • last_stable_version (str) – Latest version of runtime.

class azure.cognitiveservices.knowledge.qnamaker.models.KnowledgebaseEnvironmentType[source]

Bases: str, enum.Enum

An enumeration.

prod = 'Prod'
test = 'Test'
class azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType[source]

Bases: str, enum.Enum

An enumeration.

bad_argument = 'BadArgument'
endpoint_keys_error = 'EndpointKeysError'
extraction_failure = 'ExtractionFailure'
forbidden = 'Forbidden'
kb_not_found = 'KbNotFound'
not_found = 'NotFound'
operation_not_found = 'OperationNotFound'
qna_runtime_error = 'QnaRuntimeError'
quota_exceeded = 'QuotaExceeded'
service_error = 'ServiceError'
sku_limit_exceeded = 'SKULimitExceeded'
unauthorized = 'Unauthorized'
unspecified = 'Unspecified'
validation_failure = 'ValidationFailure'
class azure.cognitiveservices.knowledge.qnamaker.models.OperationStateType[source]

Bases: str, enum.Enum

An enumeration.

failed = 'Failed'
not_started = 'NotStarted'
running = 'Running'
succeeded = 'Succeeded'
class azure.cognitiveservices.knowledge.qnamaker.models.EnvironmentType[source]

Bases: str, enum.Enum

An enumeration.

prod = 'Prod'
test = 'Test'