Table of Contents

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

storedEmailId StoredEmailId

The message whose passages are being embedded.

profileId EmbeddingProfileId

The profile the passages are being embedded into.

maxCount int

The greatest number of passages to return, which the caller sets from what one provider call accepts.

cancellationToken CancellationToken

Cancels 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 maxCount is not positive.