Table of Contents

Method Create

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

Create(ReadOnlySpan<float>)

Builds a vector from the components a provider returned.

public static EmbeddingVector Create(ReadOnlySpan<float> components)

Parameters

components ReadOnlySpan<float>

The components, which are copied so a later write to the source cannot change the vector.

Returns

EmbeddingVector

The vector.

Remarks

A non-finite component is refused here rather than stored, because it survives every distance operator as a result that is neither an error nor a number: a NaN compares false against everything, so the chunk carrying it silently stops being retrievable instead of failing.

Exceptions

ArgumentException

Thrown when the sequence is empty or holds a value that is not a finite number.