diff --git a/src/helpers/FixOpenApiSpec/Program.cs b/src/helpers/FixOpenApiSpec/Program.cs index 20a4022..bfedcf7 100644 --- a/src/helpers/FixOpenApiSpec/Program.cs +++ b/src/helpers/FixOpenApiSpec/Program.cs @@ -1,4 +1,5 @@ using Microsoft.OpenApi; +using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Extensions; using Microsoft.OpenApi.Readers; @@ -7,7 +8,27 @@ var openApiDocument = new OpenApiStringReader().Read(jsonOrYaml, out var diagnostics); -openApiDocument.Components.Schemas["MessageStreamEvent"]!.Discriminator.Mapping["error"] = "#/components/schemas/ErrorEvent"; +openApiDocument.Components.Schemas["TextBlock"].Properties["type"].Enum = new List +{ + new OpenApiString("text"), +}; +openApiDocument.Components.Schemas["ImageBlock"].Properties["type"].Enum = new List +{ + new OpenApiString("image"), +}; +openApiDocument.Components.Schemas["ToolUseBlock"]!.Properties["type"].Enum = new List +{ + new OpenApiString("tool_use"), +}; +openApiDocument.Components.Schemas["ToolResultBlock"]!.Properties["type"].Enum = new List +{ + new OpenApiString("tool_result"), +}; + +openApiDocument.Components.Schemas["TextBlock"].Required.Add("type"); +openApiDocument.Components.Schemas["ImageBlock"].Required.Add("type"); +openApiDocument.Components.Schemas["ToolUseBlock"].Required.Add("type"); +openApiDocument.Components.Schemas["ToolResultBlock"].Required.Add("type"); jsonOrYaml = openApiDocument.SerializeAsYaml(OpenApiSpecVersion.OpenApi3_0); _ = new OpenApiStringReader().Read(jsonOrYaml, out diagnostics); diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ImageBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ImageBlock.g.cs index b5742b7..b0ba688 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ImageBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ImageBlock.g.cs @@ -20,7 +20,8 @@ public sealed partial class ImageBlock /// Default Value: image /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - public string? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ImageBlockTypeJsonConverter))] + public global::Anthropic.ImageBlockType Type { get; set; } = global::Anthropic.ImageBlockType.Image; /// /// The cache control settings. diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ImageBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ImageBlockType.g.cs new file mode 100644 index 0000000..1f7fbc7 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ImageBlockType.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// The type of content block.
+ /// Default Value: image + ///
+ public enum ImageBlockType + { + /// + /// + /// + Image, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ImageBlockTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ImageBlockType value) + { + return value switch + { + ImageBlockType.Image => "image", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ImageBlockType? ToEnum(string value) + { + return value switch + { + "image" => ImageBlockType.Image, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.TextBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.TextBlock.g.cs index b95b401..c68ce3d 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.TextBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.TextBlock.g.cs @@ -20,7 +20,8 @@ public sealed partial class TextBlock /// Default Value: text ///
[global::System.Text.Json.Serialization.JsonPropertyName("type")] - public string? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.TextBlockTypeJsonConverter))] + public global::Anthropic.TextBlockType Type { get; set; } = global::Anthropic.TextBlockType.Text; /// /// The cache control settings. diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.TextBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.TextBlockType.g.cs new file mode 100644 index 0000000..bc0dbe1 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.TextBlockType.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// The type of content block.
+ /// Default Value: text + ///
+ public enum TextBlockType + { + /// + /// + /// + Text, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class TextBlockTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this TextBlockType value) + { + return value switch + { + TextBlockType.Text => "text", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static TextBlockType? ToEnum(string value) + { + return value switch + { + "text" => TextBlockType.Text, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlock.g.cs index cc22385..91c2a90 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlock.g.cs @@ -38,7 +38,8 @@ public sealed partial class ToolResultBlock /// Default Value: tool_result ///
[global::System.Text.Json.Serialization.JsonPropertyName("type")] - public string? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ToolResultBlockTypeJsonConverter))] + public global::Anthropic.ToolResultBlockType Type { get; set; } = global::Anthropic.ToolResultBlockType.ToolResult; /// /// The cache control settings. diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlockType.g.cs new file mode 100644 index 0000000..bf4e924 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlockType.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// The type of content block.
+ /// Default Value: tool_result + ///
+ public enum ToolResultBlockType + { + /// + /// + /// + ToolResult, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ToolResultBlockTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ToolResultBlockType value) + { + return value switch + { + ToolResultBlockType.ToolResult => "tool_result", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ToolResultBlockType? ToEnum(string value) + { + return value switch + { + "tool_result" => ToolResultBlockType.ToolResult, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolUseBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolUseBlock.g.cs index 99ae350..9d10e79 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ToolUseBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolUseBlock.g.cs @@ -37,7 +37,8 @@ public sealed partial class ToolUseBlock /// Default Value: tool_use ///
[global::System.Text.Json.Serialization.JsonPropertyName("type")] - public string? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ToolUseBlockTypeJsonConverter))] + public global::Anthropic.ToolUseBlockType Type { get; set; } = global::Anthropic.ToolUseBlockType.ToolUse; /// /// The cache control settings. diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolUseBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolUseBlockType.g.cs new file mode 100644 index 0000000..1195dd3 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolUseBlockType.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// The type of content block.
+ /// Default Value: tool_use + ///
+ public enum ToolUseBlockType + { + /// + /// + /// + ToolUse, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ToolUseBlockTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ToolUseBlockType value) + { + return value switch + { + ToolUseBlockType.ToolUse => "tool_use", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ToolUseBlockType? ToEnum(string value) + { + return value switch + { + "tool_use" => ToolUseBlockType.ToolUse, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.ImageBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ImageBlockType.g.cs new file mode 100644 index 0000000..8882e32 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ImageBlockType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ImageBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ImageBlockType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Anthropic.ImageBlockTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ImageBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ImageBlockType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.ImageBlockTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ImageBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ImageBlockTypeNullable.g.cs new file mode 100644 index 0000000..74d8ae0 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ImageBlockTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ImageBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ImageBlockType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Anthropic.ImageBlockTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ImageBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ImageBlockType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Anthropic.ImageBlockTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.TextBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.TextBlockType.g.cs new file mode 100644 index 0000000..a3e366e --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.TextBlockType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class TextBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.TextBlockType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Anthropic.TextBlockTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.TextBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.TextBlockType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.TextBlockTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.TextBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.TextBlockTypeNullable.g.cs new file mode 100644 index 0000000..0d8defa --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.TextBlockTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class TextBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.TextBlockType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Anthropic.TextBlockTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.TextBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.TextBlockType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Anthropic.TextBlockTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ToolResultBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ToolResultBlockType.g.cs new file mode 100644 index 0000000..0817cf1 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ToolResultBlockType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ToolResultBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ToolResultBlockType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Anthropic.ToolResultBlockTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ToolResultBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ToolResultBlockType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.ToolResultBlockTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ToolResultBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ToolResultBlockTypeNullable.g.cs new file mode 100644 index 0000000..a9420a8 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ToolResultBlockTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ToolResultBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ToolResultBlockType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Anthropic.ToolResultBlockTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ToolResultBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ToolResultBlockType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Anthropic.ToolResultBlockTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ToolUseBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ToolUseBlockType.g.cs new file mode 100644 index 0000000..3bfc36b --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ToolUseBlockType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ToolUseBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ToolUseBlockType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Anthropic.ToolUseBlockTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ToolUseBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ToolUseBlockType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.ToolUseBlockTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ToolUseBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ToolUseBlockTypeNullable.g.cs new file mode 100644 index 0000000..971366e --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ToolUseBlockTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ToolUseBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ToolUseBlockType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Anthropic.ToolUseBlockTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ToolUseBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ToolUseBlockType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Anthropic.ToolUseBlockTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs b/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs index df3f134..4914905 100644 --- a/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs +++ b/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs @@ -15,12 +15,20 @@ namespace Anthropic { typeof(global::Anthropic.JsonConverters.CreateMessageRequestModelJsonConverter), typeof(global::Anthropic.JsonConverters.CreateMessageRequestModelNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.TextBlockTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.TextBlockTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.CacheControlEphemeralTypeJsonConverter), typeof(global::Anthropic.JsonConverters.CacheControlEphemeralTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ImageBlockSourceMediaTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ImageBlockSourceMediaTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ImageBlockSourceTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ImageBlockSourceTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ImageBlockTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ImageBlockTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolUseBlockTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolUseBlockTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolResultBlockTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolResultBlockTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BlockDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BlockDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageRoleJsonConverter), diff --git a/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs b/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs index 9b840d3..0932050 100644 --- a/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs +++ b/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs @@ -58,226 +58,242 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Anthropic.CacheControlEphemeral? Type10 { get; set; } + public global::Anthropic.TextBlockType? Type10 { get; set; } /// /// /// - public global::Anthropic.CacheControlEphemeralType? Type11 { get; set; } + public global::Anthropic.CacheControlEphemeral? Type11 { get; set; } /// /// /// - public global::Anthropic.ImageBlock? Type12 { get; set; } + public global::Anthropic.CacheControlEphemeralType? Type12 { get; set; } /// /// /// - public global::Anthropic.ImageBlockSource? Type13 { get; set; } + public global::Anthropic.ImageBlock? Type13 { get; set; } /// /// /// - public global::Anthropic.ImageBlockSourceMediaType? Type14 { get; set; } + public global::Anthropic.ImageBlockSource? Type14 { get; set; } /// /// /// - public global::Anthropic.ImageBlockSourceType? Type15 { get; set; } + public global::Anthropic.ImageBlockSourceMediaType? Type15 { get; set; } /// /// /// - public global::Anthropic.ToolUseBlock? Type16 { get; set; } + public global::Anthropic.ImageBlockSourceType? Type16 { get; set; } /// /// /// - public object? Type17 { get; set; } + public global::Anthropic.ImageBlockType? Type17 { get; set; } /// /// /// - public global::Anthropic.ToolResultBlock? Type18 { get; set; } + public global::Anthropic.ToolUseBlock? Type18 { get; set; } /// /// /// - public global::Anthropic.BlockDiscriminator? Type19 { get; set; } + public object? Type19 { get; set; } /// /// /// - public bool? Type20 { get; set; } + public global::Anthropic.ToolUseBlockType? Type20 { get; set; } /// /// /// - public global::Anthropic.BlockDiscriminatorType? Type21 { get; set; } + public global::Anthropic.ToolResultBlock? Type21 { get; set; } /// /// /// - public global::Anthropic.MessageRole? Type22 { get; set; } + public global::Anthropic.BlockDiscriminator? Type22 { get; set; } /// /// /// - public global::Anthropic.StopReason? Type23 { get; set; } + public bool? Type23 { get; set; } /// /// /// - public global::Anthropic.Usage? Type24 { get; set; } + public global::Anthropic.ToolResultBlockType? Type24 { get; set; } /// /// /// - public int? Type25 { get; set; } + public global::Anthropic.BlockDiscriminatorType? Type25 { get; set; } /// /// /// - public global::Anthropic.CreateMessageRequestMetadata? Type26 { get; set; } + public global::Anthropic.MessageRole? Type26 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type27 { get; set; } + public global::Anthropic.StopReason? Type27 { get; set; } /// /// /// - public double? Type28 { get; set; } + public global::Anthropic.Usage? Type28 { get; set; } /// /// /// - public global::Anthropic.ToolChoice? Type29 { get; set; } + public int? Type29 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceType? Type30 { get; set; } + public global::Anthropic.CreateMessageRequestMetadata? Type30 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type31 { get; set; } + public global::System.Collections.Generic.IList? Type31 { get; set; } /// /// /// - public global::Anthropic.Tool? Type32 { get; set; } + public double? Type32 { get; set; } /// /// /// - public global::Anthropic.ToolCustom? Type33 { get; set; } + public global::Anthropic.ToolChoice? Type33 { get; set; } /// /// /// - public global::Anthropic.ToolComputerUse? Type34 { get; set; } + public global::Anthropic.ToolChoiceType? Type34 { get; set; } /// /// /// - public global::Anthropic.ToolTextEditor? Type35 { get; set; } + public global::System.Collections.Generic.IList? Type35 { get; set; } /// /// /// - public global::Anthropic.ToolBash? Type36 { get; set; } + public global::Anthropic.Tool? Type36 { get; set; } /// /// /// - public global::Anthropic.ToolDiscriminator? Type37 { get; set; } + public global::Anthropic.ToolCustom? Type37 { get; set; } /// /// /// - public global::Anthropic.CreateMessageBatchRequest? Type38 { get; set; } + public global::Anthropic.ToolComputerUse? Type38 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type39 { get; set; } + public global::Anthropic.ToolTextEditor? Type39 { get; set; } /// /// /// - public global::Anthropic.BatchMessageRequest? Type40 { get; set; } + public global::Anthropic.ToolBash? Type40 { get; set; } /// /// /// - public global::Anthropic.MessageBatch? Type41 { get; set; } + public global::Anthropic.ToolDiscriminator? Type41 { get; set; } /// /// /// - public global::System.DateTime? Type42 { get; set; } + public global::Anthropic.CreateMessageBatchRequest? Type42 { get; set; } /// /// /// - public global::Anthropic.MessageBatchProcessingStatus? Type43 { get; set; } + public global::System.Collections.Generic.IList? Type43 { get; set; } /// /// /// - public global::Anthropic.MessageBatchRequestCounts? Type44 { get; set; } + public global::Anthropic.BatchMessageRequest? Type44 { get; set; } /// /// /// - public global::Anthropic.MessageBatchType? Type45 { get; set; } + public global::Anthropic.MessageBatch? Type45 { get; set; } /// /// /// - public global::Anthropic.MessageStreamEvent? Type46 { get; set; } + public global::System.DateTime? Type46 { get; set; } /// /// /// - public global::Anthropic.MessageStartEvent? Type47 { get; set; } + public global::Anthropic.MessageBatchProcessingStatus? Type47 { get; set; } /// /// /// - public global::Anthropic.MessageStreamEventType? Type48 { get; set; } + public global::Anthropic.MessageBatchRequestCounts? Type48 { get; set; } /// /// /// - public global::Anthropic.MessageDeltaEvent? Type49 { get; set; } + public global::Anthropic.MessageBatchType? Type49 { get; set; } /// /// /// - public global::Anthropic.MessageDelta? Type50 { get; set; } + public global::Anthropic.MessageStreamEvent? Type50 { get; set; } /// /// /// - public global::Anthropic.MessageDeltaUsage? Type51 { get; set; } + public global::Anthropic.MessageStartEvent? Type51 { get; set; } /// /// /// - public global::Anthropic.MessageStopEvent? Type52 { get; set; } + public global::Anthropic.MessageStreamEventType? Type52 { get; set; } /// /// /// - public global::Anthropic.ContentBlockStartEvent? Type53 { get; set; } + public global::Anthropic.MessageDeltaEvent? Type53 { get; set; } /// /// /// - public global::Anthropic.ContentBlockDeltaEvent? Type54 { get; set; } + public global::Anthropic.MessageDelta? Type54 { get; set; } /// /// /// - public global::Anthropic.BlockDelta? Type55 { get; set; } + public global::Anthropic.MessageDeltaUsage? Type55 { get; set; } /// /// /// - public global::Anthropic.TextBlockDelta? Type56 { get; set; } + public global::Anthropic.MessageStopEvent? Type56 { get; set; } /// /// /// - public global::Anthropic.InputJsonBlockDelta? Type57 { get; set; } + public global::Anthropic.ContentBlockStartEvent? Type57 { get; set; } /// /// /// - public global::Anthropic.BlockDeltaDiscriminator? Type58 { get; set; } + public global::Anthropic.ContentBlockDeltaEvent? Type58 { get; set; } /// /// /// - public global::Anthropic.BlockDeltaDiscriminatorType? Type59 { get; set; } + public global::Anthropic.BlockDelta? Type59 { get; set; } /// /// /// - public global::Anthropic.ContentBlockStopEvent? Type60 { get; set; } + public global::Anthropic.TextBlockDelta? Type60 { get; set; } /// /// /// - public global::Anthropic.PingEvent? Type61 { get; set; } + public global::Anthropic.InputJsonBlockDelta? Type61 { get; set; } /// /// /// - public global::Anthropic.ErrorEvent? Type62 { get; set; } + public global::Anthropic.BlockDeltaDiscriminator? Type62 { get; set; } /// /// /// - public global::Anthropic.Error? Type63 { get; set; } + public global::Anthropic.BlockDeltaDiscriminatorType? Type63 { get; set; } /// /// /// - public global::Anthropic.MessageStreamEventDiscriminator? Type64 { get; set; } + public global::Anthropic.ContentBlockStopEvent? Type64 { get; set; } /// /// /// - public global::Anthropic.MessageStreamEventDiscriminatorType? Type65 { get; set; } + public global::Anthropic.PingEvent? Type65 { get; set; } + /// + /// + /// + public global::Anthropic.ErrorEvent? Type66 { get; set; } + /// + /// + /// + public global::Anthropic.Error? Type67 { get; set; } + /// + /// + /// + public global::Anthropic.MessageStreamEventDiscriminator? Type68 { get; set; } + /// + /// + /// + public global::Anthropic.MessageStreamEventDiscriminatorType? Type69 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Anthropic/openapi.yaml b/src/libs/Anthropic/openapi.yaml index f4d05ae..daddd77 100644 --- a/src/libs/Anthropic/openapi.yaml +++ b/src/libs/Anthropic/openapi.yaml @@ -313,12 +313,15 @@ components: TextBlock: required: - text + - type type: object properties: text: type: string description: The text content. type: + enum: + - text type: string description: The type of content block. default: text @@ -328,11 +331,14 @@ components: ImageBlock: required: - source + - type type: object properties: source: $ref: '#/components/schemas/ImageBlockSource' type: + enum: + - image type: string description: The type of content block. default: image @@ -368,6 +374,7 @@ components: - id - name - input + - type type: object properties: id: @@ -382,6 +389,8 @@ components: type: object description: 'An object containing the input being passed to the tool, conforming to the tool''s `input_schema`.' type: + enum: + - tool_use type: string description: The type of content block. default: tool_use @@ -392,6 +401,7 @@ components: required: - tool_use_id - content + - type type: object properties: tool_use_id: @@ -410,6 +420,8 @@ components: type: boolean description: Set to `true` if the tool execution resulted in an error. type: + enum: + - tool_result type: string description: The type of content block. default: tool_result