azure.ai.language.questionanswering.operations package¶
-
class
azure.ai.language.questionanswering.operations.
QuestionAnsweringClientOperationsMixin
[source]¶ -
query_knowledge_base
(options, **kwargs)[source]¶ -
query_knowledge_base
(**kwargs) Answers the specified question using your knowledge base.
- Parameters
options (QueryKnowledgeBaseOptions) – POST body of the request. Provide either options, OR individual keyword arguments. If both are provided, only the options object will be used.
- Keyword Arguments
project_name (str) – The name of the project to use.
deployment_name (str) – The name of the specific deployment of the project to use.
question (str) – User question to query against the knowledge base. Provide either options, OR individual keyword arguments. If both are provided, only the options object will be used.
qna_id (int) – Exact QnA ID to fetch from the knowledge base, this field takes priority over question.
top (int) – Max number of answers to be returned for the question.
user_id (str) – Unique identifier for the user.
confidence_score_threshold (float) – Minimum threshold score for answers, value ranges from 0 to 1.
context (KnowledgeBaseAnswerRequestContext) – Context object with previous QnA’s information.
ranker_type (str or RankerType) – (Optional) Set to ‘QuestionOnly’ for using a question only Ranker. Possible values include: “Default”, “QuestionOnly”.
filters (QueryFilters) – Filter QnAs based on give metadata list and knowledge base source names.
answer_span_request (AnswerSpanRequest) – To configure Answer span prediction feature.
include_unstructured_sources (bool) – (Optional) Flag to enable Query over Unstructured Sources.
- Returns
KnowledgeBaseAnswers
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
query_text
(options, **kwargs)[source]¶ -
query_text
(**kwargs) Answers the specified question using the provided text in the body.
- Parameters
options (QueryTextOptions) – POST body of the request. Provide either options, OR individual keyword arguments. If both are provided, only the options object will be used.
- Keyword Arguments
question (str) – User question to query against the given text records. Provide either options, OR individual keyword arguments. If both are provided, only the options object will be used.
records (list[str or TextRecord]) – Text records to be searched for given question. Provide either options, OR individual keyword arguments. If both are provided, only the options object will be used.
language (str) – Language of the text records. This is BCP-47 representation of a language. For example, use “en” for English; “es” for Spanish etc. If not set, use “en” for English as default.
- Returns
TextAnswers
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-