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
resumeAfterStoredEmailId?The position to continue past, or null to start at the beginning.
profileIdEmbeddingProfileIdThe profile whose vectors decide what is outstanding.
batchSizeintThe greatest number of messages to return.
cancellationTokenCancellationTokenPropagates 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
batchSizeis not positive.