Table of Contents

Class OnnxEmbeddingGenerator

Namespace
Qavren.Edge.Embeddings.Onnx
Assembly
Qavren.Edge.Embeddings.Onnx.dll

The single public leaf. It implements the LITERAL closed generic MEVD pattern-matches; a generator typed to any other input type is silently unresolvable by a vector store. Thread-safe: concurrent calls serialise on one semaphore around ORT Run.

public sealed class OnnxEmbeddingGenerator : IEmbeddingGenerator<string, Embedding<float>>, IEmbeddingGenerator, IDisposable
Inheritance
OnnxEmbeddingGenerator
Implements
Inherited Members
Extension Methods

Constructors

OnnxEmbeddingGenerator(IOnnxSessionHost, IEdgeTokenizerProvider, IEdgeResourceMonitor, IOptions<OnnxEmbeddingOptions>, EmbeddingInputKind, ILogger<OnnxEmbeddingGenerator>, TimeProvider)

Creates a generator for one input kind.

Properties

Dimensions

The fixed embedding width.

Info

Everything a support request needs about this generator.

Methods

Dispose()

Releases this generator's session lease. Does NOT dispose the shared session - the session host owns it - so wrapping this in a delegating generator, which disposes its inner by default, is safe.

GenerateAsync(IEnumerable<string>, EmbeddingGenerationOptions?, CancellationToken)

Exactly one embedding per input, in input order. An empty sequence returns an empty collection without touching ORT.

GetService(Type, object?)

Returns, in order: this when assignable; EmbeddingGeneratorMetadata; OnnxEmbeddingGeneratorInfo; EmbeddingPreset; OnnxSessionInfo; IEdgeTokenizer; and, for serviceKey QueryServiceKey, the query-prefixed sibling generator - returned for a serviceType of either the non-generic IEmbeddingGenerator or the closed generic, because the vector store asks with the non-generic type while a direct caller usually asks with the closed one.