OpenTelemetryEmbeddingGenerator<TInput,TEmbedding> Class

Definition

Represents a delegating embedding generator that implements the OpenTelemetry Semantic Conventions for Generative AI systems.

C#
public sealed class OpenTelemetryEmbeddingGenerator<TInput,TEmbedding> : Microsoft.Extensions.AI.DelegatingEmbeddingGenerator<TInput,TEmbedding> where TEmbedding : Embedding

Type Parameters

TInput

The type of input used to produce embeddings.

TEmbedding

The type of embedding generated.

Inheritance
OpenTelemetryEmbeddingGenerator<TInput,TEmbedding>

Remarks

This class provides an implementation of the Semantic Conventions for Generative AI systems v1.30, defined at https://opentelemetry.io/docs/specs/semconv/gen-ai/. The specification is still experimental and subject to change; as such, the telemetry output by this client is also subject to change.

Constructors

Properties

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from DelegatingEmbeddingGenerator<TInput,TEmbedding>)
Dispose(Boolean)

Provides a mechanism for releasing unmanaged resources.

(Inherited from DelegatingEmbeddingGenerator<TInput,TEmbedding>)
GenerateAsync(IEnumerable<TInput>, EmbeddingGenerationOptions, CancellationToken)

Generates embeddings for each of the supplied values.

GetService(Type, Object)

Asks the IEmbeddingGenerator<TInput,TEmbedding> for an object of the specified type serviceType.

Extension Methods

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)