QuestionAnsweringClient.GetAnswersFromTextAsync Method

Definition

Overloads

GetAnswersFromTextAsync(AnswersFromTextOptions, CancellationToken)

Answers the specified question using the provided text in the body.

GetAnswersFromTextAsync(String, IEnumerable<TextDocument>, String, CancellationToken)

Answers the specified question using the text textDocuments.

GetAnswersFromTextAsync(String, IEnumerable<String>, String, CancellationToken)

Answers the specified question using the text textDocuments.

GetAnswersFromTextAsync(AnswersFromTextOptions, CancellationToken)

Source:
QuestionAnsweringClient.cs

Answers the specified question using the provided text in the body.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>> GetAnswersFromTextAsync (Azure.AI.Language.QuestionAnswering.AnswersFromTextOptions options, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnswersFromTextAsync : Azure.AI.Language.QuestionAnswering.AnswersFromTextOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>>
override this.GetAnswersFromTextAsync : Azure.AI.Language.QuestionAnswering.AnswersFromTextOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>>
Public Overridable Function GetAnswersFromTextAsync (options As AnswersFromTextOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AnswersFromTextResult))

Parameters

options
AnswersFromTextOptions

The question to answer.

cancellationToken
CancellationToken

An optional CancellationToken to cancel the request.

Returns

AnswersFromTextResult containing answers to the Question.

Exceptions

options is null.

The service returned an error. The exception contains details of the service error.

Applies to

GetAnswersFromTextAsync(String, IEnumerable<TextDocument>, String, CancellationToken)

Source:
QuestionAnsweringClient.cs

Answers the specified question using the text textDocuments.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>> GetAnswersFromTextAsync (string question, System.Collections.Generic.IEnumerable<Azure.AI.Language.QuestionAnswering.TextDocument> textDocuments, string language = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnswersFromTextAsync : string * seq<Azure.AI.Language.QuestionAnswering.TextDocument> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>>
override this.GetAnswersFromTextAsync : string * seq<Azure.AI.Language.QuestionAnswering.TextDocument> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>>
Public Overridable Function GetAnswersFromTextAsync (question As String, textDocuments As IEnumerable(Of TextDocument), Optional language As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AnswersFromTextResult))

Parameters

question
String

The question to answer.

textDocuments
IEnumerable<TextDocument>

A collection of TextDocument to query.

language
String

The language of the text documents. This is the BCP-47 representation of a language. For example, use "en" for English, "es" for Spanish, etc. If not set, uses DefaultLanguage as the default. If DefaultLanguage is not set, the service default, "en" for English, is used. See https://docs.microsoft.com/azure/cognitive-services/qnamaker/overview/language-support for list of currently supported languages.

cancellationToken
CancellationToken

An optional CancellationToken to cancel the request.

Returns

AnswersFromTextResult containing answers to the question.

Exceptions

question or textDocuments is null.

The service returned an error. The exception contains details of the service error.

Applies to

GetAnswersFromTextAsync(String, IEnumerable<String>, String, CancellationToken)

Source:
QuestionAnsweringClient.cs

Answers the specified question using the text textDocuments.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>> GetAnswersFromTextAsync (string question, System.Collections.Generic.IEnumerable<string> textDocuments, string language = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnswersFromTextAsync : string * seq<string> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>>
override this.GetAnswersFromTextAsync : string * seq<string> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>>
Public Overridable Function GetAnswersFromTextAsync (question As String, textDocuments As IEnumerable(Of String), Optional language As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AnswersFromTextResult))

Parameters

question
String

The question to answer.

textDocuments
IEnumerable<String>

The text documents to query.

language
String

The language of the text documents. This is the BCP-47 representation of a language. For example, use "en" for English, "es" for Spanish, etc. If not set, uses DefaultLanguage as the default. If DefaultLanguage is not set, the service default, "en" for English, is used. See https://docs.microsoft.com/azure/cognitive-services/qnamaker/overview/language-support for list of currently supported languages.

cancellationToken
CancellationToken

An optional CancellationToken to cancel the request.

Returns

AnswersFromTextResult containing answers to the question.

Exceptions

question or textDocuments is null.

The service returned an error. The exception contains details of the service error.

Applies to