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(),
|
2024-06-28 10:54:00 -05:00
|
|
|
new EventDataConverter(),
|
|
|
|
|
new ContentDeltaConverter(),
|
2024-06-27 23:26:53 -05:00
|
|
|
},
|
|
|
|
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
|
|
|
|
};
|
|
|
|
|
}
|