OpenAISerializationHelpers.SerializeAsync Method
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.
Serializes a Microsoft.Extensions.AI completion using the OpenAI wire format.
public static System.Threading.Tasks.Task SerializeAsync (System.IO.Stream stream, Microsoft.Extensions.AI.ChatCompletion chatCompletion, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member SerializeAsync : System.IO.Stream * Microsoft.Extensions.AI.ChatCompletion * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Shared Function SerializeAsync (stream As Stream, chatCompletion As ChatCompletion, Optional options As JsonSerializerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- stream
- Stream
The stream to write the value.
- chatCompletion
- ChatCompletion
The chat completion to serialize.
- options
- JsonSerializerOptions
The JsonSerializerOptions governing function call content serialization.
- cancellationToken
- CancellationToken
A token used to cancel the serialization operation.
Returns
A task tracking the serialization operation.
Applies to
Samarbeid med oss på GitHub
Du finner kilden for dette innholdet på GitHub. Der du også kan opprette og se gjennom problemer og pull-forespørsler. Hvis du vil ha mer informasjon, kan du se vår bidragsyterveiledning.