Files
anthropic-client/src/AnthropicClient/Json/JsonSerializationOptions.cs
T

20 lines
490 B
C#
Raw Normal View History

2024-06-27 23:26:53 -05:00
using System.Text.Json;
using System.Text.Json.Serialization;
namespace AnthropicClient.Json;
static class JsonSerializationOptions
{
public static JsonSerializerOptions DefaultOptions => new()
{
PropertyNameCaseInsensitive = true,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
Converters =
{
new ContentConverter(),
new ToolChoiceConverter(),
new ErrorConverter(),
},
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
};
}