QuestionAnsweringClient.GetAnswers Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetAnswers(Int32, QuestionAnsweringProject, AnswersOptions, CancellationToken) |
Gets the specified QnA. |
GetAnswers(String, QuestionAnsweringProject, AnswersOptions, CancellationToken) |
Answers the specified question using your knowledge base. |
GetAnswers(Int32, QuestionAnsweringProject, AnswersOptions, CancellationToken)
- Source:
- QuestionAnsweringClient.cs
Gets the specified QnA.
public virtual Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersResult> GetAnswers (int qnaId, Azure.AI.Language.QuestionAnswering.QuestionAnsweringProject project, Azure.AI.Language.QuestionAnswering.AnswersOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnswers : int * Azure.AI.Language.QuestionAnswering.QuestionAnsweringProject * Azure.AI.Language.QuestionAnswering.AnswersOptions * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersResult>
override this.GetAnswers : int * Azure.AI.Language.QuestionAnswering.QuestionAnsweringProject * Azure.AI.Language.QuestionAnswering.AnswersOptions * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersResult>
Public Overridable Function GetAnswers (qnaId As Integer, project As QuestionAnsweringProject, Optional options As AnswersOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AnswersResult)
Parameters
- qnaId
- Int32
The exact QnA ID to fetch from the knowledge base.
- project
- QuestionAnsweringProject
The QuestionAnsweringProject to query.
- options
- AnswersOptions
Optional AnswersOptions with additional query options.
- cancellationToken
- CancellationToken
An optional CancellationToken to cancel the request.
Returns
An AnswersResult containing answers from the knowledge base to the specified question.
Exceptions
project
is null.
The service returned an error. The exception contains details of the service error.
Applies to
GetAnswers(String, QuestionAnsweringProject, AnswersOptions, CancellationToken)
- Source:
- QuestionAnsweringClient.cs
Answers the specified question using your knowledge base.
public virtual Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersResult> GetAnswers (string question, Azure.AI.Language.QuestionAnswering.QuestionAnsweringProject project, Azure.AI.Language.QuestionAnswering.AnswersOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnswers : string * Azure.AI.Language.QuestionAnswering.QuestionAnsweringProject * Azure.AI.Language.QuestionAnswering.AnswersOptions * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersResult>
override this.GetAnswers : string * Azure.AI.Language.QuestionAnswering.QuestionAnsweringProject * Azure.AI.Language.QuestionAnswering.AnswersOptions * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersResult>
Public Overridable Function GetAnswers (question As String, project As QuestionAnsweringProject, Optional options As AnswersOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AnswersResult)
Parameters
- question
- String
The question to ask of the knowledge base.
- project
- QuestionAnsweringProject
The QuestionAnsweringProject to query.
- options
- AnswersOptions
Optional AnswersOptions with additional query options.
- cancellationToken
- CancellationToken
An optional CancellationToken to cancel the request.
Returns
An AnswersResult containing answers from the knowledge base to the specified question.
Exceptions
question
is an empty string.
question
or project
is null.
The service returned an error. The exception contains details of the service error.
Applies to
Azure SDK for .NET