Class AgentAnswering
- Namespace
- MailFathom.Application.Agent.Answering
- Assembly
- MailFathom.Application.dll
Answers one question a conversation recorded, writing the answer into it as it is composed and ending it however the run went.
public sealed class AgentAnswering
- Inheritance
-
AgentAnswering
- Inherited Members
Remarks
The run outlives the connection that asked, and every connection. Nothing here reads a request: it is handed a question the conversation already holds, composes with no client attached, and stops only on a stop the person recorded, on a ceiling it reaches, or on the process going away. Whatever ended it, the answer ends in the record, so a conversation read later says how.
It spends like every other answer. The run is admitted against the deployment's period before any provider is reached, and every call it makes is counted by the run's own ceiling and the provider's bulkhead inside the composition — the same three every on-request derivation here passes through, rather than an unmetered fourth.
A turn sends at most what the deployment's budget allows. A conversation that has outgrown it is compacted first: what came earlier is summarised, the summary is recorded beside everything it covers, and the turn is composed from the newest summary plus everything written after it verbatim. A summary is never shown, never announced, and never a message, and a summariser that fails does not fail the turn — the turn is composed from as much recent history as fits, nothing is recorded, and the failure is the operator's to read rather than the person's.
Constructors
- AgentAnswering(IAgentConversationStore, IAgentAnswerComposer?, IAgentConversationSummarizer?, AgentContextBudget, IMailAnsweringSpendLedger, ClientSignals, IUserLanguages, TimeProvider)
Initializes the use case.
Fields
- MaximumDuration
The longest a run may compose before it is ended as failed.
Methods
- RunAsync(AgentQuestion, CancellationToken)
Composes the answer to one question and leaves it ended.