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, default_answer: str = 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.

  • default_answer (str) – Default answer sent to user if no good match is found in the KB.

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTO(*, add=None, delete=None, update=None, enable_hierarchical_extraction: bool = None, default_answer_used_for_extraction: str = 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

  • enable_hierarchical_extraction (bool) – Enable hierarchical extraction of Q-A from files and urls. The value set during KB creation will be used if this field is not present.

  • default_answer_used_for_extraction (str) – Text string to be used as the answer in any Q-A which has no extracted answer from the document but has a hierarchy. Required when EnableHierarchicalExtraction field is set to True.

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.UpdateQnaDTOContext(*, prompts_to_delete=None, prompts_to_add=None, is_context_only: bool = None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.update_context_dto_py3.UpdateContextDTO

Context associated with Qna to be updated.

Parameters
  • prompts_to_delete (list[int]) – List of prompts associated with qna to be deleted

  • prompts_to_add (list[PromptDTO]) – List of prompts to be added to the qna.

  • is_context_only (bool) – To mark if a prompt is relevant only with a previous question or not. true - Do not include this QnA as search result for queries without context false - ignores context and includes this QnA in search result

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTO(*, id: int = None, answer: str = None, source: str = None, questions=None, metadata=None, context=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, default_answer: str = 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.

  • default_answer (str) – Default answer sent to user if no good match is found in the KB.

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.PromptDTOQna(*, answer: str, questions, id: int = None, source: str = None, metadata=None, context=None, last_updated_timestamp: str = None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.qn_adto_py3.QnADTO

QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO object.

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

Parameters
class azure.cognitiveservices.knowledge.qnamaker.models.PromptDTO(*, display_order: int = None, qna_id: int = None, qna=None, display_text: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Prompt for an answer.

Parameters
  • display_order (int) – Index of the prompt - used in ordering of the prompts

  • qna_id (int) – Qna id corresponding to the prompt - if QnaId is present, QnADTO object is ignored.

  • qna (PromptDTOQna) – QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO object

  • display_text (str) – Text displayed to represent a follow up question prompt

class azure.cognitiveservices.knowledge.qnamaker.models.UpdateContextDTO(*, prompts_to_delete=None, prompts_to_add=None, is_context_only: bool = None, **kwargs)[source]

Bases: msrest.serialization.Model

Update Body schema to represent context to be updated.

Parameters
  • prompts_to_delete (list[int]) – List of prompts associated with qna to be deleted

  • prompts_to_add (list[PromptDTO]) – List of prompts to be added to the qna.

  • is_context_only (bool) – To mark if a prompt is relevant only with a previous question or not. true - Do not include this QnA as search result for queries without context false - ignores context and includes this QnA in search result

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.QnADTOContext(*, is_context_only: bool = None, prompts=None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.context_dto_py3.ContextDTO

Context of a QnA.

Parameters
  • is_context_only (bool) – To mark if a prompt is relevant only with a previous question or not. true - Do not include this QnA as search result for queries without context false - ignores context and includes this QnA in search result

  • prompts (list[PromptDTO]) – List of prompts associated with the answer.

class azure.cognitiveservices.knowledge.qnamaker.models.QnADTO(*, answer: str, questions, id: int = None, source: str = None, metadata=None, context=None, last_updated_timestamp: str = 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, enable_hierarchical_extraction: bool = None, default_answer_used_for_extraction: str = None, language: str = None, enable_multiple_languages: bool = None, default_answer: str = 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.

  • enable_hierarchical_extraction (bool) – Enable hierarchical extraction of Q-A from files and urls. Value to be considered False if this field is not present.

  • default_answer_used_for_extraction (str) – Text string to be used as the answer in any Q-A which has no extracted answer from the document but has a hierarchy. Required when EnableHierarchicalExtraction field is set to True.

  • language (str) – Language of the knowledgebase. Please find the list of supported languages <a href=”https://aka.ms/qnamaker-languages#languages-supported” target=”_blank”>here</a>.

  • enable_multiple_languages (bool) – Set to true to enable creating KBs in different languages for the same resource.

  • default_answer (str) – Default answer sent to user if no good match is found in the KB.

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.ContextDTO(*, is_context_only: bool = None, prompts=None, **kwargs)[source]

Bases: msrest.serialization.Model

Context associated with Qna.

Parameters
  • is_context_only (bool) – To mark if a prompt is relevant only with a previous question or not. true - Do not include this QnA as search result for queries without context false - ignores context and includes this QnA in search result

  • prompts (list[PromptDTO]) – List of prompts associated with the answer.

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.EndpointSettingsDTOActiveLearning(*, enable: str = None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.active_learning_settings_dto_py3.ActiveLearningSettingsDTO

Active Learning settings of the endpoint.

Parameters

enable (str) – True/False string providing Active Learning

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

Bases: msrest.serialization.Model

Endpoint settings.

Parameters

active_learning (EndpointSettingsDTOActiveLearning) – Active Learning settings of the endpoint.

class azure.cognitiveservices.knowledge.qnamaker.models.ActiveLearningSettingsDTO(*, enable: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Active Learning settings of the endpoint.

Parameters

enable (str) – True/False string providing Active Learning

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, language: 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.

  • language (str) – Language setting of runtime.

class azure.cognitiveservices.knowledge.qnamaker.models.QueryDTOContext(*, previous_qna_id: int = None, previous_user_query: str = None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.query_context_dto_py3.QueryContextDTO

Context object with previous QnA’s information.

Parameters
  • previous_qna_id (int) – Previous QnA Id - qnaId of the top result.

  • previous_user_query (str) – Previous user query.

class azure.cognitiveservices.knowledge.qnamaker.models.QueryDTOAnswerSpanRequest(*, enable: bool = None, score_threshold: float = None, top_answers_with_span: int = None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.answer_span_request_dto_py3.AnswerSpanRequestDTO

To configure Answer span prediction feature.

Parameters
  • enable (bool) – Enable or Disable Answer Span prediction.

  • score_threshold (float) – Minimum threshold score required to include an answer span.

  • top_answers_with_span (int) – Number of Top answers to be considered for span prediction.

class azure.cognitiveservices.knowledge.qnamaker.models.QueryDTO(*, qna_id: str = None, question: str = None, top: int = None, user_id: str = None, is_test: bool = None, score_threshold: float = None, context=None, ranker_type: str = None, strict_filters=None, strict_filters_compound_operation_type=None, answer_span_request=None, **kwargs)[source]

Bases: msrest.serialization.Model

POST body schema to query the knowledgebase.

Parameters
  • qna_id (str) – Exact qnaId to fetch from the knowledgebase, this field takes priority over question.

  • question (str) – User question to query against the knowledge base.

  • top (int) – Max number of answers to be returned for the question.

  • user_id (str) – Unique identifier for the user.

  • is_test (bool) – Query against the test index.

  • score_threshold (float) – Minimum threshold score for answers.

  • context (QueryDTOContext) – Context object with previous QnA’s information.

  • ranker_type (str) – Optional field. Set to ‘QuestionOnly’ for using a question only Ranker.

  • strict_filters (list[MetadataDTO]) – Find QnAs that are associated with the given list of metadata.

  • strict_filters_compound_operation_type (str or StrictFiltersCompoundOperationType) – Optional field. Set to ‘OR’ for using OR operation for strict filters. Possible values include: ‘AND’, ‘OR’

  • answer_span_request (QueryDTOAnswerSpanRequest) – To configure Answer span prediction feature.

class azure.cognitiveservices.knowledge.qnamaker.models.QueryContextDTO(*, previous_qna_id: int = None, previous_user_query: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Context object with previous QnA’s information.

Parameters
  • previous_qna_id (int) – Previous QnA Id - qnaId of the top result.

  • previous_user_query (str) – Previous user query.

class azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResultContext(*, is_context_only: bool = None, prompts=None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.context_dto_py3.ContextDTO

Context object of the QnA.

Parameters
  • is_context_only (bool) – To mark if a prompt is relevant only with a previous question or not. true - Do not include this QnA as search result for queries without context false - ignores context and includes this QnA in search result

  • prompts (list[PromptDTO]) – List of prompts associated with the answer.

class azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResultAnswerSpan(*, text: str = None, score: float = None, start_index: int = None, end_index: int = None, **kwargs)[source]

Bases: azure.cognitiveservices.knowledge.qnamaker.models.answer_span_response_dto_py3.AnswerSpanResponseDTO

Answer span object of QnA with respect to user’s question.

Parameters
  • text (str) – Predicted text of answer span.

  • score (float) – Predicted score of answer span.

  • start_index (int) – Start index of answer span in answer.

  • end_index (int) – End index of answer span in answer.

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

Bases: msrest.serialization.Model

Represents Search Result.

Parameters
class azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResultList(*, answers=None, **kwargs)[source]

Bases: msrest.serialization.Model

Represents List of Question Answers.

Parameters

answers (list[QnASearchResult]) – Represents Search Result list.

class azure.cognitiveservices.knowledge.qnamaker.models.FeedbackRecordDTO(*, user_id: str = None, user_question: str = None, qna_id: int = None, **kwargs)[source]

Bases: msrest.serialization.Model

Active learning feedback record.

Parameters
  • user_id (str) – Unique identifier for the user.

  • user_question (str) – The suggested question being provided as feedback.

  • qna_id (int) – The qnaId for which the suggested question is provided as feedback.

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

Bases: msrest.serialization.Model

Active learning feedback records.

Parameters

feedback_records (list[FeedbackRecordDTO]) – List of feedback records.

class azure.cognitiveservices.knowledge.qnamaker.models.AnswerSpanRequestDTO(*, enable: bool = None, score_threshold: float = None, top_answers_with_span: int = None, **kwargs)[source]

Bases: msrest.serialization.Model

To configure Answer span prediction feature.

Parameters
  • enable (bool) – Enable or Disable Answer Span prediction.

  • score_threshold (float) – Minimum threshold score required to include an answer span.

  • top_answers_with_span (int) – Number of Top answers to be considered for span prediction.

class azure.cognitiveservices.knowledge.qnamaker.models.AnswerSpanResponseDTO(*, text: str = None, score: float = None, start_index: int = None, end_index: int = None, **kwargs)[source]

Bases: msrest.serialization.Model

Answer span object of QnA.

Parameters
  • text (str) – Predicted text of answer span.

  • score (float) – Predicted score of answer span.

  • start_index (int) – Start index of answer span in answer.

  • end_index (int) – End index of answer span in answer.

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.StrictFiltersCompoundOperationType[source]

Bases: str, enum.Enum

An enumeration.

and_enum = 'AND'
or_enum = 'OR'
class azure.cognitiveservices.knowledge.qnamaker.models.EnvironmentType[source]

Bases: str, enum.Enum

An enumeration.

prod = 'Prod'
test = 'Test'