diff --git a/src/helpers/FixOpenApiSpec/Program.cs b/src/helpers/FixOpenApiSpec/Program.cs index d5fec01..a9b1fcd 100644 --- a/src/helpers/FixOpenApiSpec/Program.cs +++ b/src/helpers/FixOpenApiSpec/Program.cs @@ -44,6 +44,13 @@ }, }); +openApiDocument.Components.Schemas["Tool"].Properties["input_schema"].AllOf.Clear(); +openApiDocument.Components.Schemas["Tool"].Properties["input_schema"].Type = "object"; +openApiDocument.Components.Schemas["BetaTool"].Properties["input_schema"].AllOf.Clear(); +openApiDocument.Components.Schemas["BetaTool"].Properties["input_schema"].Type = "object"; +openApiDocument.Components.Schemas["PromptCachingBetaTool"].Properties["input_schema"].AllOf.Clear(); +openApiDocument.Components.Schemas["PromptCachingBetaTool"].Properties["input_schema"].Type = "object"; + openApiDocument.Components.SecuritySchemes.Clear(); openApiDocument.Components.SecuritySchemes.Add("ApiKeyAuth", new OpenApiSecurityScheme { diff --git a/src/libs/Anthropic/Extensions/AnthropicClient.ChatClient.cs b/src/libs/Anthropic/Extensions/AnthropicClient.ChatClient.cs index 4a3ad60..017bb57 100644 --- a/src/libs/Anthropic/Extensions/AnthropicClient.ChatClient.cs +++ b/src/libs/Anthropic/Extensions/AnthropicClient.ChatClient.cs @@ -87,7 +87,7 @@ async Task IChatClient.CompleteAsync( MessageStopReason.EndTurn or MessageStopReason.StopSequence => ChatFinishReason.Stop, MessageStopReason.MaxTokens => ChatFinishReason.Length, MessageStopReason.ToolUse => ChatFinishReason.ToolCalls, - _ => new ChatFinishReason(response.StopReason.ToString()), + _ => new ChatFinishReason(response.StopReason?.ToString() ?? "Unknown"), }, }; @@ -244,14 +244,14 @@ private static CreateMessageParams CreateRequest(IList chatMessages }) : new ToolChoice(new ToolChoiceAny()) : (ToolChoice?)null, - // Tools = options?.Tools is IList tools ? - // tools.OfType().Select(f => new Tool - // { - // Name = f.Metadata.Name, - // Description = f.Metadata.Description, - // InputSchema = CreateSchema(f), - // }).ToList() : - // null, + Tools = options?.Tools is IList tools ? + tools.OfType().Select(f => new Tool + { + Name = f.Metadata.Name, + Description = f.Metadata.Description, + InputSchema = CreateSchema(f), + }).ToList() : + null, }; return request; } diff --git a/src/libs/Anthropic/Extensions/StringExtensions.cs b/src/libs/Anthropic/Extensions/StringExtensions.cs index 44acbc4..01f74ee 100755 --- a/src/libs/Anthropic/Extensions/StringExtensions.cs +++ b/src/libs/Anthropic/Extensions/StringExtensions.cs @@ -121,7 +121,7 @@ public static IList AsAnthropicTools( { Description = x.Description ?? string.Empty, Name = x.Name ?? string.Empty, - InputSchema = new InputSchema(), // x.Parameters ?? + InputSchema = x.Parameters ?? new InputSchema(), }) .ToList(); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaTool.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaTool.g.cs index 6b889c0..c1db068 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaTool.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaTool.g.cs @@ -38,7 +38,7 @@ public sealed partial class BetaTool /// [global::System.Text.Json.Serialization.JsonPropertyName("input_schema")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.BetaInputSchema InputSchema { get; set; } + public required object InputSchema { get; set; } /// /// @@ -73,7 +73,7 @@ public sealed partial class BetaTool [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public BetaTool( string name, - global::Anthropic.BetaInputSchema inputSchema, + object inputSchema, global::Anthropic.BetaToolType? type, string? description, global::Anthropic.BetaCacheControlEphemeral? cacheControl) diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaToolInputSchema.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaToolInputSchema.Json.g.cs new file mode 100644 index 0000000..fe5f6be --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaToolInputSchema.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class BetaToolInputSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Anthropic.BetaToolInputSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.BetaToolInputSchema), + jsonSerializerContext) as global::Anthropic.BetaToolInputSchema; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Anthropic.BetaToolInputSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Anthropic.BetaToolInputSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaToolInputSchema; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaToolInputSchema.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaToolInputSchema.g.cs new file mode 100644 index 0000000..3ef9a5c --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaToolInputSchema.g.cs @@ -0,0 +1,28 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// [JSON schema](https://json-schema.org/) for this tool's input.
+ /// This defines the shape of the `input` that your tool accepts and that the model will produce. + ///
+ public sealed partial class BetaToolInputSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public BetaToolInputSchema( + ) + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaTool.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaTool.g.cs index a9b2147..dddf0f8 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaTool.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaTool.g.cs @@ -31,7 +31,7 @@ public sealed partial class PromptCachingBetaTool ///
[global::System.Text.Json.Serialization.JsonPropertyName("input_schema")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.InputSchema InputSchema { get; set; } + public required object InputSchema { get; set; } /// /// @@ -65,7 +65,7 @@ public sealed partial class PromptCachingBetaTool [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public PromptCachingBetaTool( string name, - global::Anthropic.InputSchema inputSchema, + object inputSchema, string? description, global::Anthropic.CacheControlEphemeral? cacheControl) { diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.Json.g.cs new file mode 100644 index 0000000..50f9496 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class PromptCachingBetaToolInputSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Anthropic.PromptCachingBetaToolInputSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.PromptCachingBetaToolInputSchema), + jsonSerializerContext) as global::Anthropic.PromptCachingBetaToolInputSchema; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Anthropic.PromptCachingBetaToolInputSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Anthropic.PromptCachingBetaToolInputSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaToolInputSchema; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.g.cs new file mode 100644 index 0000000..1d56c29 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.g.cs @@ -0,0 +1,28 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// [JSON schema](https://json-schema.org/) for this tool's input.
+ /// This defines the shape of the `input` that your tool accepts and that the model will produce. + ///
+ public sealed partial class PromptCachingBetaToolInputSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PromptCachingBetaToolInputSchema( + ) + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Tool.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Tool.g.cs index 453ae79..f6e770b 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Tool.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Tool.g.cs @@ -31,7 +31,7 @@ public sealed partial class Tool ///
[global::System.Text.Json.Serialization.JsonPropertyName("input_schema")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.InputSchema InputSchema { get; set; } + public required object InputSchema { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -58,7 +58,7 @@ public sealed partial class Tool [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public Tool( string name, - global::Anthropic.InputSchema inputSchema, + object inputSchema, string? description) { this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolInputSchema.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolInputSchema.Json.g.cs new file mode 100644 index 0000000..0edca2a --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolInputSchema.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class ToolInputSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Anthropic.ToolInputSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.ToolInputSchema), + jsonSerializerContext) as global::Anthropic.ToolInputSchema; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Anthropic.ToolInputSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Anthropic.ToolInputSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ToolInputSchema; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolInputSchema.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolInputSchema.g.cs new file mode 100644 index 0000000..b82bcba --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolInputSchema.g.cs @@ -0,0 +1,28 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// [JSON schema](https://json-schema.org/) for this tool's input.
+ /// This defines the shape of the `input` that your tool accepts and that the model will produce. + ///
+ public sealed partial class ToolInputSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ToolInputSchema( + ) + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs b/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs index 7b2ff1e..04caeae 100644 --- a/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs +++ b/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs @@ -77,8 +77,6 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaToolChoiceDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaToolTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaToolTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaInputSchemaTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaInputSchemaTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaToolCacheControlDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaToolCacheControlDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaTextEditor20241022CacheControlDiscriminatorTypeJsonConverter), @@ -139,6 +137,8 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaErroredResultTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaExpiredResultTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaExpiredResultTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaInputSchemaTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaInputSchemaTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageBatchTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageBatchTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageBatchProcessingStatusJsonConverter), @@ -211,8 +211,6 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.ToolChoiceToolTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ToolChoiceDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ToolChoiceDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.InputSchemaTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.InputSchemaTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ErrorResponseTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ErrorResponseTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.InvalidRequestErrorTypeJsonConverter), @@ -227,6 +225,8 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.OverloadedErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ErrorResponseErrorDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ErrorResponseErrorDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.InputSchemaTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.InputSchemaTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageTypeJsonConverter), typeof(global::Anthropic.JsonConverters.MessageTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageRoleJsonConverter), diff --git a/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs b/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs index 7716f80..6027685 100644 --- a/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs +++ b/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs @@ -298,327 +298,327 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Anthropic.BetaInputSchema? Type70 { get; set; } + public global::Anthropic.BetaToolCacheControlDiscriminator? Type70 { get; set; } /// /// /// - public global::Anthropic.BetaInputSchemaType? Type71 { get; set; } + public global::Anthropic.BetaToolCacheControlDiscriminatorType? Type71 { get; set; } /// /// /// - public global::Anthropic.BetaToolCacheControlDiscriminator? Type72 { get; set; } + public global::Anthropic.BetaTextEditor20241022? Type72 { get; set; } /// /// /// - public global::Anthropic.BetaToolCacheControlDiscriminatorType? Type73 { get; set; } + public global::Anthropic.BetaTextEditor20241022CacheControlDiscriminator? Type73 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022? Type74 { get; set; } + public global::Anthropic.BetaTextEditor20241022CacheControlDiscriminatorType? Type74 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022CacheControlDiscriminator? Type75 { get; set; } + public global::Anthropic.BetaTextEditor20241022Type? Type75 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022CacheControlDiscriminatorType? Type76 { get; set; } + public global::Anthropic.BetaTextEditor20241022Name? Type76 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022Type? Type77 { get; set; } + public global::Anthropic.BetaCountMessageTokensParamsToolDiscriminator? Type77 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022Name? Type78 { get; set; } + public global::Anthropic.BetaCountMessageTokensParamsToolDiscriminatorType? Type78 { get; set; } /// /// /// - public global::Anthropic.BetaCountMessageTokensParamsToolDiscriminator? Type79 { get; set; } + public global::System.Collections.Generic.IList? Type79 { get; set; } /// /// /// - public global::Anthropic.BetaCountMessageTokensParamsToolDiscriminatorType? Type80 { get; set; } + public global::Anthropic.BetaInputMessage? Type80 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type81 { get; set; } + public global::Anthropic.BetaInputMessageRole? Type81 { get; set; } /// /// /// - public global::Anthropic.BetaInputMessage? Type82 { get; set; } + public global::Anthropic.AnyOf>? Type82 { get; set; } /// /// /// - public global::Anthropic.BetaInputMessageRole? Type83 { get; set; } + public global::System.Collections.Generic.IList? Type83 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type84 { get; set; } + public global::Anthropic.BetaInputContentBlock? Type84 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type85 { get; set; } + public global::Anthropic.BetaRequestTextBlock? Type85 { get; set; } /// /// /// - public global::Anthropic.BetaInputContentBlock? Type86 { get; set; } + public global::Anthropic.BetaRequestTextBlockCacheControlDiscriminator? Type86 { get; set; } /// /// /// - public global::Anthropic.BetaRequestTextBlock? Type87 { get; set; } + public global::Anthropic.BetaRequestTextBlockCacheControlDiscriminatorType? Type87 { get; set; } /// /// /// - public global::Anthropic.BetaRequestTextBlockCacheControlDiscriminator? Type88 { get; set; } + public global::Anthropic.BetaRequestTextBlockType? Type88 { get; set; } /// /// /// - public global::Anthropic.BetaRequestTextBlockCacheControlDiscriminatorType? Type89 { get; set; } + public global::Anthropic.BetaRequestImageBlock? Type89 { get; set; } /// /// /// - public global::Anthropic.BetaRequestTextBlockType? Type90 { get; set; } + public global::Anthropic.BetaRequestImageBlockCacheControlDiscriminator? Type90 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlock? Type91 { get; set; } + public global::Anthropic.BetaRequestImageBlockCacheControlDiscriminatorType? Type91 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockCacheControlDiscriminator? Type92 { get; set; } + public global::Anthropic.BetaRequestImageBlockType? Type92 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockCacheControlDiscriminatorType? Type93 { get; set; } + public global::Anthropic.BetaRequestImageBlockSourceDiscriminator? Type93 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockType? Type94 { get; set; } + public global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType? Type94 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockSourceDiscriminator? Type95 { get; set; } + public global::Anthropic.BetaRequestToolUseBlock? Type95 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType? Type96 { get; set; } + public global::Anthropic.BetaRequestToolUseBlockCacheControlDiscriminator? Type96 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolUseBlock? Type97 { get; set; } + public global::Anthropic.BetaRequestToolUseBlockCacheControlDiscriminatorType? Type97 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolUseBlockCacheControlDiscriminator? Type98 { get; set; } + public global::Anthropic.BetaRequestToolUseBlockType? Type98 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolUseBlockCacheControlDiscriminatorType? Type99 { get; set; } + public global::Anthropic.BetaRequestToolResultBlock? Type99 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolUseBlockType? Type100 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockCacheControlDiscriminator? Type100 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlock? Type101 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockCacheControlDiscriminatorType? Type101 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockCacheControlDiscriminator? Type102 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockType? Type102 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockCacheControlDiscriminatorType? Type103 { get; set; } + public global::Anthropic.AnyOf>? Type103 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockType? Type104 { get; set; } + public global::System.Collections.Generic.IList? Type104 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type105 { get; set; } + public global::Anthropic.ContentVariant2Item? Type105 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type106 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockContentVariant2ItemDiscriminator? Type106 { get; set; } /// /// /// - public global::Anthropic.ContentVariant2Item? Type107 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? Type107 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockContentVariant2ItemDiscriminator? Type108 { get; set; } + public global::Anthropic.BetaRequestPDFBlock? Type108 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? Type109 { get; set; } + public global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminator? Type109 { get; set; } /// /// /// - public global::Anthropic.BetaRequestPDFBlock? Type110 { get; set; } + public global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType? Type110 { get; set; } /// /// /// - public global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminator? Type111 { get; set; } + public global::Anthropic.BetaRequestPDFBlockType? Type111 { get; set; } /// /// /// - public global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType? Type112 { get; set; } + public global::Anthropic.BetaInputContentBlockDiscriminator? Type112 { get; set; } /// /// /// - public global::Anthropic.BetaRequestPDFBlockType? Type113 { get; set; } + public global::Anthropic.BetaInputContentBlockDiscriminatorType? Type113 { get; set; } /// /// /// - public global::Anthropic.BetaInputContentBlockDiscriminator? Type114 { get; set; } + public global::Anthropic.AnyOf>? Type114 { get; set; } /// /// /// - public global::Anthropic.BetaInputContentBlockDiscriminatorType? Type115 { get; set; } + public global::System.Collections.Generic.IList? Type115 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type116 { get; set; } + public global::Anthropic.Model? Type116 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type117 { get; set; } + public global::Anthropic.ModelEnum? Type117 { get; set; } /// /// /// - public global::Anthropic.Model? Type118 { get; set; } + public global::Anthropic.BetaCountMessageTokensResponse? Type118 { get; set; } /// /// /// - public global::Anthropic.ModelEnum? Type119 { get; set; } + public global::Anthropic.BetaCreateMessageBatchParams? Type119 { get; set; } /// /// /// - public global::Anthropic.BetaCountMessageTokensResponse? Type120 { get; set; } + public global::System.Collections.Generic.IList? Type120 { get; set; } /// /// /// - public global::Anthropic.BetaCreateMessageBatchParams? Type121 { get; set; } + public global::Anthropic.BetaMessageBatchIndividualRequestParams? Type121 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type122 { get; set; } + public global::Anthropic.BetaCreateMessageParams? Type122 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatchIndividualRequestParams? Type123 { get; set; } + public global::Anthropic.BetaMetadata? Type123 { get; set; } /// /// /// - public global::Anthropic.BetaCreateMessageParams? Type124 { get; set; } + public global::System.Collections.Generic.IList? Type124 { get; set; } /// /// /// - public global::Anthropic.BetaMetadata? Type125 { get; set; } + public double? Type125 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type126 { get; set; } + public global::System.Collections.Generic.IList? Type126 { get; set; } /// /// /// - public double? Type127 { get; set; } + public global::Anthropic.ToolsItem2? Type127 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type128 { get; set; } + public global::Anthropic.BetaCreateMessageParamsToolDiscriminator? Type128 { get; set; } /// /// /// - public global::Anthropic.ToolsItem2? Type129 { get; set; } + public global::Anthropic.BetaCreateMessageParamsToolDiscriminatorType? Type129 { get; set; } /// /// /// - public global::Anthropic.BetaCreateMessageParamsToolDiscriminator? Type130 { get; set; } + public global::Anthropic.BetaErrorResponse? Type130 { get; set; } /// /// /// - public global::Anthropic.BetaCreateMessageParamsToolDiscriminatorType? Type131 { get; set; } + public global::Anthropic.BetaErrorResponseType? Type131 { get; set; } /// /// /// - public global::Anthropic.BetaErrorResponse? Type132 { get; set; } + public global::Anthropic.Error? Type132 { get; set; } /// /// /// - public global::Anthropic.BetaErrorResponseType? Type133 { get; set; } + public global::Anthropic.BetaInvalidRequestError? Type133 { get; set; } /// /// /// - public global::Anthropic.Error? Type134 { get; set; } + public global::Anthropic.BetaInvalidRequestErrorType? Type134 { get; set; } /// /// /// - public global::Anthropic.BetaInvalidRequestError? Type135 { get; set; } + public global::Anthropic.BetaPermissionError? Type135 { get; set; } /// /// /// - public global::Anthropic.BetaInvalidRequestErrorType? Type136 { get; set; } + public global::Anthropic.BetaPermissionErrorType? Type136 { get; set; } /// /// /// - public global::Anthropic.BetaPermissionError? Type137 { get; set; } + public global::Anthropic.BetaNotFoundError? Type137 { get; set; } /// /// /// - public global::Anthropic.BetaPermissionErrorType? Type138 { get; set; } + public global::Anthropic.BetaNotFoundErrorType? Type138 { get; set; } /// /// /// - public global::Anthropic.BetaNotFoundError? Type139 { get; set; } + public global::Anthropic.BetaRateLimitError? Type139 { get; set; } /// /// /// - public global::Anthropic.BetaNotFoundErrorType? Type140 { get; set; } + public global::Anthropic.BetaRateLimitErrorType? Type140 { get; set; } /// /// /// - public global::Anthropic.BetaRateLimitError? Type141 { get; set; } + public global::Anthropic.BetaOverloadedError? Type141 { get; set; } /// /// /// - public global::Anthropic.BetaRateLimitErrorType? Type142 { get; set; } + public global::Anthropic.BetaOverloadedErrorType? Type142 { get; set; } /// /// /// - public global::Anthropic.BetaOverloadedError? Type143 { get; set; } + public global::Anthropic.BetaErrorResponseErrorDiscriminator? Type143 { get; set; } /// /// /// - public global::Anthropic.BetaOverloadedErrorType? Type144 { get; set; } + public global::Anthropic.BetaErrorResponseErrorDiscriminatorType? Type144 { get; set; } /// /// /// - public global::Anthropic.BetaErrorResponseErrorDiscriminator? Type145 { get; set; } + public global::Anthropic.BetaErroredResult? Type145 { get; set; } /// /// /// - public global::Anthropic.BetaErrorResponseErrorDiscriminatorType? Type146 { get; set; } + public global::Anthropic.BetaErroredResultType? Type146 { get; set; } /// /// /// - public global::Anthropic.BetaErroredResult? Type147 { get; set; } + public global::Anthropic.BetaExpiredResult? Type147 { get; set; } /// /// /// - public global::Anthropic.BetaErroredResultType? Type148 { get; set; } + public global::Anthropic.BetaExpiredResultType? Type148 { get; set; } /// /// /// - public global::Anthropic.BetaExpiredResult? Type149 { get; set; } + public global::Anthropic.BetaInputSchema? Type149 { get; set; } /// /// /// - public global::Anthropic.BetaExpiredResultType? Type150 { get; set; } + public global::Anthropic.BetaInputSchemaType? Type150 { get; set; } /// /// /// @@ -1010,71 +1010,71 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Anthropic.InputSchema? Type248 { get; set; } + public global::Anthropic.ErrorResponse? Type248 { get; set; } /// /// /// - public global::Anthropic.InputSchemaType? Type249 { get; set; } + public global::Anthropic.ErrorResponseType? Type249 { get; set; } /// /// /// - public global::Anthropic.ErrorResponse? Type250 { get; set; } + public global::Anthropic.Error2? Type250 { get; set; } /// /// /// - public global::Anthropic.ErrorResponseType? Type251 { get; set; } + public global::Anthropic.InvalidRequestError? Type251 { get; set; } /// /// /// - public global::Anthropic.Error2? Type252 { get; set; } + public global::Anthropic.InvalidRequestErrorType? Type252 { get; set; } /// /// /// - public global::Anthropic.InvalidRequestError? Type253 { get; set; } + public global::Anthropic.PermissionError? Type253 { get; set; } /// /// /// - public global::Anthropic.InvalidRequestErrorType? Type254 { get; set; } + public global::Anthropic.PermissionErrorType? Type254 { get; set; } /// /// /// - public global::Anthropic.PermissionError? Type255 { get; set; } + public global::Anthropic.NotFoundError? Type255 { get; set; } /// /// /// - public global::Anthropic.PermissionErrorType? Type256 { get; set; } + public global::Anthropic.NotFoundErrorType? Type256 { get; set; } /// /// /// - public global::Anthropic.NotFoundError? Type257 { get; set; } + public global::Anthropic.RateLimitError? Type257 { get; set; } /// /// /// - public global::Anthropic.NotFoundErrorType? Type258 { get; set; } + public global::Anthropic.RateLimitErrorType? Type258 { get; set; } /// /// /// - public global::Anthropic.RateLimitError? Type259 { get; set; } + public global::Anthropic.OverloadedError? Type259 { get; set; } /// /// /// - public global::Anthropic.RateLimitErrorType? Type260 { get; set; } + public global::Anthropic.OverloadedErrorType? Type260 { get; set; } /// /// /// - public global::Anthropic.OverloadedError? Type261 { get; set; } + public global::Anthropic.ErrorResponseErrorDiscriminator? Type261 { get; set; } /// /// /// - public global::Anthropic.OverloadedErrorType? Type262 { get; set; } + public global::Anthropic.ErrorResponseErrorDiscriminatorType? Type262 { get; set; } /// /// /// - public global::Anthropic.ErrorResponseErrorDiscriminator? Type263 { get; set; } + public global::Anthropic.InputSchema? Type263 { get; set; } /// /// /// - public global::Anthropic.ErrorResponseErrorDiscriminatorType? Type264 { get; set; } + public global::Anthropic.InputSchemaType? Type264 { get; set; } /// /// /// diff --git a/src/libs/Anthropic/openapi.yaml b/src/libs/Anthropic/openapi.yaml index 133201c..6483675 100644 --- a/src/libs/Anthropic/openapi.yaml +++ b/src/libs/Anthropic/openapi.yaml @@ -2246,8 +2246,7 @@ components: type: string description: "Name of the tool.\n\nThis is how the tool will be called by the model and in tool_use blocks." input_schema: - allOf: - - $ref: '#/components/schemas/BetaInputSchema' + type: object description: "[JSON schema](https://json-schema.org/) for this tool's input.\n\nThis defines the shape of the `input` that your tool accepts and that the model will produce." example: properties: @@ -3444,8 +3443,7 @@ components: type: string description: "Name of the tool.\n\nThis is how the tool will be called by the model and in tool_use blocks." input_schema: - allOf: - - $ref: '#/components/schemas/InputSchema' + type: object description: "[JSON schema](https://json-schema.org/) for this tool's input.\n\nThis defines the shape of the `input` that your tool accepts and that the model will produce." example: properties: @@ -3705,8 +3703,7 @@ components: type: string description: "Name of the tool.\n\nThis is how the tool will be called by the model and in tool_use blocks." input_schema: - allOf: - - $ref: '#/components/schemas/InputSchema' + type: object description: "[JSON schema](https://json-schema.org/) for this tool's input.\n\nThis defines the shape of the `input` that your tool accepts and that the model will produce." example: properties: