EmbeddingGenerationOptions.RawRepresentationFactory Property

Definition

Gets or sets a callback responsible for creating the raw representation of the embedding generation options from an underlying implementation.

public:
 property Func<Microsoft::Extensions::AI::IEmbeddingGenerator ^, System::Object ^> ^ RawRepresentationFactory { Func<Microsoft::Extensions::AI::IEmbeddingGenerator ^, System::Object ^> ^ get(); void set(Func<Microsoft::Extensions::AI::IEmbeddingGenerator ^, System::Object ^> ^ value); };
[System.Text.Json.Serialization.JsonIgnore]
public Func<Microsoft.Extensions.AI.IEmbeddingGenerator,object?>? RawRepresentationFactory { get; set; }
[<System.Text.Json.Serialization.JsonIgnore>]
member this.RawRepresentationFactory : Func<Microsoft.Extensions.AI.IEmbeddingGenerator, obj> with get, set
Public Property RawRepresentationFactory As Func(Of IEmbeddingGenerator, Object)

Property Value

Attributes

Remarks

The underlying IEmbeddingGenerator implementation may have its own representation of options. When GenerateAsync(IEnumerable<TInput>, EmbeddingGenerationOptions, CancellationToken) is invoked with an EmbeddingGenerationOptions, that implementation may convert the provided options into its own representation in order to use it while performing the operation. For situations where a consumer knows which concrete IEmbeddingGenerator is being used and how it represents options, a new instance of that implementation-specific options type may be returned by this callback, for the IEmbeddingGenerator implementation to use instead of creating a new instance. Such implementations may mutate the supplied options instance further based on other settings supplied on this EmbeddingGenerationOptions instance or from other inputs, therefore, it is strongly recommended to not return shared instances and instead make the callback return a new instance on each call. This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly-typed properties on EmbeddingGenerationOptions.

Applies to