ChatOptions.RawRepresentationFactory Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a callback responsible for creating the raw representation of the chat options from an underlying implementation.
public:
property Func<Microsoft::Extensions::AI::IChatClient ^, System::Object ^> ^ RawRepresentationFactory { Func<Microsoft::Extensions::AI::IChatClient ^, System::Object ^> ^ get(); void set(Func<Microsoft::Extensions::AI::IChatClient ^, System::Object ^> ^ value); };
[System.Text.Json.Serialization.JsonIgnore]
public Func<Microsoft.Extensions.AI.IChatClient,object?>? RawRepresentationFactory { get; set; }
[<System.Text.Json.Serialization.JsonIgnore>]
member this.RawRepresentationFactory : Func<Microsoft.Extensions.AI.IChatClient, obj> with get, set
Public Property RawRepresentationFactory As Func(Of IChatClient, Object)
Property Value
- Attributes
Remarks
The underlying IChatClient implementation may have its own representation of options. When GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken) or GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken) is invoked with a ChatOptions, 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 IChatClient 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 IChatClient 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 ChatOptions instance or from other inputs, like the enumerable of ChatMessages, 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 ChatOptions.