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:
-
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:
-
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: - add (UpdateKbOperationDTOAdd) – An instance of CreateKbInputDTO for add operation
- delete (UpdateKbOperationDTODelete) – An instance of DeleteKbContentsDTO for delete Operation
- update (UpdateKbOperationDTOUpdate) – An instance of UpdateKbContentsDTO for Update Operation
-
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:
-
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: - id (int) – Unique id for the Q-A
- answer (str) – Answer text
- source (str) – Source from which Q-A was indexed. eg. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs
- questions (UpdateQnaDTOQuestions) – List of questions associated with the answer.
- metadata (UpdateQnaDTOMetadata) – List of metadata associated with the answer to be updated
-
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:
-
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:
-
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:
-
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: - id (int) – Unique id for the Q-A.
- answer (str) – Required. Answer text
- source (str) – Source from which Q-A was indexed. eg. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs
- questions (list[str]) – Required. List of questions associated with the answer.
- metadata (list[MetadataDTO]) – List of metadata associated with the answer.
-
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:
-
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:
-
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:
-
class
azure.cognitiveservices.knowledge.qnamaker.models.
KnowledgebaseEnvironmentType
[source]¶ -
An enumeration.
-
prod
= 'Prod'¶
-
test
= 'Test'¶
-
-
class
azure.cognitiveservices.knowledge.qnamaker.models.
ErrorCodeType
[source]¶ -
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'¶
-
unspecified
= 'Unspecified'¶
-
validation_failure
= 'ValidationFailure'¶
-