9 references to SerializeToUtf8Bytes
Microsoft.Extensions.AI (2)
ChatCompletion\DistributedCachingChatClient.cs (2)
80
var newJson = JsonSerializer.
SerializeToUtf8Bytes
(value, _jsonSerializerOptions.GetTypeInfo(typeof(ChatCompletion)));
91
var newJson = JsonSerializer.
SerializeToUtf8Bytes
(value, _jsonSerializerOptions.GetTypeInfo(typeof(IReadOnlyList<StreamingChatCompletionUpdate>)));
Microsoft.Extensions.AI.AzureAIInference (3)
AzureAIInferenceChatClient.cs (2)
317
result.AdditionalProperties["top_k"] = new BinaryData(JsonSerializer.
SerializeToUtf8Bytes
(topK, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(int))));
330
byte[] data = JsonSerializer.
SerializeToUtf8Bytes
(prop.Value, ToolCallJsonSerializerOptions.GetTypeInfo(typeof(object)));
AzureAIInferenceEmbeddingGenerator.cs (1)
176
byte[] data = JsonSerializer.
SerializeToUtf8Bytes
(prop.Value, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(object)));
Microsoft.Extensions.AI.OpenAI (3)
OpenAIModelMapper.ChatCompletion.cs (1)
44
new(JsonSerializer.
SerializeToUtf8Bytes
(
OpenAIModelMapper.ChatMessage.cs (1)
170
new(JsonSerializer.
SerializeToUtf8Bytes
(
OpenAIModelMappers.StreamingChatCompletion.cs (1)
40
functionArgumentsUpdate: new(JsonSerializer.
SerializeToUtf8Bytes
(functionCallContent.Arguments, options.GetTypeInfo(typeof(IDictionary<string, object?>))))));
System.Text.Json (1)
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (1)
107
/// encoding since the implementation internally uses UTF-8. See also <see cref="
SerializeToUtf8Bytes
(object?, JsonTypeInfo)"/>