10 references to SerializeToUtf8Bytes
Microsoft.AspNetCore.Http.Results (1)
ServerSentEventsResult.cs (1)
90
var json = JsonSerializer.
SerializeToUtf8Bytes
(item.Data, typeInfo);
Microsoft.Extensions.AI (2)
ChatCompletion\DistributedCachingChatClient.cs (2)
84
var newJson = JsonSerializer.
SerializeToUtf8Bytes
(value, _jsonSerializerOptions.GetTypeInfo(typeof(ChatResponse)));
95
var newJson = JsonSerializer.
SerializeToUtf8Bytes
(value, _jsonSerializerOptions.GetTypeInfo(typeof(IReadOnlyList<ChatResponseUpdate>)));
Microsoft.Extensions.AI.AzureAIInference (3)
AzureAIInferenceChatClient.cs (2)
311
result.AdditionalProperties["top_k"] = new BinaryData(JsonSerializer.
SerializeToUtf8Bytes
(topK, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(int))));
324
byte[] data = JsonSerializer.
SerializeToUtf8Bytes
(prop.Value, ToolCallJsonSerializerOptions.GetTypeInfo(typeof(object)));
AzureAIInferenceEmbeddingGenerator.cs (1)
180
byte[] data = JsonSerializer.
SerializeToUtf8Bytes
(prop.Value, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(object)));
Microsoft.Extensions.AI.OpenAI (3)
OpenAIModelMapper.ChatCompletion.cs (1)
48
new(JsonSerializer.
SerializeToUtf8Bytes
(
OpenAIModelMapper.ChatMessage.cs (1)
180
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)"/>