Table of Contents

Method AddMailAnsweringAgent

Namespace
MailFathom.AI
Assembly
MailFathom.AI.dll

AddMailAnsweringAgent(IServiceCollection)

Registers the agent that answers a question about the mailbox from what it retrieves while answering.

public static IServiceCollection AddMailAnsweringAgent(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection to add to.

Returns

IServiceCollection

The same service collection, so registration reads as one expression.

Remarks

Called only where a chat endpoint was declared, and beside AddChatProviderAdapter(IServiceCollection) rather than inside it: they are two capabilities over one endpoint, and an instance that answers questions is not the same decision as one that can generate text.

Scoped, because a run retrieves through the mailbox search, and that reads through the scoped persistence context. It adds no transport of its own — a run's requests go to the same endpoint under the same bounds as any other chat request, so it sends over the client that registration named.

The instruction envelope every composed agent is wrapped in is registered here rather than by the composition root, because it is what this boundary composes with rather than something a deployment declares. It is added only if nothing registered one already, so an implementation supplying a person's language or a deployment's own wording replaces the empty default by registering before this runs, with whatever lifetime its answer varies over.

Exceptions

ArgumentNullException

Thrown when services is null.