Table of Contents

Method GetEmailsAwaitingEmbeddingAsync

Namespace
MailFathom.Application.Emails.Embeddings.Backfill
Assembly
MailFathom.Application.dll

GetEmailsAwaitingEmbeddingAsync(StoredEmailId?, EmbeddingProfileId, int, CancellationToken)

Reads the next bounded batch of messages that are not current for the given profile.

Task<IReadOnlyList<StoredEmailAwaitingEmbedding>> GetEmailsAwaitingEmbeddingAsync(StoredEmailId? resumeAfter, EmbeddingProfileId profileId, int batchSize, CancellationToken cancellationToken)

Parameters

resumeAfter StoredEmailId?

The position to continue past, or null to start at the beginning.

profileId EmbeddingProfileId

The profile whose vectors decide what is outstanding.

batchSize int

The greatest number of messages to return.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<IReadOnlyList<StoredEmailAwaitingEmbedding>>

The messages to bring up to date, in the order the resume position is expressed in, and never more than batchSize.

Remarks

Two conditions select a message, and they are the two halves of what this backfill exists for: a message whose extraction produced text and which carries no passages at all was stored before chunking existed, and a message carrying a passage with no vector under this profile was stored before the profile existed or was turned away by the live backlog's bound. A message no one may search is not selected, because vectors nothing may retrieve are a provider bill with no reader.

Exceptions

ArgumentOutOfRangeException

Thrown when batchSize is not positive.