Constructor SemanticEmailSearch
- Namespace
- MailFathom.Application.Emails.Search
- Assembly
- MailFathom.Application.dll
SemanticEmailSearch(IActiveEmbeddingProfileReader, IEmailVectorSearchIndexReader, IAiProviderHealthReader, TimeProvider, ITextEmbeddingGenerator?)
Initializes semantic retrieval over whatever this deployment configured.
public SemanticEmailSearch(IActiveEmbeddingProfileReader profileReader, IEmailVectorSearchIndexReader vectorSearchIndexReader, IAiProviderHealthReader providerHealthReader, TimeProvider timeProvider, ITextEmbeddingGenerator? textEmbeddingGenerator)
Parameters
profileReaderIActiveEmbeddingProfileReaderAnswers which vector space this instance retrieves under, if any.
vectorSearchIndexReaderIEmailVectorSearchIndexReaderRanks the eligible mail by distance from a point in that space.
providerHealthReaderIAiProviderHealthReaderAnswers what the last call to the embedding provider established about it.
timeProviderTimeProviderMeasures how long ago that was, which is what keeps a recorded failure from latching.
textEmbeddingGeneratorITextEmbeddingGeneratorPlaces a query in that space, or null when this deployment configured no embedding provider.
Remarks
The generator is the one optional dependency in the read path, and its absence is the deployment decision rather than a missing registration: the composition root registers an embedding adapter only for an instance that declared an endpoint chain, so resolving one here would make lexical-only deployments fail to start a search rather than serve it.
Exceptions
- ArgumentNullException
Thrown when
profileReader,vectorSearchIndexReader,providerHealthReader, ortimeProvideris null.