Method GetChunksAwaitingEmbeddingAsync
- Namespace
- MailFathom.Application.Emails.Embeddings
- Assembly
- MailFathom.Application.dll
GetChunksAwaitingEmbeddingAsync(StoredEmailId, EmbeddingProfileId, int, CancellationToken)
Reads a bounded page of one message's passages that carry no vector under the given profile.
Task<IReadOnlyList<EmailChunkAwaitingEmbedding>> GetChunksAwaitingEmbeddingAsync(StoredEmailId storedEmailId, EmbeddingProfileId profileId, int maxCount, CancellationToken cancellationToken)
Parameters
storedEmailIdStoredEmailIdThe message whose passages are being embedded.
profileIdEmbeddingProfileIdThe profile the passages are being embedded into.
maxCountintThe greatest number of passages to return, which the caller sets from what one provider call accepts.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<EmailChunkAwaitingEmbedding>>
The outstanding passages in reading order, or an empty list when the message is already current for this profile.
Remarks
Ordered by the passage's position in its message, so a message embedded across several calls is filled in reading order and an interrupted run leaves a prefix rather than a scatter. The query joins no transaction: it reads committed state, which is what lets a provider call happen outside any open one.
Exceptions
- ArgumentOutOfRangeException
Thrown when
maxCountis not positive.