Method AddReplyDraftAgent
- Namespace
- MailFathom.AI
- Assembly
- MailFathom.AI.dll
AddReplyDraftAgent(IServiceCollection, bool)
Registers the agent that drafts a reply, and the use case a composer reaches it through.
public static IServiceCollection AddReplyDraftAgent(this IServiceCollection services, bool derivesStyleFromSentMail)
Parameters
servicesIServiceCollectionThe service collection to add to.
derivesStyleFromSentMailboolWhether a draft's manner is derived from the answering account's own recent sent mail.
Returns
- IServiceCollection
The same service collection, so registration reads as one expression.
Remarks
Called only where the deployment declared a chat endpoint and turned drafting on, so the use case's absence is the answer a composer gets: it offers the empty page somebody writes in rather than a button that fails. That is why nothing stands in for it when this is not called — a stand-in answering "nothing drafted" would have every caller wait on a provider-shaped call that a deployment with no provider can never make.
The use case is registered here rather than beside the other mail reads, because it is the one of them that is meaningless without the writer this call registers: the two are one switch and are turned on together.
Both are scoped, because one request is one drafting: the ledger the call is charged to, the credential it resolves, the transport it opens, and the scope its mail is read under all belong to that request.
Exceptions
- ArgumentNullException
Thrown when
servicesis null.