Table of Contents

Method AnswerAsync

Namespace
MailFathom.Application.Chat
Assembly
MailFathom.Application.dll

AnswerAsync(IReadOnlyList<ChatMessage>, CancellationToken)

Sends a conversation and returns what the model answered.

Task<ChatAnswer> AnswerAsync(IReadOnlyList<ChatMessage> conversation, CancellationToken cancellationToken)

Parameters

conversation IReadOnlyList<ChatMessage>

The turns to send, oldest first.

cancellationToken CancellationToken

Cancels the call and every remaining attempt.

Returns

Task<ChatAnswer>

The answer, whose text is never empty.

Exceptions

ArgumentNullException

Thrown when conversation is null.

ArgumentException

Thrown when the conversation is empty, holds a blank turn, or is larger than one call sends.

ChatGenerationFailedException

Thrown when the call produced no answer, naming which kind of failure ended it.

OperationCanceledException

Thrown when the caller cancelled, which is never reported as a provider failure.