/// <summary>Answers the specified question using the text <paramref name="records"/>.</summary> /// <param name="question">The question to answer.</param> /// <param name="records">A collection of <see cref="TextRecord"/> to query.</param> /// <param name="language"> /// The language of the text records. This is the BCP-47 representation of a language. /// For example, use "en" for English, "es" for Spanish, etc. /// If not set, uses <see cref="QuestionAnsweringClientOptions.DefaultLanguage"/> as the default. /// If <see cref="QuestionAnsweringClientOptions.DefaultLanguage"/> is not set, the service default, "en" for English, is used. /// </param> /// <param name="cancellationToken">An optional <see cref="CancellationToken"/> to cancel the request.</param> /// <returns><see cref="TextAnswers"/> containing answers to the <paramref name="question"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="question"/> or <paramref name="records"/> is null.</exception> /// <exception cref="RequestFailedException">The service returned an error. The exception contains details of the service error.</exception> public virtual Response <TextAnswers> QueryText(string question, IEnumerable <TextRecord> records, string language = default, CancellationToken cancellationToken = default) => QueryText(QueryTextOptions.From(question, records, language ?? Options.DefaultLanguage), cancellationToken);
/// <summary>Answers the specified question using the text <paramref name="records"/>.</summary> /// <param name="question">The question to answer.</param> /// <param name="records">The text records to query.</param> /// <param name="language">Optional language of the text <paramref name="records"/>.</param> /// <param name="cancellationToken">An optional <see cref="CancellationToken"/> to cancel the request.</param> /// <returns><see cref="TextAnswers"/> containing answers to the <paramref name="question"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="question"/> or <paramref name="records"/> is null.</exception> /// <exception cref="RequestFailedException">The service returned an error. The exception contains details of the service error.</exception> public virtual Task <Response <TextAnswers> > QueryTextAsync(string question, IEnumerable <string> records, string language = default, CancellationToken cancellationToken = default) => QueryTextAsync(QueryTextOptions.From(question, records, language), cancellationToken);