9 references to SerializeToUtf8Bytes
Microsoft.Extensions.AI (2)
ChatCompletion\DistributedCachingChatClient.cs (2)
80var newJson = JsonSerializer.SerializeToUtf8Bytes(value, _jsonSerializerOptions.GetTypeInfo(typeof(ChatCompletion))); 91var newJson = JsonSerializer.SerializeToUtf8Bytes(value, _jsonSerializerOptions.GetTypeInfo(typeof(IReadOnlyList<StreamingChatCompletionUpdate>)));
Microsoft.Extensions.AI.AzureAIInference (3)
AzureAIInferenceChatClient.cs (2)
317result.AdditionalProperties["top_k"] = new BinaryData(JsonSerializer.SerializeToUtf8Bytes(topK, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(int)))); 330byte[] data = JsonSerializer.SerializeToUtf8Bytes(prop.Value, ToolCallJsonSerializerOptions.GetTypeInfo(typeof(object)));
AzureAIInferenceEmbeddingGenerator.cs (1)
176byte[] data = JsonSerializer.SerializeToUtf8Bytes(prop.Value, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(object)));
Microsoft.Extensions.AI.OpenAI (3)
OpenAIModelMapper.ChatCompletion.cs (1)
44new(JsonSerializer.SerializeToUtf8Bytes(
OpenAIModelMapper.ChatMessage.cs (1)
170new(JsonSerializer.SerializeToUtf8Bytes(
OpenAIModelMappers.StreamingChatCompletion.cs (1)
40functionArgumentsUpdate: 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)"/>