Method AnswerAsync
- Namespace
- MailFathom.Application.Retrieval
- Assembly
- MailFathom.Application.dll
AnswerAsync(MailQuestion, MailAnsweringRunObservation, CancellationToken)
Answers one question, retrieving mail from within its scope as the model asks for it.
Task<MailAnswer> AnswerAsync(MailQuestion question, MailAnsweringRunObservation observation, CancellationToken cancellationToken)
Parameters
questionMailQuestionWhat was asked, and the mail the answer may be drawn from.
observationMailAnsweringRunObservationThe run's own record, which the run fills in as it proceeds and the caller reads back however the run ended.
cancellationTokenCancellationTokenCancels the run and every provider call remaining in it.
Returns
- Task<MailAnswer>
The answer.
Remarks
The observation is written to whether or not this call returns, which is the whole reason it is a parameter rather than part of the answer: what a failed run retrieved before it failed is exactly what a record of it has to say, and a run that threw has no answer to carry it out on.
Exceptions
- ArgumentNullException
Thrown when
questionorobservationis null.- ArgumentException
Thrown when the conversation the question composes into is larger than one call may send.
- ChatGenerationFailedException
Thrown when the run produced no answer, naming which kind of failure ended it.
- OperationCanceledException
Thrown when the caller cancelled, which is never reported as a provider failure.