diff --git a/src/helpers/FixOpenApiSpec/Program.cs b/src/helpers/FixOpenApiSpec/Program.cs index a9b1fcd..739219b 100644 --- a/src/helpers/FixOpenApiSpec/Program.cs +++ b/src/helpers/FixOpenApiSpec/Program.cs @@ -48,8 +48,6 @@ 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 017bb57..d5476c5 100644 --- a/src/libs/Anthropic/Extensions/AnthropicClient.ChatClient.cs +++ b/src/libs/Anthropic/Extensions/AnthropicClient.ChatClient.cs @@ -166,17 +166,17 @@ private static CreateMessageParams CreateRequest(IList chatMessages continue; } - List blocks = []; + List blocks = []; foreach (var content in chatMessage.Contents) { switch (content) { case TextContent tc: - blocks.Add(new ContentVariant2Item2(new RequestTextBlock { Text = tc.Text })); + blocks.Add(new InputContentBlock(new RequestTextBlock { Text = tc.Text })); break; case ImageContent ic when ic.ContainsData: - blocks.Add(new ContentVariant2Item2(new RequestImageBlock + blocks.Add(new InputContentBlock(new RequestImageBlock { Source = new Base64ImageSource { @@ -194,7 +194,7 @@ private static CreateMessageParams CreateRequest(IList chatMessages break; case FunctionCallContent fcc: - blocks.Add(new ContentVariant2Item2(new RequestToolUseBlock + blocks.Add(new InputContentBlock(new RequestToolUseBlock { Id = fcc.CallId, Name = fcc.Name, @@ -203,7 +203,7 @@ private static CreateMessageParams CreateRequest(IList chatMessages break; case FunctionResultContent frc: - blocks.Add(new ContentVariant2Item2(new RequestToolResultBlock + blocks.Add(new InputContentBlock(new RequestToolResultBlock { ToolUseId = frc.CallId, Content = frc.Result?.ToString() ?? string.Empty, @@ -212,7 +212,7 @@ private static CreateMessageParams CreateRequest(IList chatMessages break; } - foreach (ContentVariant2Item2 block in blocks) + foreach (InputContentBlock block in blocks) { messages.Add(new InputMessage { diff --git a/src/libs/Anthropic/Extensions/StringExtensions.cs b/src/libs/Anthropic/Extensions/StringExtensions.cs index 01f74ee..24966ca 100755 --- a/src/libs/Anthropic/Extensions/StringExtensions.cs +++ b/src/libs/Anthropic/Extensions/StringExtensions.cs @@ -46,7 +46,7 @@ public static InputMessage AsToolCall(this string content, ResponseToolUseBlock return new InputMessage { Role = InputMessageRole.User, - Content = new List + Content = new List { new RequestToolResultBlock { @@ -72,14 +72,14 @@ public static InputMessage AsInputMessage(this Message message) { if (x.IsText) { - return new ContentVariant2Item2(new RequestTextBlock + return new InputContentBlock(new RequestTextBlock { Text = x.Text!.Text, }); } if (x.IsToolUse) { - return new ContentVariant2Item2(new RequestToolUseBlock + return new InputContentBlock(new RequestToolUseBlock { Id = x.ToolUse!.Id, Input = x.ToolUse.Input, @@ -87,7 +87,7 @@ public static InputMessage AsInputMessage(this Message message) }); } - return new ContentVariant2Item2(); + return new InputContentBlock(); }).ToList(), Role = InputMessageRole.Assistant, }; diff --git a/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.BetaModelsGet.g.cs b/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.BetaModelsGet.g.cs new file mode 100644 index 0000000..fb6c8a8 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.BetaModelsGet.g.cs @@ -0,0 +1,212 @@ + +#nullable enable + +namespace Anthropic +{ + public partial class AnthropicClient + { + partial void PrepareBetaModelsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelId, + ref string? anthropicVersion, + ref string? xApiKey); + partial void PrepareBetaModelsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelId, + string? anthropicVersion, + string? xApiKey); + partial void ProcessBetaModelsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessBetaModelsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a Model
+ /// Get a specific model.
+ /// The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID. + ///
+ /// + /// Model identifier or alias. + /// + /// + /// The version of the Anthropic API you want to use.
+ /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). + /// + /// + /// Your unique API key for authentication.
+ /// This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace. + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task BetaModelsGetAsync( + string modelId, + string? anthropicVersion = default, + string? xApiKey = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareBetaModelsGetArguments( + httpClient: HttpClient, + modelId: ref modelId, + anthropicVersion: ref anthropicVersion, + xApiKey: ref xApiKey); + + var __pathBuilder = new PathBuilder( + path: $"/v1/models/{modelId}?beta=true", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in Authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (anthropicVersion != default) + { + __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareBetaModelsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelId: modelId, + anthropicVersion: anthropicVersion, + xApiKey: xApiKey); + + using var __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessBetaModelsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. + if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) + { + string? __content_4XX = null; + global::Anthropic.BetaErrorResponse? __value_4XX = null; + if (ReadResponseAsString) + { + __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_4XX = global::Anthropic.BetaErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + } + else + { + var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_4XX = await global::Anthropic.BetaErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + } + + throw new global::Anthropic.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_4XX, + ResponseObject = __value_4XX, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessBetaModelsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Anthropic.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::Anthropic.BetaModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Anthropic.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + return + await global::Anthropic.BetaModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesList2.g.cs b/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.BetaModelsList.g.cs similarity index 84% rename from src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesList2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.AnthropicClient.BetaModelsList.g.cs index b67270a..0a8e8da 100644 --- a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesList2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.BetaModelsList.g.cs @@ -3,37 +3,36 @@ namespace Anthropic { - public partial class MessageBatchesClient + public partial class AnthropicClient { - partial void PrepareBetaMessageBatchesList2Arguments( + partial void PrepareBetaModelsListArguments( global::System.Net.Http.HttpClient httpClient, ref string? beforeId, ref string? afterId, ref int? limit, - ref string? anthropicBeta, ref string? anthropicVersion, ref string? xApiKey); - partial void PrepareBetaMessageBatchesList2Request( + partial void PrepareBetaModelsListRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string? beforeId, string? afterId, int? limit, - string? anthropicBeta, string? anthropicVersion, string? xApiKey); - partial void ProcessBetaMessageBatchesList2Response( + partial void ProcessBetaModelsListResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessBetaMessageBatchesList2ResponseContent( + partial void ProcessBetaModelsListResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); /// - /// List Message Batches
- /// List all Message Batches within a Workspace. Most recently created batches are returned first. + /// List Models
+ /// List available models.
+ /// The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first. ///
/// /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object. @@ -43,13 +42,9 @@ partial void ProcessBetaMessageBatchesList2ResponseContent( /// /// /// Number of items to return per page.
- /// Defaults to `20`. Ranges from `1` to `100`.
+ /// Defaults to `20`. Ranges from `1` to `1000`.
/// Default Value: 20 /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -60,28 +55,26 @@ partial void ProcessBetaMessageBatchesList2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task BetaMessageBatchesList2Async( + public async global::System.Threading.Tasks.Task BetaModelsListAsync( string? beforeId = default, string? afterId = default, int? limit = default, - string? anthropicBeta = default, string? anthropicVersion = default, string? xApiKey = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); - PrepareBetaMessageBatchesList2Arguments( + PrepareBetaModelsListArguments( httpClient: HttpClient, beforeId: ref beforeId, afterId: ref afterId, limit: ref limit, - anthropicBeta: ref anthropicBeta, anthropicVersion: ref anthropicVersion, xApiKey: ref xApiKey); var __pathBuilder = new PathBuilder( - path: "/v1/messages/batches", + path: "/v1/models?beta=true", baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("before_id", beforeId) @@ -113,10 +106,6 @@ partial void ProcessBetaMessageBatchesList2ResponseContent( } } - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } if (anthropicVersion != default) { __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); @@ -130,13 +119,12 @@ partial void ProcessBetaMessageBatchesList2ResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareBetaMessageBatchesList2Request( + PrepareBetaModelsListRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, beforeId: beforeId, afterId: afterId, limit: limit, - anthropicBeta: anthropicBeta, anthropicVersion: anthropicVersion, xApiKey: xApiKey); @@ -148,7 +136,7 @@ partial void ProcessBetaMessageBatchesList2ResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessBetaMessageBatchesList2Response( + ProcessBetaModelsListResponse( httpClient: HttpClient, httpResponseMessage: __response); // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. @@ -188,7 +176,7 @@ partial void ProcessBetaMessageBatchesList2ResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessBetaMessageBatchesList2ResponseContent( + ProcessBetaModelsListResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -213,7 +201,7 @@ partial void ProcessBetaMessageBatchesList2ResponseContent( } return - global::Anthropic.BetaListResponseMessageBatch.FromJson(__content, JsonSerializerContext) ?? + global::Anthropic.BetaListResponseModelResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else @@ -239,7 +227,7 @@ partial void ProcessBetaMessageBatchesList2ResponseContent( using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - await global::Anthropic.BetaListResponseMessageBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::Anthropic.BetaListResponseModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.ModelsGet.g.cs b/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.ModelsGet.g.cs new file mode 100644 index 0000000..dfa4ab8 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.ModelsGet.g.cs @@ -0,0 +1,212 @@ + +#nullable enable + +namespace Anthropic +{ + public partial class AnthropicClient + { + partial void PrepareModelsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelId, + ref string? anthropicVersion, + ref string? xApiKey); + partial void PrepareModelsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelId, + string? anthropicVersion, + string? xApiKey); + partial void ProcessModelsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a Model
+ /// Get a specific model.
+ /// The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID. + ///
+ /// + /// Model identifier or alias. + /// + /// + /// The version of the Anthropic API you want to use.
+ /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). + /// + /// + /// Your unique API key for authentication.
+ /// This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace. + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ModelsGetAsync( + string modelId, + string? anthropicVersion = default, + string? xApiKey = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsGetArguments( + httpClient: HttpClient, + modelId: ref modelId, + anthropicVersion: ref anthropicVersion, + xApiKey: ref xApiKey); + + var __pathBuilder = new PathBuilder( + path: $"/v1/models/{modelId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in Authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (anthropicVersion != default) + { + __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelId: modelId, + anthropicVersion: anthropicVersion, + xApiKey: xApiKey); + + using var __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessModelsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. + if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) + { + string? __content_4XX = null; + global::Anthropic.ErrorResponse? __value_4XX = null; + if (ReadResponseAsString) + { + __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + } + else + { + var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + } + + throw new global::Anthropic.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_4XX, + ResponseObject = __value_4XX, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Anthropic.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::Anthropic.ModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Anthropic.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + return + await global::Anthropic.ModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.ModelsList.g.cs b/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.ModelsList.g.cs new file mode 100644 index 0000000..6098555 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.AnthropicClient.ModelsList.g.cs @@ -0,0 +1,235 @@ + +#nullable enable + +namespace Anthropic +{ + public partial class AnthropicClient + { + partial void PrepareModelsListArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? beforeId, + ref string? afterId, + ref int? limit, + ref string? anthropicVersion, + ref string? xApiKey); + partial void PrepareModelsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? beforeId, + string? afterId, + int? limit, + string? anthropicVersion, + string? xApiKey); + partial void ProcessModelsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Models
+ /// List available models.
+ /// The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first. + ///
+ /// + /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object. + /// + /// + /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object. + /// + /// + /// Number of items to return per page.
+ /// Defaults to `20`. Ranges from `1` to `1000`.
+ /// Default Value: 20 + /// + /// + /// The version of the Anthropic API you want to use.
+ /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). + /// + /// + /// Your unique API key for authentication.
+ /// This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace. + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ModelsListAsync( + string? beforeId = default, + string? afterId = default, + int? limit = default, + string? anthropicVersion = default, + string? xApiKey = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsListArguments( + httpClient: HttpClient, + beforeId: ref beforeId, + afterId: ref afterId, + limit: ref limit, + anthropicVersion: ref anthropicVersion, + xApiKey: ref xApiKey); + + var __pathBuilder = new PathBuilder( + path: "/v1/models", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("before_id", beforeId) + .AddOptionalParameter("after_id", afterId) + .AddOptionalParameter("limit", limit?.ToString()) + ; + var __path = __pathBuilder.ToString(); + using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in Authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (anthropicVersion != default) + { + __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + beforeId: beforeId, + afterId: afterId, + limit: limit, + anthropicVersion: anthropicVersion, + xApiKey: xApiKey); + + using var __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessModelsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. + if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) + { + string? __content_4XX = null; + global::Anthropic.ErrorResponse? __value_4XX = null; + if (ReadResponseAsString) + { + __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + } + else + { + var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + } + + throw new global::Anthropic.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_4XX, + ResponseObject = __value_4XX, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Anthropic.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::Anthropic.ListResponseModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Anthropic.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + return + await global::Anthropic.ListResponseModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.BetaModelsGet.g.cs b/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.BetaModelsGet.g.cs new file mode 100644 index 0000000..dcbbbf8 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.BetaModelsGet.g.cs @@ -0,0 +1,31 @@ +#nullable enable + +namespace Anthropic +{ + public partial interface IAnthropicClient + { + /// + /// Get a Model
+ /// Get a specific model.
+ /// The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID. + ///
+ /// + /// Model identifier or alias. + /// + /// + /// The version of the Anthropic API you want to use.
+ /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). + /// + /// + /// Your unique API key for authentication.
+ /// This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace. + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BetaModelsGetAsync( + string modelId, + string? anthropicVersion = default, + string? xApiKey = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.BetaModelsList.g.cs b/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.BetaModelsList.g.cs new file mode 100644 index 0000000..ff1d8d5 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.BetaModelsList.g.cs @@ -0,0 +1,41 @@ +#nullable enable + +namespace Anthropic +{ + public partial interface IAnthropicClient + { + /// + /// List Models
+ /// List available models.
+ /// The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first. + ///
+ /// + /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object. + /// + /// + /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object. + /// + /// + /// Number of items to return per page.
+ /// Defaults to `20`. Ranges from `1` to `1000`.
+ /// Default Value: 20 + /// + /// + /// The version of the Anthropic API you want to use.
+ /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). + /// + /// + /// Your unique API key for authentication.
+ /// This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace. + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BetaModelsListAsync( + string? beforeId = default, + string? afterId = default, + int? limit = default, + string? anthropicVersion = default, + string? xApiKey = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.ModelsGet.g.cs b/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.ModelsGet.g.cs new file mode 100644 index 0000000..dc3251b --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.ModelsGet.g.cs @@ -0,0 +1,31 @@ +#nullable enable + +namespace Anthropic +{ + public partial interface IAnthropicClient + { + /// + /// Get a Model
+ /// Get a specific model.
+ /// The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID. + ///
+ /// + /// Model identifier or alias. + /// + /// + /// The version of the Anthropic API you want to use.
+ /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). + /// + /// + /// Your unique API key for authentication.
+ /// This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace. + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ModelsGetAsync( + string modelId, + string? anthropicVersion = default, + string? xApiKey = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.ModelsList.g.cs b/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.ModelsList.g.cs new file mode 100644 index 0000000..4c43d0a --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.IAnthropicClient.ModelsList.g.cs @@ -0,0 +1,41 @@ +#nullable enable + +namespace Anthropic +{ + public partial interface IAnthropicClient + { + /// + /// List Models
+ /// List available models.
+ /// The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first. + ///
+ /// + /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object. + /// + /// + /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object. + /// + /// + /// Number of items to return per page.
+ /// Defaults to `20`. Ranges from `1` to `1000`.
+ /// Default Value: 20 + /// + /// + /// The version of the Anthropic API you want to use.
+ /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). + /// + /// + /// Your unique API key for authentication.
+ /// This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace. + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ModelsListAsync( + string? beforeId = default, + string? afterId = default, + int? limit = default, + string? anthropicVersion = default, + string? xApiKey = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesList.g.cs b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesList.g.cs index aca874a..f8ce917 100644 --- a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesList.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesList.g.cs @@ -16,7 +16,7 @@ public partial interface IMessageBatchesClient /// /// /// Number of items to return per page.
- /// Defaults to `20`. Ranges from `1` to `100`.
+ /// Defaults to `20`. Ranges from `1` to `1000`.
/// Default Value: 20 /// /// diff --git a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesCancel2.g.cs b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesCancel.g.cs similarity index 76% rename from src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesCancel2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesCancel.g.cs index 9b5fabe..cd4791e 100644 --- a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesCancel2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesCancel.g.cs @@ -12,19 +12,14 @@ public partial interface IMessageBatchesClient /// /// ID of the Message Batch. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task BetaMessageBatchesCancel2Async( + global::System.Threading.Tasks.Task MessageBatchesCancelAsync( string messageBatchId, - string? anthropicBeta = default, string? anthropicVersion = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesList2.g.cs b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesList.g.cs similarity index 78% rename from src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesList2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesList.g.cs index c1208f3..0762512 100644 --- a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesList2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesList.g.cs @@ -16,13 +16,9 @@ public partial interface IMessageBatchesClient /// /// /// Number of items to return per page.
- /// Defaults to `20`. Ranges from `1` to `100`.
+ /// Defaults to `20`. Ranges from `1` to `1000`.
/// Default Value: 20 /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -33,11 +29,10 @@ public partial interface IMessageBatchesClient /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task BetaMessageBatchesList2Async( + global::System.Threading.Tasks.Task MessageBatchesListAsync( string? beforeId = default, string? afterId = default, int? limit = default, - string? anthropicBeta = default, string? anthropicVersion = default, string? xApiKey = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesPost2.g.cs b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesPost.g.cs similarity index 68% rename from src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesPost2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesPost.g.cs index 19fda27..dc21c2d 100644 --- a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesPost2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesPost.g.cs @@ -9,10 +9,6 @@ public partial interface IMessageBatchesClient /// Send a batch of Message creation requests.
/// The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -20,9 +16,8 @@ public partial interface IMessageBatchesClient /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task BetaMessageBatchesPost2Async( - global::Anthropic.BetaCreateMessageBatchParams request, - string? anthropicBeta = default, + global::System.Threading.Tasks.Task MessageBatchesPostAsync( + global::Anthropic.CreateMessageBatchParams request, string? anthropicVersion = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -31,10 +26,6 @@ public partial interface IMessageBatchesClient /// Send a batch of Message creation requests.
/// The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -44,9 +35,8 @@ public partial interface IMessageBatchesClient /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task BetaMessageBatchesPost2Async( - global::System.Collections.Generic.IList requests, - string? anthropicBeta = default, + global::System.Threading.Tasks.Task MessageBatchesPostAsync( + global::System.Collections.Generic.IList requests, string? anthropicVersion = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesResults2.g.cs b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesResults.g.cs similarity index 79% rename from src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesResults2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesResults.g.cs index eccdb10..78a0429 100644 --- a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesResults2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesResults.g.cs @@ -12,10 +12,6 @@ public partial interface IMessageBatchesClient /// /// ID of the Message Batch. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -26,9 +22,8 @@ public partial interface IMessageBatchesClient /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task BetaMessageBatchesResults2Async( + global::System.Threading.Tasks.Task MessageBatchesResultsAsync( string messageBatchId, - string? anthropicBeta = default, string? anthropicVersion = default, string? xApiKey = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesRetrieve2.g.cs b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesRetrieve.g.cs similarity index 77% rename from src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesRetrieve2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesRetrieve.g.cs index cdca70f..661055a 100644 --- a/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.BetaMessageBatchesRetrieve2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.IMessageBatchesClient.MessageBatchesRetrieve.g.cs @@ -11,10 +11,6 @@ public partial interface IMessageBatchesClient /// /// ID of the Message Batch. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -25,9 +21,8 @@ public partial interface IMessageBatchesClient /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task BetaMessageBatchesRetrieve2Async( + global::System.Threading.Tasks.Task MessageBatchesRetrieveAsync( string messageBatchId, - string? anthropicBeta = default, string? anthropicVersion = default, string? xApiKey = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Anthropic/Generated/Anthropic.IMessagesClient.BetaMessagesCountTokensPost2.g.cs b/src/libs/Anthropic/Generated/Anthropic.IMessagesClient.MessagesCountTokensPost.g.cs similarity index 88% rename from src/libs/Anthropic/Generated/Anthropic.IMessagesClient.BetaMessagesCountTokensPost2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.IMessagesClient.MessagesCountTokensPost.g.cs index 4cfee07..767ae57 100644 --- a/src/libs/Anthropic/Generated/Anthropic.IMessagesClient.BetaMessagesCountTokensPost2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.IMessagesClient.MessagesCountTokensPost.g.cs @@ -9,10 +9,6 @@ public partial interface IMessagesClient /// Count the number of tokens in a Message.
/// The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -20,9 +16,8 @@ public partial interface IMessagesClient /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task BetaMessagesCountTokensPost2Async( - global::Anthropic.BetaCountMessageTokensParams request, - string? anthropicBeta = default, + global::System.Threading.Tasks.Task MessagesCountTokensPostAsync( + global::Anthropic.CountMessageTokensParams request, string? anthropicVersion = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -31,10 +26,6 @@ public partial interface IMessagesClient /// Count the number of tokens in a Message.
/// The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -151,14 +142,13 @@ public partial interface IMessagesClient /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task BetaMessagesCountTokensPost2Async( - global::System.Collections.Generic.IList messages, + global::System.Threading.Tasks.Task MessagesCountTokensPostAsync( + global::System.Collections.Generic.IList messages, global::Anthropic.Model model, - string? anthropicBeta = default, string? anthropicVersion = default, - global::Anthropic.BetaToolChoice? toolChoice = default, - global::System.Collections.Generic.IList? tools = default, - global::Anthropic.AnyOf>? system = default, + global::Anthropic.ToolChoice? toolChoice = default, + global::System.Collections.Generic.IList? tools = default, + global::Anthropic.AnyOf>? system = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.IMessagesClient.PromptCachingBetaMessagesPost.g.cs b/src/libs/Anthropic/Generated/Anthropic.IMessagesClient.PromptCachingBetaMessagesPost.g.cs deleted file mode 100644 index 4ad29a4..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.IMessagesClient.PromptCachingBetaMessagesPost.g.cs +++ /dev/null @@ -1,207 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public partial interface IMessagesClient - { - /// - /// Create a Message
- /// Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
- /// The Messages API can be used for either single queries or stateless multi-turn conversations. - ///
- /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// - /// - /// The version of the Anthropic API you want to use.
- /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PromptCachingBetaMessagesPostAsync( - global::Anthropic.PromptCachingBetaCreateMessageParams request, - string? anthropicBeta = default, - string? anthropicVersion = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Create a Message
- /// Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
- /// The Messages API can be used for either single queries or stateless multi-turn conversations. - ///
- /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// - /// - /// The version of the Anthropic API you want to use.
- /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). - /// - /// - /// The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. - /// - /// - /// Input messages.
- /// Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
- /// Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
- /// If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
- /// Example with a single `user` message:
- /// ```json
- /// [{"role": "user", "content": "Hello, Claude"}]
- /// ```
- /// Example with multiple conversational turns:
- /// ```json
- /// [
- /// {"role": "user", "content": "Hello there."},
- /// {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
- /// {"role": "user", "content": "Can you explain LLMs in plain English?"},
- /// ]
- /// ```
- /// Example with a partially-filled response from Claude:
- /// ```json
- /// [
- /// {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
- /// {"role": "assistant", "content": "The best answer is ("},
- /// ]
- /// ```
- /// Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
- /// ```json
- /// {"role": "user", "content": "Hello, Claude"}
- /// ```
- /// ```json
- /// {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
- /// ```
- /// Starting with Claude 3 models, you can also send image content blocks:
- /// ```json
- /// {"role": "user", "content": [
- /// {
- /// "type": "image",
- /// "source": {
- /// "type": "base64",
- /// "media_type": "image/jpeg",
- /// "data": "/9j/4AAQSkZJRg...",
- /// }
- /// },
- /// {"type": "text", "text": "What is in this image?"}
- /// ]}
- /// ```
- /// We currently support the `base64` source type for images, and the `image/jpeg`, `image/png`, `image/gif`, and `image/webp` media types.
- /// See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for more input examples.
- /// Note that if you want to include a [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API. - /// - /// - /// The maximum number of tokens to generate before stopping.
- /// Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
- /// Different models have different maximum values for this parameter. See [models](https://docs.anthropic.com/en/docs/models-overview) for details.
- /// Example: 1024 - /// - /// - /// An object describing metadata about the request. - /// - /// - /// Custom text sequences that will cause the model to stop generating.
- /// Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
- /// If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence. - /// - /// - /// Whether to incrementally stream the response using server-sent events.
- /// See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for details. - /// - /// - /// System prompt.
- /// A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
- /// Example: [] - /// - /// - /// Amount of randomness injected into the response.
- /// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
- /// Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
- /// Example: 1 - /// - /// - /// How the model should use the provided tools. The model can use a specific tool, any available tool, or decide by itself. - /// - /// - /// Definitions of tools that the model may use.
- /// If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
- /// Each tool definition includes:
- /// * `name`: Name of the tool.
- /// * `description`: Optional, but strongly-recommended description of the tool.
- /// * `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
- /// For example, if you defined `tools` as:
- /// ```json
- /// [
- /// {
- /// "name": "get_stock_price",
- /// "description": "Get the current stock price for a given ticker symbol.",
- /// "input_schema": {
- /// "type": "object",
- /// "properties": {
- /// "ticker": {
- /// "type": "string",
- /// "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
- /// }
- /// },
- /// "required": ["ticker"]
- /// }
- /// }
- /// ]
- /// ```
- /// And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
- /// ```json
- /// [
- /// {
- /// "type": "tool_use",
- /// "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
- /// "name": "get_stock_price",
- /// "input": { "ticker": "^GSPC" }
- /// }
- /// ]
- /// ```
- /// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
- /// ```json
- /// [
- /// {
- /// "type": "tool_result",
- /// "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
- /// "content": "259.75 USD"
- /// }
- /// ]
- /// ```
- /// Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
- /// See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details. - /// - /// - /// Only sample from the top K options for each subsequent token.
- /// Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
- /// Recommended for advanced use cases only. You usually only need to use `temperature`.
- /// Example: 5 - /// - /// - /// Use nucleus sampling.
- /// In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
- /// Recommended for advanced use cases only. You usually only need to use `temperature`.
- /// Example: 0.7 - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PromptCachingBetaMessagesPostAsync( - global::Anthropic.Model model, - global::System.Collections.Generic.IList messages, - int maxTokens, - string? anthropicBeta = default, - string? anthropicVersion = default, - global::Anthropic.Metadata? metadata = default, - global::System.Collections.Generic.IList? stopSequences = default, - bool? stream = default, - global::Anthropic.AnyOf>? system = default, - double? temperature = default, - global::Anthropic.ToolChoice? toolChoice = default, - global::System.Collections.Generic.IList? tools = default, - int? topK = default, - double? topP = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesList.g.cs b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesList.g.cs index 5a4b0cc..7f8bb44 100644 --- a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesList.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesList.g.cs @@ -43,7 +43,7 @@ partial void ProcessBetaMessageBatchesListResponseContent( /// /// /// Number of items to return per page.
- /// Defaults to `20`. Ranges from `1` to `100`.
+ /// Defaults to `20`. Ranges from `1` to `1000`.
/// Default Value: 20 /// /// diff --git a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesCancel2.g.cs b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesCancel.g.cs similarity index 82% rename from src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesCancel2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesCancel.g.cs index 66654b5..b46dd53 100644 --- a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesCancel2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesCancel.g.cs @@ -5,22 +5,20 @@ namespace Anthropic { public partial class MessageBatchesClient { - partial void PrepareBetaMessageBatchesCancel2Arguments( + partial void PrepareMessageBatchesCancelArguments( global::System.Net.Http.HttpClient httpClient, ref string messageBatchId, - ref string? anthropicBeta, ref string? anthropicVersion); - partial void PrepareBetaMessageBatchesCancel2Request( + partial void PrepareMessageBatchesCancelRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string messageBatchId, - string? anthropicBeta, string? anthropicVersion); - partial void ProcessBetaMessageBatchesCancel2Response( + partial void ProcessMessageBatchesCancelResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessBetaMessageBatchesCancel2ResponseContent( + partial void ProcessMessageBatchesCancelResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); @@ -33,28 +31,22 @@ partial void ProcessBetaMessageBatchesCancel2ResponseContent( /// /// ID of the Message Batch. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task BetaMessageBatchesCancel2Async( + public async global::System.Threading.Tasks.Task MessageBatchesCancelAsync( string messageBatchId, - string? anthropicBeta = default, string? anthropicVersion = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); - PrepareBetaMessageBatchesCancel2Arguments( + PrepareMessageBatchesCancelArguments( httpClient: HttpClient, messageBatchId: ref messageBatchId, - anthropicBeta: ref anthropicBeta, anthropicVersion: ref anthropicVersion); var __pathBuilder = new PathBuilder( @@ -85,10 +77,6 @@ partial void ProcessBetaMessageBatchesCancel2ResponseContent( } } - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } if (anthropicVersion != default) { __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); @@ -98,11 +86,10 @@ partial void ProcessBetaMessageBatchesCancel2ResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareBetaMessageBatchesCancel2Request( + PrepareMessageBatchesCancelRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, messageBatchId: messageBatchId, - anthropicBeta: anthropicBeta, anthropicVersion: anthropicVersion); using var __response = await HttpClient.SendAsync( @@ -113,26 +100,26 @@ partial void ProcessBetaMessageBatchesCancel2ResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessBetaMessageBatchesCancel2Response( + ProcessMessageBatchesCancelResponse( httpClient: HttpClient, httpResponseMessage: __response); // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) { string? __content_4XX = null; - global::Anthropic.BetaErrorResponse? __value_4XX = null; + global::Anthropic.ErrorResponse? __value_4XX = null; if (ReadResponseAsString) { __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = global::Anthropic.BetaErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); } else { var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = await global::Anthropic.BetaErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); } - throw new global::Anthropic.ApiException( + throw new global::Anthropic.ApiException( message: __response.ReasonPhrase ?? string.Empty, statusCode: __response.StatusCode) { @@ -153,7 +140,7 @@ partial void ProcessBetaMessageBatchesCancel2ResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessBetaMessageBatchesCancel2ResponseContent( + ProcessMessageBatchesCancelResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -178,7 +165,7 @@ partial void ProcessBetaMessageBatchesCancel2ResponseContent( } return - global::Anthropic.BetaMessageBatch.FromJson(__content, JsonSerializerContext) ?? + global::Anthropic.MessageBatch.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else @@ -204,7 +191,7 @@ partial void ProcessBetaMessageBatchesCancel2ResponseContent( using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - await global::Anthropic.BetaMessageBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::Anthropic.MessageBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesList.g.cs b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesList.g.cs new file mode 100644 index 0000000..ff0561f --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesList.g.cs @@ -0,0 +1,234 @@ + +#nullable enable + +namespace Anthropic +{ + public partial class MessageBatchesClient + { + partial void PrepareMessageBatchesListArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? beforeId, + ref string? afterId, + ref int? limit, + ref string? anthropicVersion, + ref string? xApiKey); + partial void PrepareMessageBatchesListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? beforeId, + string? afterId, + int? limit, + string? anthropicVersion, + string? xApiKey); + partial void ProcessMessageBatchesListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessMessageBatchesListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Message Batches
+ /// List all Message Batches within a Workspace. Most recently created batches are returned first. + ///
+ /// + /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object. + /// + /// + /// ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object. + /// + /// + /// Number of items to return per page.
+ /// Defaults to `20`. Ranges from `1` to `1000`.
+ /// Default Value: 20 + /// + /// + /// The version of the Anthropic API you want to use.
+ /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). + /// + /// + /// Your unique API key for authentication.
+ /// This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace. + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task MessageBatchesListAsync( + string? beforeId = default, + string? afterId = default, + int? limit = default, + string? anthropicVersion = default, + string? xApiKey = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareMessageBatchesListArguments( + httpClient: HttpClient, + beforeId: ref beforeId, + afterId: ref afterId, + limit: ref limit, + anthropicVersion: ref anthropicVersion, + xApiKey: ref xApiKey); + + var __pathBuilder = new PathBuilder( + path: "/v1/messages/batches", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("before_id", beforeId) + .AddOptionalParameter("after_id", afterId) + .AddOptionalParameter("limit", limit?.ToString()) + ; + var __path = __pathBuilder.ToString(); + using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in Authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (anthropicVersion != default) + { + __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareMessageBatchesListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + beforeId: beforeId, + afterId: afterId, + limit: limit, + anthropicVersion: anthropicVersion, + xApiKey: xApiKey); + + using var __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessMessageBatchesListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. + if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) + { + string? __content_4XX = null; + global::Anthropic.ErrorResponse? __value_4XX = null; + if (ReadResponseAsString) + { + __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + } + else + { + var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + } + + throw new global::Anthropic.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_4XX, + ResponseObject = __value_4XX, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessMessageBatchesListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Anthropic.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::Anthropic.ListResponseMessageBatch.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Anthropic.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + return + await global::Anthropic.ListResponseMessageBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesPost2.g.cs b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesPost.g.cs similarity index 78% rename from src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesPost2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesPost.g.cs index c9f5927..64c8db0 100644 --- a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesPost2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesPost.g.cs @@ -5,22 +5,20 @@ namespace Anthropic { public partial class MessageBatchesClient { - partial void PrepareBetaMessageBatchesPost2Arguments( + partial void PrepareMessageBatchesPostArguments( global::System.Net.Http.HttpClient httpClient, - ref string? anthropicBeta, ref string? anthropicVersion, - global::Anthropic.BetaCreateMessageBatchParams request); - partial void PrepareBetaMessageBatchesPost2Request( + global::Anthropic.CreateMessageBatchParams request); + partial void PrepareMessageBatchesPostRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? anthropicBeta, string? anthropicVersion, - global::Anthropic.BetaCreateMessageBatchParams request); - partial void ProcessBetaMessageBatchesPost2Response( + global::Anthropic.CreateMessageBatchParams request); + partial void ProcessMessageBatchesPostResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessBetaMessageBatchesPost2ResponseContent( + partial void ProcessMessageBatchesPostResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); @@ -30,10 +28,6 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( /// Send a batch of Message creation requests.
/// The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -41,9 +35,8 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task BetaMessageBatchesPost2Async( - global::Anthropic.BetaCreateMessageBatchParams request, - string? anthropicBeta = default, + public async global::System.Threading.Tasks.Task MessageBatchesPostAsync( + global::Anthropic.CreateMessageBatchParams request, string? anthropicVersion = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -51,9 +44,8 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( PrepareArguments( client: HttpClient); - PrepareBetaMessageBatchesPost2Arguments( + PrepareMessageBatchesPostArguments( httpClient: HttpClient, - anthropicBeta: ref anthropicBeta, anthropicVersion: ref anthropicVersion, request: request); @@ -85,10 +77,6 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( } } - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } if (anthropicVersion != default) { __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); @@ -104,10 +92,9 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareBetaMessageBatchesPost2Request( + PrepareMessageBatchesPostRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, - anthropicBeta: anthropicBeta, anthropicVersion: anthropicVersion, request: request); @@ -119,26 +106,26 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessBetaMessageBatchesPost2Response( + ProcessMessageBatchesPostResponse( httpClient: HttpClient, httpResponseMessage: __response); // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) { string? __content_4XX = null; - global::Anthropic.BetaErrorResponse? __value_4XX = null; + global::Anthropic.ErrorResponse? __value_4XX = null; if (ReadResponseAsString) { __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = global::Anthropic.BetaErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); } else { var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = await global::Anthropic.BetaErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); } - throw new global::Anthropic.ApiException( + throw new global::Anthropic.ApiException( message: __response.ReasonPhrase ?? string.Empty, statusCode: __response.StatusCode) { @@ -159,7 +146,7 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessBetaMessageBatchesPost2ResponseContent( + ProcessMessageBatchesPostResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -184,7 +171,7 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( } return - global::Anthropic.BetaMessageBatch.FromJson(__content, JsonSerializerContext) ?? + global::Anthropic.MessageBatch.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else @@ -210,7 +197,7 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - await global::Anthropic.BetaMessageBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::Anthropic.MessageBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } @@ -220,10 +207,6 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( /// Send a batch of Message creation requests.
/// The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -233,19 +216,17 @@ partial void ProcessBetaMessageBatchesPost2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task BetaMessageBatchesPost2Async( - global::System.Collections.Generic.IList requests, - string? anthropicBeta = default, + public async global::System.Threading.Tasks.Task MessageBatchesPostAsync( + global::System.Collections.Generic.IList requests, string? anthropicVersion = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::Anthropic.BetaCreateMessageBatchParams + var __request = new global::Anthropic.CreateMessageBatchParams { Requests = requests, }; - return await BetaMessageBatchesPost2Async( - anthropicBeta: anthropicBeta, + return await MessageBatchesPostAsync( anthropicVersion: anthropicVersion, request: __request, cancellationToken: cancellationToken).ConfigureAwait(false); diff --git a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesResults2.g.cs b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesResults.g.cs similarity index 85% rename from src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesResults2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesResults.g.cs index 5ccc176..b9e0d47 100644 --- a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesResults2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesResults.g.cs @@ -5,24 +5,22 @@ namespace Anthropic { public partial class MessageBatchesClient { - partial void PrepareBetaMessageBatchesResults2Arguments( + partial void PrepareMessageBatchesResultsArguments( global::System.Net.Http.HttpClient httpClient, ref string messageBatchId, - ref string? anthropicBeta, ref string? anthropicVersion, ref string? xApiKey); - partial void PrepareBetaMessageBatchesResults2Request( + partial void PrepareMessageBatchesResultsRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string messageBatchId, - string? anthropicBeta, string? anthropicVersion, string? xApiKey); - partial void ProcessBetaMessageBatchesResults2Response( + partial void ProcessMessageBatchesResultsResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessBetaMessageBatchesResults2ResponseContent( + partial void ProcessMessageBatchesResultsResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); @@ -35,10 +33,6 @@ partial void ProcessBetaMessageBatchesResults2ResponseContent( /// /// ID of the Message Batch. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -49,19 +43,17 @@ partial void ProcessBetaMessageBatchesResults2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task BetaMessageBatchesResults2Async( + public async global::System.Threading.Tasks.Task MessageBatchesResultsAsync( string messageBatchId, - string? anthropicBeta = default, string? anthropicVersion = default, string? xApiKey = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); - PrepareBetaMessageBatchesResults2Arguments( + PrepareMessageBatchesResultsArguments( httpClient: HttpClient, messageBatchId: ref messageBatchId, - anthropicBeta: ref anthropicBeta, anthropicVersion: ref anthropicVersion, xApiKey: ref xApiKey); @@ -93,10 +85,6 @@ partial void ProcessBetaMessageBatchesResults2ResponseContent( } } - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } if (anthropicVersion != default) { __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); @@ -110,11 +98,10 @@ partial void ProcessBetaMessageBatchesResults2ResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareBetaMessageBatchesResults2Request( + PrepareMessageBatchesResultsRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, messageBatchId: messageBatchId, - anthropicBeta: anthropicBeta, anthropicVersion: anthropicVersion, xApiKey: xApiKey); @@ -126,26 +113,26 @@ partial void ProcessBetaMessageBatchesResults2ResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessBetaMessageBatchesResults2Response( + ProcessMessageBatchesResultsResponse( httpClient: HttpClient, httpResponseMessage: __response); // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) { string? __content_4XX = null; - global::Anthropic.BetaErrorResponse? __value_4XX = null; + global::Anthropic.ErrorResponse? __value_4XX = null; if (ReadResponseAsString) { __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = global::Anthropic.BetaErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); } else { var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = await global::Anthropic.BetaErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); } - throw new global::Anthropic.ApiException( + throw new global::Anthropic.ApiException( message: __response.ReasonPhrase ?? string.Empty, statusCode: __response.StatusCode) { @@ -166,7 +153,7 @@ partial void ProcessBetaMessageBatchesResults2ResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessBetaMessageBatchesResults2ResponseContent( + ProcessMessageBatchesResultsResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); diff --git a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesRetrieve2.g.cs b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesRetrieve.g.cs similarity index 82% rename from src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesRetrieve2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesRetrieve.g.cs index d1cf21c..1628381 100644 --- a/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.BetaMessageBatchesRetrieve2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.MessageBatchesClient.MessageBatchesRetrieve.g.cs @@ -5,24 +5,22 @@ namespace Anthropic { public partial class MessageBatchesClient { - partial void PrepareBetaMessageBatchesRetrieve2Arguments( + partial void PrepareMessageBatchesRetrieveArguments( global::System.Net.Http.HttpClient httpClient, ref string messageBatchId, - ref string? anthropicBeta, ref string? anthropicVersion, ref string? xApiKey); - partial void PrepareBetaMessageBatchesRetrieve2Request( + partial void PrepareMessageBatchesRetrieveRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string messageBatchId, - string? anthropicBeta, string? anthropicVersion, string? xApiKey); - partial void ProcessBetaMessageBatchesRetrieve2Response( + partial void ProcessMessageBatchesRetrieveResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( + partial void ProcessMessageBatchesRetrieveResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); @@ -34,10 +32,6 @@ partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( /// /// ID of the Message Batch. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -48,19 +42,17 @@ partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task BetaMessageBatchesRetrieve2Async( + public async global::System.Threading.Tasks.Task MessageBatchesRetrieveAsync( string messageBatchId, - string? anthropicBeta = default, string? anthropicVersion = default, string? xApiKey = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); - PrepareBetaMessageBatchesRetrieve2Arguments( + PrepareMessageBatchesRetrieveArguments( httpClient: HttpClient, messageBatchId: ref messageBatchId, - anthropicBeta: ref anthropicBeta, anthropicVersion: ref anthropicVersion, xApiKey: ref xApiKey); @@ -92,10 +84,6 @@ partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( } } - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } if (anthropicVersion != default) { __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); @@ -109,11 +97,10 @@ partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareBetaMessageBatchesRetrieve2Request( + PrepareMessageBatchesRetrieveRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, messageBatchId: messageBatchId, - anthropicBeta: anthropicBeta, anthropicVersion: anthropicVersion, xApiKey: xApiKey); @@ -125,26 +112,26 @@ partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessBetaMessageBatchesRetrieve2Response( + ProcessMessageBatchesRetrieveResponse( httpClient: HttpClient, httpResponseMessage: __response); // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) { string? __content_4XX = null; - global::Anthropic.BetaErrorResponse? __value_4XX = null; + global::Anthropic.ErrorResponse? __value_4XX = null; if (ReadResponseAsString) { __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = global::Anthropic.BetaErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); } else { var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = await global::Anthropic.BetaErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); } - throw new global::Anthropic.ApiException( + throw new global::Anthropic.ApiException( message: __response.ReasonPhrase ?? string.Empty, statusCode: __response.StatusCode) { @@ -165,7 +152,7 @@ partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessBetaMessageBatchesRetrieve2ResponseContent( + ProcessMessageBatchesRetrieveResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -190,7 +177,7 @@ partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( } return - global::Anthropic.BetaMessageBatch.FromJson(__content, JsonSerializerContext) ?? + global::Anthropic.MessageBatch.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else @@ -216,7 +203,7 @@ partial void ProcessBetaMessageBatchesRetrieve2ResponseContent( using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - await global::Anthropic.BetaMessageBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::Anthropic.MessageBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Anthropic/Generated/Anthropic.MessagesClient.BetaMessagesCountTokensPost2.g.cs b/src/libs/Anthropic/Generated/Anthropic.MessagesClient.MessagesCountTokensPost.g.cs similarity index 85% rename from src/libs/Anthropic/Generated/Anthropic.MessagesClient.BetaMessagesCountTokensPost2.g.cs rename to src/libs/Anthropic/Generated/Anthropic.MessagesClient.MessagesCountTokensPost.g.cs index 3feec18..1f71788 100644 --- a/src/libs/Anthropic/Generated/Anthropic.MessagesClient.BetaMessagesCountTokensPost2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.MessagesClient.MessagesCountTokensPost.g.cs @@ -5,22 +5,20 @@ namespace Anthropic { public partial class MessagesClient { - partial void PrepareBetaMessagesCountTokensPost2Arguments( + partial void PrepareMessagesCountTokensPostArguments( global::System.Net.Http.HttpClient httpClient, - ref string? anthropicBeta, ref string? anthropicVersion, - global::Anthropic.BetaCountMessageTokensParams request); - partial void PrepareBetaMessagesCountTokensPost2Request( + global::Anthropic.CountMessageTokensParams request); + partial void PrepareMessagesCountTokensPostRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? anthropicBeta, string? anthropicVersion, - global::Anthropic.BetaCountMessageTokensParams request); - partial void ProcessBetaMessagesCountTokensPost2Response( + global::Anthropic.CountMessageTokensParams request); + partial void ProcessMessagesCountTokensPostResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessBetaMessagesCountTokensPost2ResponseContent( + partial void ProcessMessagesCountTokensPostResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); @@ -30,10 +28,6 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( /// Count the number of tokens in a Message.
/// The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -41,9 +35,8 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task BetaMessagesCountTokensPost2Async( - global::Anthropic.BetaCountMessageTokensParams request, - string? anthropicBeta = default, + public async global::System.Threading.Tasks.Task MessagesCountTokensPostAsync( + global::Anthropic.CountMessageTokensParams request, string? anthropicVersion = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -51,9 +44,8 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( PrepareArguments( client: HttpClient); - PrepareBetaMessagesCountTokensPost2Arguments( + PrepareMessagesCountTokensPostArguments( httpClient: HttpClient, - anthropicBeta: ref anthropicBeta, anthropicVersion: ref anthropicVersion, request: request); @@ -85,10 +77,6 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( } } - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } if (anthropicVersion != default) { __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); @@ -104,10 +92,9 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareBetaMessagesCountTokensPost2Request( + PrepareMessagesCountTokensPostRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, - anthropicBeta: anthropicBeta, anthropicVersion: anthropicVersion, request: request); @@ -119,26 +106,26 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessBetaMessagesCountTokensPost2Response( + ProcessMessagesCountTokensPostResponse( httpClient: HttpClient, httpResponseMessage: __response); // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) { string? __content_4XX = null; - global::Anthropic.BetaErrorResponse? __value_4XX = null; + global::Anthropic.ErrorResponse? __value_4XX = null; if (ReadResponseAsString) { __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = global::Anthropic.BetaErrorResponse.FromJson(__content_4XX, JsonSerializerContext); + __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); } else { var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = await global::Anthropic.BetaErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); + __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); } - throw new global::Anthropic.ApiException( + throw new global::Anthropic.ApiException( message: __response.ReasonPhrase ?? string.Empty, statusCode: __response.StatusCode) { @@ -159,7 +146,7 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessBetaMessagesCountTokensPost2ResponseContent( + ProcessMessagesCountTokensPostResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -184,7 +171,7 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( } return - global::Anthropic.BetaCountMessageTokensResponse.FromJson(__content, JsonSerializerContext) ?? + global::Anthropic.CountMessageTokensResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else @@ -210,7 +197,7 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - await global::Anthropic.BetaCountMessageTokensResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::Anthropic.CountMessageTokensResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } @@ -220,10 +207,6 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( /// Count the number of tokens in a Message.
/// The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it. /// - /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// /// /// The version of the Anthropic API you want to use.
/// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). @@ -340,17 +323,16 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task BetaMessagesCountTokensPost2Async( - global::System.Collections.Generic.IList messages, + public async global::System.Threading.Tasks.Task MessagesCountTokensPostAsync( + global::System.Collections.Generic.IList messages, global::Anthropic.Model model, - string? anthropicBeta = default, string? anthropicVersion = default, - global::Anthropic.BetaToolChoice? toolChoice = default, - global::System.Collections.Generic.IList? tools = default, - global::Anthropic.AnyOf>? system = default, + global::Anthropic.ToolChoice? toolChoice = default, + global::System.Collections.Generic.IList? tools = default, + global::Anthropic.AnyOf>? system = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::Anthropic.BetaCountMessageTokensParams + var __request = new global::Anthropic.CountMessageTokensParams { ToolChoice = toolChoice, Tools = tools, @@ -359,8 +341,7 @@ partial void ProcessBetaMessagesCountTokensPost2ResponseContent( Model = model, }; - return await BetaMessagesCountTokensPost2Async( - anthropicBeta: anthropicBeta, + return await MessagesCountTokensPostAsync( anthropicVersion: anthropicVersion, request: __request, cancellationToken: cancellationToken).ConfigureAwait(false); diff --git a/src/libs/Anthropic/Generated/Anthropic.MessagesClient.PromptCachingBetaMessagesPost.g.cs b/src/libs/Anthropic/Generated/Anthropic.MessagesClient.PromptCachingBetaMessagesPost.g.cs deleted file mode 100644 index 958698e..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.MessagesClient.PromptCachingBetaMessagesPost.g.cs +++ /dev/null @@ -1,419 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - public partial class MessagesClient - { - partial void PreparePromptCachingBetaMessagesPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? anthropicBeta, - ref string? anthropicVersion, - global::Anthropic.PromptCachingBetaCreateMessageParams request); - partial void PreparePromptCachingBetaMessagesPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? anthropicBeta, - string? anthropicVersion, - global::Anthropic.PromptCachingBetaCreateMessageParams request); - partial void ProcessPromptCachingBetaMessagesPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPromptCachingBetaMessagesPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create a Message
- /// Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
- /// The Messages API can be used for either single queries or stateless multi-turn conversations. - ///
- /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// - /// - /// The version of the Anthropic API you want to use.
- /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PromptCachingBetaMessagesPostAsync( - global::Anthropic.PromptCachingBetaCreateMessageParams request, - string? anthropicBeta = default, - string? anthropicVersion = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePromptCachingBetaMessagesPostArguments( - httpClient: HttpClient, - anthropicBeta: ref anthropicBeta, - anthropicVersion: ref anthropicVersion, - request: request); - - var __pathBuilder = new PathBuilder( - path: "/v1/messages?beta=prompt_caching", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } - if (anthropicVersion != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePromptCachingBetaMessagesPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - anthropicBeta: anthropicBeta, - anthropicVersion: anthropicVersion, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPromptCachingBetaMessagesPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Error response. See our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details. - if ((int)__response.StatusCode >= 400 && (int)__response.StatusCode <= 499) - { - string? __content_4XX = null; - global::Anthropic.ErrorResponse? __value_4XX = null; - if (ReadResponseAsString) - { - __content_4XX = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = global::Anthropic.ErrorResponse.FromJson(__content_4XX, JsonSerializerContext); - } - else - { - var __contentStream_4XX = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_4XX = await global::Anthropic.ErrorResponse.FromJsonStreamAsync(__contentStream_4XX, JsonSerializerContext).ConfigureAwait(false); - } - - throw new global::Anthropic.ApiException( - message: __response.ReasonPhrase ?? string.Empty, - statusCode: __response.StatusCode) - { - ResponseBody = __content_4XX, - ResponseObject = __value_4XX, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPromptCachingBetaMessagesPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - } - catch (global::System.Net.Http.HttpRequestException __ex) - { - throw new global::Anthropic.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - return - global::Anthropic.PromptCachingBetaMessage.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - } - catch (global::System.Net.Http.HttpRequestException __ex) - { - throw new global::Anthropic.ApiException( - message: __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - return - await global::Anthropic.PromptCachingBetaMessage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - } - - /// - /// Create a Message
- /// Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
- /// The Messages API can be used for either single queries or stateless multi-turn conversations. - ///
- /// - /// Optional header to specify the beta version(s) you want to use.
- /// To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta. - /// - /// - /// The version of the Anthropic API you want to use.
- /// Read more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning). - /// - /// - /// The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. - /// - /// - /// Input messages.
- /// Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
- /// Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
- /// If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
- /// Example with a single `user` message:
- /// ```json
- /// [{"role": "user", "content": "Hello, Claude"}]
- /// ```
- /// Example with multiple conversational turns:
- /// ```json
- /// [
- /// {"role": "user", "content": "Hello there."},
- /// {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
- /// {"role": "user", "content": "Can you explain LLMs in plain English?"},
- /// ]
- /// ```
- /// Example with a partially-filled response from Claude:
- /// ```json
- /// [
- /// {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
- /// {"role": "assistant", "content": "The best answer is ("},
- /// ]
- /// ```
- /// Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
- /// ```json
- /// {"role": "user", "content": "Hello, Claude"}
- /// ```
- /// ```json
- /// {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
- /// ```
- /// Starting with Claude 3 models, you can also send image content blocks:
- /// ```json
- /// {"role": "user", "content": [
- /// {
- /// "type": "image",
- /// "source": {
- /// "type": "base64",
- /// "media_type": "image/jpeg",
- /// "data": "/9j/4AAQSkZJRg...",
- /// }
- /// },
- /// {"type": "text", "text": "What is in this image?"}
- /// ]}
- /// ```
- /// We currently support the `base64` source type for images, and the `image/jpeg`, `image/png`, `image/gif`, and `image/webp` media types.
- /// See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for more input examples.
- /// Note that if you want to include a [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API. - /// - /// - /// The maximum number of tokens to generate before stopping.
- /// Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
- /// Different models have different maximum values for this parameter. See [models](https://docs.anthropic.com/en/docs/models-overview) for details.
- /// Example: 1024 - /// - /// - /// An object describing metadata about the request. - /// - /// - /// Custom text sequences that will cause the model to stop generating.
- /// Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
- /// If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence. - /// - /// - /// Whether to incrementally stream the response using server-sent events.
- /// See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for details. - /// - /// - /// System prompt.
- /// A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
- /// Example: [] - /// - /// - /// Amount of randomness injected into the response.
- /// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
- /// Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
- /// Example: 1 - /// - /// - /// How the model should use the provided tools. The model can use a specific tool, any available tool, or decide by itself. - /// - /// - /// Definitions of tools that the model may use.
- /// If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
- /// Each tool definition includes:
- /// * `name`: Name of the tool.
- /// * `description`: Optional, but strongly-recommended description of the tool.
- /// * `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
- /// For example, if you defined `tools` as:
- /// ```json
- /// [
- /// {
- /// "name": "get_stock_price",
- /// "description": "Get the current stock price for a given ticker symbol.",
- /// "input_schema": {
- /// "type": "object",
- /// "properties": {
- /// "ticker": {
- /// "type": "string",
- /// "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
- /// }
- /// },
- /// "required": ["ticker"]
- /// }
- /// }
- /// ]
- /// ```
- /// And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
- /// ```json
- /// [
- /// {
- /// "type": "tool_use",
- /// "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
- /// "name": "get_stock_price",
- /// "input": { "ticker": "^GSPC" }
- /// }
- /// ]
- /// ```
- /// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
- /// ```json
- /// [
- /// {
- /// "type": "tool_result",
- /// "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
- /// "content": "259.75 USD"
- /// }
- /// ]
- /// ```
- /// Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
- /// See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details. - /// - /// - /// Only sample from the top K options for each subsequent token.
- /// Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
- /// Recommended for advanced use cases only. You usually only need to use `temperature`.
- /// Example: 5 - /// - /// - /// Use nucleus sampling.
- /// In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
- /// Recommended for advanced use cases only. You usually only need to use `temperature`.
- /// Example: 0.7 - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PromptCachingBetaMessagesPostAsync( - global::Anthropic.Model model, - global::System.Collections.Generic.IList messages, - int maxTokens, - string? anthropicBeta = default, - string? anthropicVersion = default, - global::Anthropic.Metadata? metadata = default, - global::System.Collections.Generic.IList? stopSequences = default, - bool? stream = default, - global::Anthropic.AnyOf>? system = default, - double? temperature = default, - global::Anthropic.ToolChoice? toolChoice = default, - global::System.Collections.Generic.IList? tools = default, - int? topK = default, - double? topP = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Anthropic.PromptCachingBetaCreateMessageParams - { - Model = model, - Messages = messages, - MaxTokens = maxTokens, - Metadata = metadata, - StopSequences = stopSequences, - Stream = stream, - System = system, - Temperature = temperature, - ToolChoice = toolChoice, - Tools = tools, - TopK = topK, - TopP = topP, - }; - - return await PromptCachingBetaMessagesPostAsync( - anthropicBeta: anthropicBeta, - anthropicVersion: anthropicVersion, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item3.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSource.Json.g.cs similarity index 86% rename from src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item3.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSource.Json.g.cs index ff095db..43459b2 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item3.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSource.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public readonly partial struct ContentVariant2Item3 + public sealed partial class Base64PDFSource { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.ContentVariant2Item3? FromJson( + public static global::Anthropic.Base64PDFSource? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.ContentVariant2Item3), - jsonSerializerContext) as global::Anthropic.ContentVariant2Item3?; + typeof(global::Anthropic.Base64PDFSource), + jsonSerializerContext) as global::Anthropic.Base64PDFSource; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.ContentVariant2Item3? FromJson( + public static global::Anthropic.Base64PDFSource? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.ContentVariant2Item3), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ContentVariant2Item3?; + typeof(global::Anthropic.Base64PDFSource), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.Base64PDFSource; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSource.g.cs similarity index 53% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlock.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSource.g.cs index 1aa6cb2..7627f22 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSource.g.cs @@ -6,27 +6,28 @@ namespace Anthropic /// /// /// - public sealed partial class PromptCachingBetaRequestTextBlock + public sealed partial class Base64PDFSource { /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] - public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.Base64PDFSourceTypeJsonConverter))] + public global::Anthropic.Base64PDFSourceType Type { get; set; } /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestTextBlockTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestTextBlockType Type { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("media_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.Base64PDFSourceMediaTypeJsonConverter))] + public global::Anthropic.Base64PDFSourceMediaType MediaType { get; set; } /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("text")] + [global::System.Text.Json.Serialization.JsonPropertyName("data")] [global::System.Text.Json.Serialization.JsonRequired] - public required string Text { get; set; } + public required byte[] Data { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -35,26 +36,26 @@ public sealed partial class PromptCachingBetaRequestTextBlock public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// /// - /// + /// + /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PromptCachingBetaRequestTextBlock( - string text, - global::Anthropic.CacheControlEphemeral? cacheControl, - global::Anthropic.PromptCachingBetaRequestTextBlockType type) + public Base64PDFSource( + byte[] data, + global::Anthropic.Base64PDFSourceType type, + global::Anthropic.Base64PDFSourceMediaType mediaType) { - this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); - this.CacheControl = cacheControl; + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); this.Type = type; + this.MediaType = mediaType; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public PromptCachingBetaRequestTextBlock() + public Base64PDFSource() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSourceMediaType.g.cs similarity index 62% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSourceMediaType.g.cs index e66641e..cb95584 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSourceMediaType.g.cs @@ -6,38 +6,38 @@ namespace Anthropic /// /// /// - public enum PromptCachingBetaRequestTextBlockType + public enum Base64PDFSourceMediaType { /// /// /// - Text, + ApplicationPdf, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class PromptCachingBetaRequestTextBlockTypeExtensions + public static class Base64PDFSourceMediaTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this PromptCachingBetaRequestTextBlockType value) + public static string ToValueString(this Base64PDFSourceMediaType value) { return value switch { - PromptCachingBetaRequestTextBlockType.Text => "text", + Base64PDFSourceMediaType.ApplicationPdf => "application/pdf", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static PromptCachingBetaRequestTextBlockType? ToEnum(string value) + public static Base64PDFSourceMediaType? ToEnum(string value) { return value switch { - "text" => PromptCachingBetaRequestTextBlockType.Text, + "application/pdf" => Base64PDFSourceMediaType.ApplicationPdf, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSourceType.g.cs similarity index 61% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSourceType.g.cs index d835748..f1b5d91 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Base64PDFSourceType.g.cs @@ -6,38 +6,38 @@ namespace Anthropic /// /// /// - public enum PromptCachingBetaRequestImageBlockType + public enum Base64PDFSourceType { /// /// /// - Image, + Base64, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class PromptCachingBetaRequestImageBlockTypeExtensions + public static class Base64PDFSourceTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this PromptCachingBetaRequestImageBlockType value) + public static string ToValueString(this Base64PDFSourceType value) { return value switch { - PromptCachingBetaRequestImageBlockType.Image => "image", + Base64PDFSourceType.Base64 => "base64", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static PromptCachingBetaRequestImageBlockType? ToEnum(string value) + public static Base64PDFSourceType? ToEnum(string value) { return value switch { - "image" => PromptCachingBetaRequestImageBlockType.Image, + "base64" => Base64PDFSourceType.Base64, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlock.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingError.Json.g.cs similarity index 88% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlock.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingError.Json.g.cs index d2a5e5d..bcd8701 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlock.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingError.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class BetaRequestPDFBlock + public sealed partial class BetaBillingError { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.BetaRequestPDFBlock? FromJson( + public static global::Anthropic.BetaBillingError? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.BetaRequestPDFBlock), - jsonSerializerContext) as global::Anthropic.BetaRequestPDFBlock; + typeof(global::Anthropic.BetaBillingError), + jsonSerializerContext) as global::Anthropic.BetaBillingError; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.BetaRequestPDFBlock? FromJson( + public static global::Anthropic.BetaBillingError? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.BetaRequestPDFBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaRequestPDFBlock; + typeof(global::Anthropic.BetaBillingError), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaBillingError; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingError.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingError.g.cs new file mode 100644 index 0000000..2a37811 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingError.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class BetaBillingError + { + /// + /// Default Value: billing_error + /// + /// global::Anthropic.BetaBillingErrorType.BillingError + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaBillingErrorTypeJsonConverter))] + public global::Anthropic.BetaBillingErrorType Type { get; set; } = global::Anthropic.BetaBillingErrorType.BillingError; + + /// + /// Default Value: Billing error + /// + /// "Billing error" + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } = "Billing error"; + + /// + /// 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. + /// + /// + /// Default Value: billing_error + /// + /// + /// Default Value: Billing error + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public BetaBillingError( + string message, + global::Anthropic.BetaBillingErrorType type = global::Anthropic.BetaBillingErrorType.BillingError) + { + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public BetaBillingError() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingErrorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingErrorType.g.cs new file mode 100644 index 0000000..dae7355 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaBillingErrorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Default Value: billing_error + /// + public enum BetaBillingErrorType + { + /// + /// + /// + BillingError, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class BetaBillingErrorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this BetaBillingErrorType value) + { + return value switch + { + BetaBillingErrorType.BillingError => "billing_error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static BetaBillingErrorType? ToEnum(string value) + { + return value switch + { + "billing_error" => BetaBillingErrorType.BillingError, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEvent.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEvent.g.cs index 3ca6a44..c58eb80 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEvent.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEvent.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Anthropic @@ -27,9 +29,9 @@ public sealed partial class BetaContentBlockDeltaEvent /// /// [global::System.Text.Json.Serialization.JsonPropertyName("delta")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.DeltaJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.Delta Delta { get; set; } + public required global::Anthropic.AnyOf Delta { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -48,7 +50,7 @@ public sealed partial class BetaContentBlockDeltaEvent [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public BetaContentBlockDeltaEvent( int index, - global::Anthropic.Delta delta, + global::Anthropic.AnyOf delta, global::Anthropic.BetaContentBlockDeltaEventType type = global::Anthropic.BetaContentBlockDeltaEventType.ContentBlockDelta) { this.Index = index; diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEventDeltaDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEventDeltaDiscriminatorType.g.cs deleted file mode 100644 index 188d26a..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEventDeltaDiscriminatorType.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum BetaContentBlockDeltaEventDeltaDiscriminatorType - { - /// - /// - /// - InputJsonDelta, - /// - /// - /// - TextDelta, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class BetaContentBlockDeltaEventDeltaDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this BetaContentBlockDeltaEventDeltaDiscriminatorType value) - { - return value switch - { - BetaContentBlockDeltaEventDeltaDiscriminatorType.InputJsonDelta => "input_json_delta", - BetaContentBlockDeltaEventDeltaDiscriminatorType.TextDelta => "text_delta", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static BetaContentBlockDeltaEventDeltaDiscriminatorType? ToEnum(string value) - { - return value switch - { - "input_json_delta" => BetaContentBlockDeltaEventDeltaDiscriminatorType.InputJsonDelta, - "text_delta" => BetaContentBlockDeltaEventDeltaDiscriminatorType.TextDelta, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaErrorResponseErrorDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaErrorResponseErrorDiscriminatorType.g.cs index b2e5307..c9ade89 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaErrorResponseErrorDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaErrorResponseErrorDiscriminatorType.g.cs @@ -19,6 +19,10 @@ public enum BetaErrorResponseErrorDiscriminatorType /// /// /// + BillingError, + /// + /// + /// InvalidRequestError, /// /// @@ -36,6 +40,10 @@ public enum BetaErrorResponseErrorDiscriminatorType /// /// RateLimitError, + /// + /// + /// + TimeoutError, } /// @@ -52,11 +60,13 @@ public static string ToValueString(this BetaErrorResponseErrorDiscriminatorType { BetaErrorResponseErrorDiscriminatorType.ApiError => "api_error", BetaErrorResponseErrorDiscriminatorType.AuthenticationError => "authentication_error", + BetaErrorResponseErrorDiscriminatorType.BillingError => "billing_error", BetaErrorResponseErrorDiscriminatorType.InvalidRequestError => "invalid_request_error", BetaErrorResponseErrorDiscriminatorType.NotFoundError => "not_found_error", BetaErrorResponseErrorDiscriminatorType.OverloadedError => "overloaded_error", BetaErrorResponseErrorDiscriminatorType.PermissionError => "permission_error", BetaErrorResponseErrorDiscriminatorType.RateLimitError => "rate_limit_error", + BetaErrorResponseErrorDiscriminatorType.TimeoutError => "timeout_error", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -69,11 +79,13 @@ public static string ToValueString(this BetaErrorResponseErrorDiscriminatorType { "api_error" => BetaErrorResponseErrorDiscriminatorType.ApiError, "authentication_error" => BetaErrorResponseErrorDiscriminatorType.AuthenticationError, + "billing_error" => BetaErrorResponseErrorDiscriminatorType.BillingError, "invalid_request_error" => BetaErrorResponseErrorDiscriminatorType.InvalidRequestError, "not_found_error" => BetaErrorResponseErrorDiscriminatorType.NotFoundError, "overloaded_error" => BetaErrorResponseErrorDiscriminatorType.OverloadedError, "permission_error" => BetaErrorResponseErrorDiscriminatorType.PermissionError, "rate_limit_error" => BetaErrorResponseErrorDiscriminatorType.RateLimitError, + "timeout_error" => BetaErrorResponseErrorDiscriminatorType.TimeoutError, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaGatewayTimeoutError.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaGatewayTimeoutError.Json.g.cs new file mode 100644 index 0000000..d262e30 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaGatewayTimeoutError.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class BetaGatewayTimeoutError + { + /// + /// 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.BetaGatewayTimeoutError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.BetaGatewayTimeoutError), + jsonSerializerContext) as global::Anthropic.BetaGatewayTimeoutError; + } + + /// + /// 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.BetaGatewayTimeoutError? 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.BetaGatewayTimeoutError), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaGatewayTimeoutError; + } + + /// + /// 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.BetaGatewayTimeoutError.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaGatewayTimeoutError.g.cs new file mode 100644 index 0000000..5984ac7 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaGatewayTimeoutError.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class BetaGatewayTimeoutError + { + /// + /// Default Value: timeout_error + /// + /// global::Anthropic.BetaGatewayTimeoutErrorType.TimeoutError + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaGatewayTimeoutErrorTypeJsonConverter))] + public global::Anthropic.BetaGatewayTimeoutErrorType Type { get; set; } = global::Anthropic.BetaGatewayTimeoutErrorType.TimeoutError; + + /// + /// Default Value: Request timeout + /// + /// "Request timeout" + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } = "Request timeout"; + + /// + /// 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. + /// + /// + /// Default Value: timeout_error + /// + /// + /// Default Value: Request timeout + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public BetaGatewayTimeoutError( + string message, + global::Anthropic.BetaGatewayTimeoutErrorType type = global::Anthropic.BetaGatewayTimeoutErrorType.TimeoutError) + { + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public BetaGatewayTimeoutError() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaGatewayTimeoutErrorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaGatewayTimeoutErrorType.g.cs new file mode 100644 index 0000000..0073fcc --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaGatewayTimeoutErrorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Default Value: timeout_error + /// + public enum BetaGatewayTimeoutErrorType + { + /// + /// + /// + TimeoutError, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class BetaGatewayTimeoutErrorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this BetaGatewayTimeoutErrorType value) + { + return value switch + { + BetaGatewayTimeoutErrorType.TimeoutError => "timeout_error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static BetaGatewayTimeoutErrorType? ToEnum(string value) + { + return value switch + { + "timeout_error" => BetaGatewayTimeoutErrorType.TimeoutError, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaInputContentBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaInputContentBlock.g.cs index ce3087e..d857daa 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaInputContentBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaInputContentBlock.g.cs @@ -158,9 +158,9 @@ public BetaInputContentBlock(global::Anthropic.BetaRequestToolResultBlock? value /// /// #if NET6_0_OR_GREATER - public global::Anthropic.BetaRequestPDFBlock? Document { get; init; } + public global::Anthropic.BetaRequestDocumentBlock? Document { get; init; } #else - public global::Anthropic.BetaRequestPDFBlock? Document { get; } + public global::Anthropic.BetaRequestDocumentBlock? Document { get; } #endif /// @@ -174,17 +174,17 @@ public BetaInputContentBlock(global::Anthropic.BetaRequestToolResultBlock? value /// /// /// - public static implicit operator BetaInputContentBlock(global::Anthropic.BetaRequestPDFBlock value) => new BetaInputContentBlock(value); + public static implicit operator BetaInputContentBlock(global::Anthropic.BetaRequestDocumentBlock value) => new BetaInputContentBlock(value); /// /// /// - public static implicit operator global::Anthropic.BetaRequestPDFBlock?(BetaInputContentBlock @this) => @this.Document; + public static implicit operator global::Anthropic.BetaRequestDocumentBlock?(BetaInputContentBlock @this) => @this.Document; /// /// /// - public BetaInputContentBlock(global::Anthropic.BetaRequestPDFBlock? value) + public BetaInputContentBlock(global::Anthropic.BetaRequestDocumentBlock? value) { Document = value; } @@ -198,7 +198,7 @@ public BetaInputContentBlock( global::Anthropic.BetaRequestImageBlock? image, global::Anthropic.BetaRequestToolUseBlock? toolUse, global::Anthropic.BetaRequestToolResultBlock? toolResult, - global::Anthropic.BetaRequestPDFBlock? document + global::Anthropic.BetaRequestDocumentBlock? document ) { Type = type; @@ -237,7 +237,7 @@ public bool Validate() global::System.Func? image = null, global::System.Func? toolUse = null, global::System.Func? toolResult = null, - global::System.Func? document = null, + global::System.Func? document = null, bool validate = true) { if (validate) @@ -277,7 +277,7 @@ public void Match( global::System.Action? image = null, global::System.Action? toolUse = null, global::System.Action? toolResult = null, - global::System.Action? document = null, + global::System.Action? document = null, bool validate = true) { if (validate) @@ -323,7 +323,7 @@ public override int GetHashCode() ToolResult, typeof(global::Anthropic.BetaRequestToolResultBlock), Document, - typeof(global::Anthropic.BetaRequestPDFBlock), + typeof(global::Anthropic.BetaRequestDocumentBlock), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -344,7 +344,7 @@ public bool Equals(BetaInputContentBlock other) global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) && global::System.Collections.Generic.EqualityComparer.Default.Equals(ToolUse, other.ToolUse) && global::System.Collections.Generic.EqualityComparer.Default.Equals(ToolResult, other.ToolResult) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Document, other.Document) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Document, other.Document) ; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseMessageBatch.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseMessageBatch.g.cs index c9bc9fb..e5d82f8 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseMessageBatch.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseMessageBatch.g.cs @@ -23,19 +23,15 @@ public sealed partial class BetaListResponseMessageBatch public required bool HasMore { get; set; } /// - /// First ID in the `data` list. Can be used as the `before_id` for the previous page.
- /// Example: msgbatch_013Zva2CMHLNnXjNJJKqJ2EF + /// First ID in the `data` list. Can be used as the `before_id` for the previous page. ///
- /// msgbatch_013Zva2CMHLNnXjNJJKqJ2EF [global::System.Text.Json.Serialization.JsonPropertyName("first_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string? FirstId { get; set; } /// - /// Last ID in the `data` list. Can be used as the `after_id` for the next page.
- /// Example: msgbatch_01HkcTjaV5uDC8jWR4ZsDV8d + /// Last ID in the `data` list. Can be used as the `after_id` for the next page. ///
- /// msgbatch_01HkcTjaV5uDC8jWR4ZsDV8d [global::System.Text.Json.Serialization.JsonPropertyName("last_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string? LastId { get; set; } @@ -54,12 +50,10 @@ public sealed partial class BetaListResponseMessageBatch /// Indicates if there are more results in the requested page direction. /// /// - /// First ID in the `data` list. Can be used as the `before_id` for the previous page.
- /// Example: msgbatch_013Zva2CMHLNnXjNJJKqJ2EF + /// First ID in the `data` list. Can be used as the `before_id` for the previous page. /// /// - /// Last ID in the `data` list. Can be used as the `after_id` for the next page.
- /// Example: msgbatch_01HkcTjaV5uDC8jWR4ZsDV8d + /// Last ID in the `data` list. Can be used as the `after_id` for the next page. /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public BetaListResponseMessageBatch( diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseModelResponse.Json.g.cs similarity index 85% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminator.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseModelResponse.Json.g.cs index 28efb8e..b5451d2 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminator.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseModelResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class BetaMessageBatchResultDiscriminator + public sealed partial class BetaListResponseModelResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.BetaMessageBatchResultDiscriminator? FromJson( + public static global::Anthropic.BetaListResponseModelResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.BetaMessageBatchResultDiscriminator), - jsonSerializerContext) as global::Anthropic.BetaMessageBatchResultDiscriminator; + typeof(global::Anthropic.BetaListResponseModelResponse), + jsonSerializerContext) as global::Anthropic.BetaListResponseModelResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.BetaMessageBatchResultDiscriminator? FromJson( + public static global::Anthropic.BetaListResponseModelResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.BetaMessageBatchResultDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaMessageBatchResultDiscriminator; + typeof(global::Anthropic.BetaListResponseModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaListResponseModelResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseModelResponse.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseModelResponse.g.cs new file mode 100644 index 0000000..0752ea9 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaListResponseModelResponse.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class BetaListResponseModelResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Indicates if there are more results in the requested page direction. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("has_more")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool HasMore { get; set; } + + /// + /// First ID in the `data` list. Can be used as the `before_id` for the previous page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("first_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string? FirstId { get; set; } + + /// + /// Last ID in the `data` list. Can be used as the `after_id` for the next page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string? LastId { get; set; } + + /// + /// 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. + /// + /// + /// + /// Indicates if there are more results in the requested page direction. + /// + /// + /// First ID in the `data` list. Can be used as the `before_id` for the previous page. + /// + /// + /// Last ID in the `data` list. Can be used as the `after_id` for the next page. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public BetaListResponseModelResponse( + global::System.Collections.Generic.IList data, + bool hasMore, + string? firstId, + string? lastId) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.HasMore = hasMore; + this.FirstId = firstId ?? throw new global::System.ArgumentNullException(nameof(firstId)); + this.LastId = lastId ?? throw new global::System.ArgumentNullException(nameof(lastId)); + } + + /// + /// Initializes a new instance of the class. + /// + public BetaListResponseModelResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponse.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponse.g.cs index 9f70dac..1bc011c 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponse.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponse.g.cs @@ -23,9 +23,9 @@ public sealed partial class BetaMessageBatchIndividualResponse /// Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration. /// [global::System.Text.Json.Serialization.JsonPropertyName("result")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaMessageBatchResultJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ResultJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.BetaMessageBatchResult Result { get; set; } + public required global::Anthropic.Result Result { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -48,7 +48,7 @@ public sealed partial class BetaMessageBatchIndividualResponse [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public BetaMessageBatchIndividualResponse( string customId, - global::Anthropic.BetaMessageBatchResult result) + global::Anthropic.Result result) { this.CustomId = customId ?? throw new global::System.ArgumentNullException(nameof(customId)); this.Result = result; diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminator.Json.g.cs similarity index 82% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminator.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminator.Json.g.cs index ff845e7..db1db5d 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminator.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class PromptCachingBetaRequestImageBlockSourceDiscriminator + public sealed partial class BetaMessageBatchIndividualResponseResultDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminator? FromJson( + public static global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminator; + typeof(global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator), + jsonSerializerContext) as global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.PromptCachingBetaRequestImageBlockSourceDiscriminator? FromJson( + public static global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.PromptCachingBetaRequestImageBlockSourceDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminator; + typeof(global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminator.g.cs similarity index 61% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminator.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminator.g.cs index 22f449a..f3a0e3f 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminator.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Anthropic /// /// /// - public sealed partial class BetaMessageBatchResultDiscriminator + public sealed partial class BetaMessageBatchIndividualResponseResultDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaMessageBatchResultDiscriminatorTypeJsonConverter))] - public global::Anthropic.BetaMessageBatchResultDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorTypeJsonConverter))] + public global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,20 +22,20 @@ public sealed partial class BetaMessageBatchResultDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public BetaMessageBatchResultDiscriminator( - global::Anthropic.BetaMessageBatchResultDiscriminatorType? type) + public BetaMessageBatchIndividualResponseResultDiscriminator( + global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public BetaMessageBatchResultDiscriminator() + public BetaMessageBatchIndividualResponseResultDiscriminator() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminatorType.g.cs new file mode 100644 index 0000000..1567e09 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchIndividualResponseResultDiscriminatorType.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public enum BetaMessageBatchIndividualResponseResultDiscriminatorType + { + /// + /// + /// + Canceled, + /// + /// + /// + Errored, + /// + /// + /// + Expired, + /// + /// + /// + Succeeded, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class BetaMessageBatchIndividualResponseResultDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this BetaMessageBatchIndividualResponseResultDiscriminatorType value) + { + return value switch + { + BetaMessageBatchIndividualResponseResultDiscriminatorType.Canceled => "canceled", + BetaMessageBatchIndividualResponseResultDiscriminatorType.Errored => "errored", + BetaMessageBatchIndividualResponseResultDiscriminatorType.Expired => "expired", + BetaMessageBatchIndividualResponseResultDiscriminatorType.Succeeded => "succeeded", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static BetaMessageBatchIndividualResponseResultDiscriminatorType? ToEnum(string value) + { + return value switch + { + "canceled" => BetaMessageBatchIndividualResponseResultDiscriminatorType.Canceled, + "errored" => BetaMessageBatchIndividualResponseResultDiscriminatorType.Errored, + "expired" => BetaMessageBatchIndividualResponseResultDiscriminatorType.Expired, + "succeeded" => BetaMessageBatchIndividualResponseResultDiscriminatorType.Succeeded, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminatorType.g.cs deleted file mode 100644 index eb933cb..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResultDiscriminatorType.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum BetaMessageBatchResultDiscriminatorType - { - /// - /// - /// - Canceled, - /// - /// - /// - Errored, - /// - /// - /// - Expired, - /// - /// - /// - Succeeded, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class BetaMessageBatchResultDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this BetaMessageBatchResultDiscriminatorType value) - { - return value switch - { - BetaMessageBatchResultDiscriminatorType.Canceled => "canceled", - BetaMessageBatchResultDiscriminatorType.Errored => "errored", - BetaMessageBatchResultDiscriminatorType.Expired => "expired", - BetaMessageBatchResultDiscriminatorType.Succeeded => "succeeded", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static BetaMessageBatchResultDiscriminatorType? ToEnum(string value) - { - return value switch - { - "canceled" => BetaMessageBatchResultDiscriminatorType.Canceled, - "errored" => BetaMessageBatchResultDiscriminatorType.Errored, - "expired" => BetaMessageBatchResultDiscriminatorType.Expired, - "succeeded" => BetaMessageBatchResultDiscriminatorType.Succeeded, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResult.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponse.Json.g.cs similarity index 87% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResult.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponse.Json.g.cs index 4c2229d..023d452 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResult.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public readonly partial struct BetaMessageBatchResult + public sealed partial class BetaModelResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.BetaMessageBatchResult? FromJson( + public static global::Anthropic.BetaModelResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.BetaMessageBatchResult), - jsonSerializerContext) as global::Anthropic.BetaMessageBatchResult?; + typeof(global::Anthropic.BetaModelResponse), + jsonSerializerContext) as global::Anthropic.BetaModelResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.BetaMessageBatchResult? FromJson( + public static global::Anthropic.BetaModelResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.BetaMessageBatchResult), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaMessageBatchResult?; + typeof(global::Anthropic.BetaModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaModelResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponse.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponse.g.cs new file mode 100644 index 0000000..c880c98 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponse.g.cs @@ -0,0 +1,91 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class BetaModelResponse + { + /// + /// Object type.
+ /// For Models, this is always `"model"`.
+ /// Default Value: model + ///
+ /// global::Anthropic.BetaModelResponseType.Model + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaModelResponseTypeJsonConverter))] + public global::Anthropic.BetaModelResponseType Type { get; set; } = global::Anthropic.BetaModelResponseType.Model; + + /// + /// Unique model identifier.
+ /// Example: claude-3-5-sonnet-20241022 + ///
+ /// claude-3-5-sonnet-20241022 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// A human-readable name for the model.
+ /// Example: Claude 3.5 Sonnet (New) + ///
+ /// Claude 3.5 Sonnet (New) + [global::System.Text.Json.Serialization.JsonPropertyName("display_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DisplayName { get; set; } + + /// + /// RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// 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. + /// + /// + /// Object type.
+ /// For Models, this is always `"model"`.
+ /// Default Value: model + /// + /// + /// Unique model identifier.
+ /// Example: claude-3-5-sonnet-20241022 + /// + /// + /// A human-readable name for the model.
+ /// Example: Claude 3.5 Sonnet (New) + /// + /// + /// RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public BetaModelResponse( + string id, + string displayName, + global::System.DateTime createdAt, + global::Anthropic.BetaModelResponseType type = global::Anthropic.BetaModelResponseType.Model) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.DisplayName = displayName ?? throw new global::System.ArgumentNullException(nameof(displayName)); + this.CreatedAt = createdAt; + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public BetaModelResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponseType.g.cs similarity index 60% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponseType.g.cs index a07ad88..58f9699 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaModelResponseType.g.cs @@ -5,41 +5,41 @@ namespace Anthropic { /// /// Object type.
- /// For Messages, this is always `"message"`.
- /// Default Value: message + /// For Models, this is always `"model"`.
+ /// Default Value: model ///
- public enum PromptCachingBetaMessageType + public enum BetaModelResponseType { /// /// /// - Message, + Model, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class PromptCachingBetaMessageTypeExtensions + public static class BetaModelResponseTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this PromptCachingBetaMessageType value) + public static string ToValueString(this BetaModelResponseType value) { return value switch { - PromptCachingBetaMessageType.Message => "message", + BetaModelResponseType.Model => "model", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static PromptCachingBetaMessageType? ToEnum(string value) + public static BetaModelResponseType? ToEnum(string value) { return value switch { - "message" => PromptCachingBetaMessageType.Message, + "model" => BetaModelResponseType.Model, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessage.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlock.Json.g.cs similarity index 86% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessage.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlock.Json.g.cs index 74c7de0..ca08e52 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessage.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlock.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class PromptCachingBetaMessage + public sealed partial class BetaRequestDocumentBlock { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.PromptCachingBetaMessage? FromJson( + public static global::Anthropic.BetaRequestDocumentBlock? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.PromptCachingBetaMessage), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaMessage; + typeof(global::Anthropic.BetaRequestDocumentBlock), + jsonSerializerContext) as global::Anthropic.BetaRequestDocumentBlock; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.PromptCachingBetaMessage? FromJson( + public static global::Anthropic.BetaRequestDocumentBlock? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.PromptCachingBetaMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaMessage; + typeof(global::Anthropic.BetaRequestDocumentBlock), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaRequestDocumentBlock; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlock.g.cs similarity index 82% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlock.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlock.g.cs index dd7f279..9eb21e3 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlock.g.cs @@ -6,7 +6,7 @@ namespace Anthropic /// /// /// - public sealed partial class BetaRequestPDFBlock + public sealed partial class BetaRequestDocumentBlock { /// /// @@ -18,8 +18,8 @@ public sealed partial class BetaRequestPDFBlock /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaRequestPDFBlockTypeJsonConverter))] - public global::Anthropic.BetaRequestPDFBlockType Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockTypeJsonConverter))] + public global::Anthropic.BetaRequestDocumentBlockType Type { get; set; } /// /// @@ -35,16 +35,16 @@ public sealed partial class BetaRequestPDFBlock public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public BetaRequestPDFBlock( + public BetaRequestDocumentBlock( global::Anthropic.BetaBase64PDFSource source, global::Anthropic.BetaCacheControlEphemeral? cacheControl, - global::Anthropic.BetaRequestPDFBlockType type) + global::Anthropic.BetaRequestDocumentBlockType type) { this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); this.CacheControl = cacheControl; @@ -52,9 +52,9 @@ public BetaRequestPDFBlock( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public BetaRequestPDFBlock() + public BetaRequestDocumentBlock() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEventDeltaDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminator.Json.g.cs similarity index 83% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEventDeltaDiscriminator.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminator.Json.g.cs index 70fa679..fa8cbcb 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEventDeltaDiscriminator.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class BetaContentBlockDeltaEventDeltaDiscriminator + public sealed partial class BetaRequestDocumentBlockCacheControlDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminator? FromJson( + public static global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminator), - jsonSerializerContext) as global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminator; + typeof(global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminator), + jsonSerializerContext) as global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.BetaContentBlockDeltaEventDeltaDiscriminator? FromJson( + public static global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.BetaContentBlockDeltaEventDeltaDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminator; + typeof(global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminator.g.cs new file mode 100644 index 0000000..2cd5cc5 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminator.g.cs @@ -0,0 +1,42 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class BetaRequestDocumentBlockCacheControlDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorTypeJsonConverter))] + public global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType? Type { get; set; } + + /// + /// 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 BetaRequestDocumentBlockCacheControlDiscriminator( + global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public BetaRequestDocumentBlockCacheControlDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminatorType.g.cs new file mode 100644 index 0000000..c309129 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockCacheControlDiscriminatorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public enum BetaRequestDocumentBlockCacheControlDiscriminatorType + { + /// + /// + /// + Ephemeral, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class BetaRequestDocumentBlockCacheControlDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this BetaRequestDocumentBlockCacheControlDiscriminatorType value) + { + return value switch + { + BetaRequestDocumentBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static BetaRequestDocumentBlockCacheControlDiscriminatorType? ToEnum(string value) + { + return value switch + { + "ephemeral" => BetaRequestDocumentBlockCacheControlDiscriminatorType.Ephemeral, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminator.Json.g.cs similarity index 84% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminator.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminator.Json.g.cs index becd2de..8ac11a2 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminator.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class BetaRequestImageBlockSourceDiscriminator + public sealed partial class BetaRequestDocumentBlockSourceDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.BetaRequestImageBlockSourceDiscriminator? FromJson( + public static global::Anthropic.BetaRequestDocumentBlockSourceDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.BetaRequestImageBlockSourceDiscriminator), - jsonSerializerContext) as global::Anthropic.BetaRequestImageBlockSourceDiscriminator; + typeof(global::Anthropic.BetaRequestDocumentBlockSourceDiscriminator), + jsonSerializerContext) as global::Anthropic.BetaRequestDocumentBlockSourceDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.BetaRequestImageBlockSourceDiscriminator? FromJson( + public static global::Anthropic.BetaRequestDocumentBlockSourceDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.BetaRequestImageBlockSourceDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaRequestImageBlockSourceDiscriminator; + typeof(global::Anthropic.BetaRequestDocumentBlockSourceDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaRequestDocumentBlockSourceDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminator.g.cs similarity index 64% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminator.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminator.g.cs index 6bad171..3223b65 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminator.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Anthropic /// /// /// - public sealed partial class BetaRequestImageBlockSourceDiscriminator + public sealed partial class BetaRequestDocumentBlockSourceDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaRequestImageBlockSourceDiscriminatorTypeJsonConverter))] - public global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorTypeJsonConverter))] + public global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,20 +22,20 @@ public sealed partial class BetaRequestImageBlockSourceDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public BetaRequestImageBlockSourceDiscriminator( - global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType? type) + public BetaRequestDocumentBlockSourceDiscriminator( + global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public BetaRequestImageBlockSourceDiscriminator() + public BetaRequestDocumentBlockSourceDiscriminator() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminatorType.g.cs similarity index 59% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminatorType.g.cs index 7fb115a..3d785cd 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestImageBlockSourceDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockSourceDiscriminatorType.g.cs @@ -6,7 +6,7 @@ namespace Anthropic /// /// /// - public enum BetaRequestImageBlockSourceDiscriminatorType + public enum BetaRequestDocumentBlockSourceDiscriminatorType { /// /// @@ -17,27 +17,27 @@ public enum BetaRequestImageBlockSourceDiscriminatorType /// /// Enum extensions to do fast conversions without the reflection. /// - public static class BetaRequestImageBlockSourceDiscriminatorTypeExtensions + public static class BetaRequestDocumentBlockSourceDiscriminatorTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this BetaRequestImageBlockSourceDiscriminatorType value) + public static string ToValueString(this BetaRequestDocumentBlockSourceDiscriminatorType value) { return value switch { - BetaRequestImageBlockSourceDiscriminatorType.Base64 => "base64", + BetaRequestDocumentBlockSourceDiscriminatorType.Base64 => "base64", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static BetaRequestImageBlockSourceDiscriminatorType? ToEnum(string value) + public static BetaRequestDocumentBlockSourceDiscriminatorType? ToEnum(string value) { return value switch { - "base64" => BetaRequestImageBlockSourceDiscriminatorType.Base64, + "base64" => BetaRequestDocumentBlockSourceDiscriminatorType.Base64, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockType.g.cs new file mode 100644 index 0000000..6110d79 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestDocumentBlockType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public enum BetaRequestDocumentBlockType + { + /// + /// + /// + Document, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class BetaRequestDocumentBlockTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this BetaRequestDocumentBlockType value) + { + return value switch + { + BetaRequestDocumentBlockType.Document => "document", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static BetaRequestDocumentBlockType? ToEnum(string value) + { + return value switch + { + "document" => BetaRequestDocumentBlockType.Document, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item5.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BillingError.Json.g.cs similarity index 86% rename from src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item5.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.BillingError.Json.g.cs index 0320182..5f9c2e6 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item5.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BillingError.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public readonly partial struct ContentVariant2Item5 + public sealed partial class BillingError { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.ContentVariant2Item5? FromJson( + public static global::Anthropic.BillingError? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.ContentVariant2Item5), - jsonSerializerContext) as global::Anthropic.ContentVariant2Item5?; + typeof(global::Anthropic.BillingError), + jsonSerializerContext) as global::Anthropic.BillingError; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.ContentVariant2Item5? FromJson( + public static global::Anthropic.BillingError? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.ContentVariant2Item5), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ContentVariant2Item5?; + typeof(global::Anthropic.BillingError), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BillingError; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BillingError.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BillingError.g.cs new file mode 100644 index 0000000..74a5d06 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BillingError.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class BillingError + { + /// + /// Default Value: billing_error + /// + /// global::Anthropic.BillingErrorType.BillingError + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BillingErrorTypeJsonConverter))] + public global::Anthropic.BillingErrorType Type { get; set; } = global::Anthropic.BillingErrorType.BillingError; + + /// + /// Default Value: Billing error + /// + /// "Billing error" + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } = "Billing error"; + + /// + /// 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. + /// + /// + /// Default Value: billing_error + /// + /// + /// Default Value: Billing error + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public BillingError( + string message, + global::Anthropic.BillingErrorType type = global::Anthropic.BillingErrorType.BillingError) + { + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public BillingError() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BillingErrorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BillingErrorType.g.cs new file mode 100644 index 0000000..6ab1628 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BillingErrorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Default Value: billing_error + /// + public enum BillingErrorType + { + /// + /// + /// + BillingError, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class BillingErrorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this BillingErrorType value) + { + return value switch + { + BillingErrorType.BillingError => "billing_error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static BillingErrorType? ToEnum(string value) + { + return value switch + { + "billing_error" => BillingErrorType.BillingError, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.CanceledResult.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CanceledResult.Json.g.cs new file mode 100644 index 0000000..f498d23 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CanceledResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class CanceledResult + { + /// + /// 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.CanceledResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.CanceledResult), + jsonSerializerContext) as global::Anthropic.CanceledResult; + } + + /// + /// 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.CanceledResult? 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.CanceledResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.CanceledResult; + } + + /// + /// 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.CanceledResult.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CanceledResult.g.cs new file mode 100644 index 0000000..4ab09d6 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CanceledResult.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class CanceledResult + { + /// + /// Default Value: canceled + /// + /// global::Anthropic.CanceledResultType.Canceled + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.CanceledResultTypeJsonConverter))] + public global::Anthropic.CanceledResultType Type { get; set; } = global::Anthropic.CanceledResultType.Canceled; + + /// + /// 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. + /// + /// + /// Default Value: canceled + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CanceledResult( + global::Anthropic.CanceledResultType type = global::Anthropic.CanceledResultType.Canceled) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public CanceledResult() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.CanceledResultType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CanceledResultType.g.cs new file mode 100644 index 0000000..8b59559 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CanceledResultType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Default Value: canceled + /// + public enum CanceledResultType + { + /// + /// + /// + Canceled, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class CanceledResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this CanceledResultType value) + { + return value switch + { + CanceledResultType.Canceled => "canceled", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static CanceledResultType? ToEnum(string value) + { + return value switch + { + "canceled" => CanceledResultType.Canceled, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEvent.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEvent.g.cs index 97b6d1e..ab245c4 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEvent.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEvent.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Anthropic @@ -27,9 +29,9 @@ public sealed partial class ContentBlockDeltaEvent /// /// [global::System.Text.Json.Serialization.JsonPropertyName("delta")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.Delta2JsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.Delta2 Delta { get; set; } + public required global::Anthropic.AnyOf Delta { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -48,7 +50,7 @@ public sealed partial class ContentBlockDeltaEvent [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public ContentBlockDeltaEvent( int index, - global::Anthropic.Delta2 delta, + global::Anthropic.AnyOf delta, global::Anthropic.ContentBlockDeltaEventType type = global::Anthropic.ContentBlockDeltaEventType.ContentBlockDelta) { this.Index = index; diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEventDeltaDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEventDeltaDiscriminator.Json.g.cs deleted file mode 100644 index fa4dc69..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEventDeltaDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class ContentBlockDeltaEventDeltaDiscriminator - { - /// - /// 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.ContentBlockDeltaEventDeltaDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.ContentBlockDeltaEventDeltaDiscriminator), - jsonSerializerContext) as global::Anthropic.ContentBlockDeltaEventDeltaDiscriminator; - } - - /// - /// 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.ContentBlockDeltaEventDeltaDiscriminator? 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.ContentBlockDeltaEventDeltaDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ContentBlockDeltaEventDeltaDiscriminator; - } - - /// - /// 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.ContentBlockDeltaEventDeltaDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEventDeltaDiscriminatorType.g.cs deleted file mode 100644 index 2ad30f3..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEventDeltaDiscriminatorType.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum ContentBlockDeltaEventDeltaDiscriminatorType - { - /// - /// - /// - InputJsonDelta, - /// - /// - /// - TextDelta, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ContentBlockDeltaEventDeltaDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ContentBlockDeltaEventDeltaDiscriminatorType value) - { - return value switch - { - ContentBlockDeltaEventDeltaDiscriminatorType.InputJsonDelta => "input_json_delta", - ContentBlockDeltaEventDeltaDiscriminatorType.TextDelta => "text_delta", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ContentBlockDeltaEventDeltaDiscriminatorType? ToEnum(string value) - { - return value switch - { - "input_json_delta" => ContentBlockDeltaEventDeltaDiscriminatorType.InputJsonDelta, - "text_delta" => ContentBlockDeltaEventDeltaDiscriminatorType.TextDelta, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item2.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item2.g.cs index 8cce693..61676bf 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item2.g.cs @@ -12,7 +12,7 @@ namespace Anthropic /// /// /// - public global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType? Type { get; } + public global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType? Type { get; } /// /// @@ -84,101 +84,25 @@ public ContentVariant2Item2(global::Anthropic.RequestImageBlock? value) Image = value; } - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.RequestToolUseBlock? ToolUse { get; init; } -#else - public global::Anthropic.RequestToolUseBlock? ToolUse { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ToolUse))] -#endif - public bool IsToolUse => ToolUse != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item2(global::Anthropic.RequestToolUseBlock value) => new ContentVariant2Item2(value); - - /// - /// - /// - public static implicit operator global::Anthropic.RequestToolUseBlock?(ContentVariant2Item2 @this) => @this.ToolUse; - - /// - /// - /// - public ContentVariant2Item2(global::Anthropic.RequestToolUseBlock? value) - { - ToolUse = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.RequestToolResultBlock? ToolResult { get; init; } -#else - public global::Anthropic.RequestToolResultBlock? ToolResult { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ToolResult))] -#endif - public bool IsToolResult => ToolResult != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item2(global::Anthropic.RequestToolResultBlock value) => new ContentVariant2Item2(value); - - /// - /// - /// - public static implicit operator global::Anthropic.RequestToolResultBlock?(ContentVariant2Item2 @this) => @this.ToolResult; - - /// - /// - /// - public ContentVariant2Item2(global::Anthropic.RequestToolResultBlock? value) - { - ToolResult = value; - } - /// /// /// public ContentVariant2Item2( - global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType? type, + global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType? type, global::Anthropic.RequestTextBlock? text, - global::Anthropic.RequestImageBlock? image, - global::Anthropic.RequestToolUseBlock? toolUse, - global::Anthropic.RequestToolResultBlock? toolResult + global::Anthropic.RequestImageBlock? image ) { Type = type; Text = text; Image = image; - ToolUse = toolUse; - ToolResult = toolResult; } /// /// /// public object? Object => - ToolResult as object ?? - ToolUse as object ?? Image as object ?? Text as object ; @@ -188,7 +112,7 @@ Text as object /// public bool Validate() { - return IsText && !IsImage && !IsToolUse && !IsToolResult || !IsText && IsImage && !IsToolUse && !IsToolResult || !IsText && !IsImage && IsToolUse && !IsToolResult || !IsText && !IsImage && !IsToolUse && IsToolResult; + return IsText && !IsImage || !IsText && IsImage; } /// @@ -197,8 +121,6 @@ public bool Validate() public TResult? Match( global::System.Func? text = null, global::System.Func? image = null, - global::System.Func? toolUse = null, - global::System.Func? toolResult = null, bool validate = true) { if (validate) @@ -214,14 +136,6 @@ public bool Validate() { return image(Image!); } - else if (IsToolUse && toolUse != null) - { - return toolUse(ToolUse!); - } - else if (IsToolResult && toolResult != null) - { - return toolResult(ToolResult!); - } return default(TResult); } @@ -232,8 +146,6 @@ public bool Validate() public void Match( global::System.Action? text = null, global::System.Action? image = null, - global::System.Action? toolUse = null, - global::System.Action? toolResult = null, bool validate = true) { if (validate) @@ -249,14 +161,6 @@ public void Match( { image?.Invoke(Image!); } - else if (IsToolUse) - { - toolUse?.Invoke(ToolUse!); - } - else if (IsToolResult) - { - toolResult?.Invoke(ToolResult!); - } } /// @@ -270,10 +174,6 @@ public override int GetHashCode() typeof(global::Anthropic.RequestTextBlock), Image, typeof(global::Anthropic.RequestImageBlock), - ToolUse, - typeof(global::Anthropic.RequestToolUseBlock), - ToolResult, - typeof(global::Anthropic.RequestToolResultBlock), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -291,9 +191,7 @@ public bool Equals(ContentVariant2Item2 other) { return global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ToolUse, other.ToolUse) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ToolResult, other.ToolResult) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) ; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item3.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item3.g.cs deleted file mode 100644 index 334c447..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item3.g.cs +++ /dev/null @@ -1,324 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public readonly partial struct ContentVariant2Item3 : global::System.IEquatable - { - /// - /// - /// - public global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType? Type { get; } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.PromptCachingBetaRequestTextBlock? Text { get; init; } -#else - public global::Anthropic.PromptCachingBetaRequestTextBlock? Text { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] -#endif - public bool IsText => Text != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item3(global::Anthropic.PromptCachingBetaRequestTextBlock value) => new ContentVariant2Item3(value); - - /// - /// - /// - public static implicit operator global::Anthropic.PromptCachingBetaRequestTextBlock?(ContentVariant2Item3 @this) => @this.Text; - - /// - /// - /// - public ContentVariant2Item3(global::Anthropic.PromptCachingBetaRequestTextBlock? value) - { - Text = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.PromptCachingBetaRequestImageBlock? Image { get; init; } -#else - public global::Anthropic.PromptCachingBetaRequestImageBlock? Image { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] -#endif - public bool IsImage => Image != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item3(global::Anthropic.PromptCachingBetaRequestImageBlock value) => new ContentVariant2Item3(value); - - /// - /// - /// - public static implicit operator global::Anthropic.PromptCachingBetaRequestImageBlock?(ContentVariant2Item3 @this) => @this.Image; - - /// - /// - /// - public ContentVariant2Item3(global::Anthropic.PromptCachingBetaRequestImageBlock? value) - { - Image = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.PromptCachingBetaRequestToolUseBlock? ToolUse { get; init; } -#else - public global::Anthropic.PromptCachingBetaRequestToolUseBlock? ToolUse { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ToolUse))] -#endif - public bool IsToolUse => ToolUse != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item3(global::Anthropic.PromptCachingBetaRequestToolUseBlock value) => new ContentVariant2Item3(value); - - /// - /// - /// - public static implicit operator global::Anthropic.PromptCachingBetaRequestToolUseBlock?(ContentVariant2Item3 @this) => @this.ToolUse; - - /// - /// - /// - public ContentVariant2Item3(global::Anthropic.PromptCachingBetaRequestToolUseBlock? value) - { - ToolUse = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.PromptCachingBetaRequestToolResultBlock? ToolResult { get; init; } -#else - public global::Anthropic.PromptCachingBetaRequestToolResultBlock? ToolResult { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ToolResult))] -#endif - public bool IsToolResult => ToolResult != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item3(global::Anthropic.PromptCachingBetaRequestToolResultBlock value) => new ContentVariant2Item3(value); - - /// - /// - /// - public static implicit operator global::Anthropic.PromptCachingBetaRequestToolResultBlock?(ContentVariant2Item3 @this) => @this.ToolResult; - - /// - /// - /// - public ContentVariant2Item3(global::Anthropic.PromptCachingBetaRequestToolResultBlock? value) - { - ToolResult = value; - } - - /// - /// - /// - public ContentVariant2Item3( - global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType? type, - global::Anthropic.PromptCachingBetaRequestTextBlock? text, - global::Anthropic.PromptCachingBetaRequestImageBlock? image, - global::Anthropic.PromptCachingBetaRequestToolUseBlock? toolUse, - global::Anthropic.PromptCachingBetaRequestToolResultBlock? toolResult - ) - { - Type = type; - - Text = text; - Image = image; - ToolUse = toolUse; - ToolResult = toolResult; - } - - /// - /// - /// - public object? Object => - ToolResult as object ?? - ToolUse as object ?? - Image as object ?? - Text as object - ; - - /// - /// - /// - public bool Validate() - { - return IsText && !IsImage && !IsToolUse && !IsToolResult || !IsText && IsImage && !IsToolUse && !IsToolResult || !IsText && !IsImage && IsToolUse && !IsToolResult || !IsText && !IsImage && !IsToolUse && IsToolResult; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - global::System.Func? toolUse = null, - global::System.Func? toolResult = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsText && text != null) - { - return text(Text!); - } - else if (IsImage && image != null) - { - return image(Image!); - } - else if (IsToolUse && toolUse != null) - { - return toolUse(ToolUse!); - } - else if (IsToolResult && toolResult != null) - { - return toolResult(ToolResult!); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - global::System.Action? toolUse = null, - global::System.Action? toolResult = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsText) - { - text?.Invoke(Text!); - } - else if (IsImage) - { - image?.Invoke(Image!); - } - else if (IsToolUse) - { - toolUse?.Invoke(ToolUse!); - } - else if (IsToolResult) - { - toolResult?.Invoke(ToolResult!); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - Text, - typeof(global::Anthropic.PromptCachingBetaRequestTextBlock), - Image, - typeof(global::Anthropic.PromptCachingBetaRequestImageBlock), - ToolUse, - typeof(global::Anthropic.PromptCachingBetaRequestToolUseBlock), - ToolResult, - typeof(global::Anthropic.PromptCachingBetaRequestToolResultBlock), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(ContentVariant2Item3 other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ToolUse, other.ToolUse) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ToolResult, other.ToolResult) - ; - } - - /// - /// - /// - public static bool operator ==(ContentVariant2Item3 obj1, ContentVariant2Item3 obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(ContentVariant2Item3 obj1, ContentVariant2Item3 obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is ContentVariant2Item3 o && Equals(o); - } - } -} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item4.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item4.g.cs deleted file mode 100644 index a8515c6..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item4.g.cs +++ /dev/null @@ -1,222 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public readonly partial struct ContentVariant2Item4 : global::System.IEquatable - { - /// - /// - /// - public global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? Type { get; } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.PromptCachingBetaRequestTextBlock? Text { get; init; } -#else - public global::Anthropic.PromptCachingBetaRequestTextBlock? Text { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] -#endif - public bool IsText => Text != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item4(global::Anthropic.PromptCachingBetaRequestTextBlock value) => new ContentVariant2Item4(value); - - /// - /// - /// - public static implicit operator global::Anthropic.PromptCachingBetaRequestTextBlock?(ContentVariant2Item4 @this) => @this.Text; - - /// - /// - /// - public ContentVariant2Item4(global::Anthropic.PromptCachingBetaRequestTextBlock? value) - { - Text = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.PromptCachingBetaRequestImageBlock? Image { get; init; } -#else - public global::Anthropic.PromptCachingBetaRequestImageBlock? Image { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] -#endif - public bool IsImage => Image != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item4(global::Anthropic.PromptCachingBetaRequestImageBlock value) => new ContentVariant2Item4(value); - - /// - /// - /// - public static implicit operator global::Anthropic.PromptCachingBetaRequestImageBlock?(ContentVariant2Item4 @this) => @this.Image; - - /// - /// - /// - public ContentVariant2Item4(global::Anthropic.PromptCachingBetaRequestImageBlock? value) - { - Image = value; - } - - /// - /// - /// - public ContentVariant2Item4( - global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? type, - global::Anthropic.PromptCachingBetaRequestTextBlock? text, - global::Anthropic.PromptCachingBetaRequestImageBlock? image - ) - { - Type = type; - - Text = text; - Image = image; - } - - /// - /// - /// - public object? Object => - Image as object ?? - Text as object - ; - - /// - /// - /// - public bool Validate() - { - return IsText && !IsImage || !IsText && IsImage; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsText && text != null) - { - return text(Text!); - } - else if (IsImage && image != null) - { - return image(Image!); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsText) - { - text?.Invoke(Text!); - } - else if (IsImage) - { - image?.Invoke(Image!); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - Text, - typeof(global::Anthropic.PromptCachingBetaRequestTextBlock), - Image, - typeof(global::Anthropic.PromptCachingBetaRequestImageBlock), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(ContentVariant2Item4 other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) - ; - } - - /// - /// - /// - public static bool operator ==(ContentVariant2Item4 obj1, ContentVariant2Item4 obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(ContentVariant2Item4 obj1, ContentVariant2Item4 obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is ContentVariant2Item4 o && Equals(o); - } - } -} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item5.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item5.g.cs deleted file mode 100644 index 22be3a0..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item5.g.cs +++ /dev/null @@ -1,222 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public readonly partial struct ContentVariant2Item5 : global::System.IEquatable - { - /// - /// - /// - public global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType? Type { get; } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.RequestTextBlock? Text { get; init; } -#else - public global::Anthropic.RequestTextBlock? Text { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] -#endif - public bool IsText => Text != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item5(global::Anthropic.RequestTextBlock value) => new ContentVariant2Item5(value); - - /// - /// - /// - public static implicit operator global::Anthropic.RequestTextBlock?(ContentVariant2Item5 @this) => @this.Text; - - /// - /// - /// - public ContentVariant2Item5(global::Anthropic.RequestTextBlock? value) - { - Text = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.RequestImageBlock? Image { get; init; } -#else - public global::Anthropic.RequestImageBlock? Image { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] -#endif - public bool IsImage => Image != null; - - /// - /// - /// - public static implicit operator ContentVariant2Item5(global::Anthropic.RequestImageBlock value) => new ContentVariant2Item5(value); - - /// - /// - /// - public static implicit operator global::Anthropic.RequestImageBlock?(ContentVariant2Item5 @this) => @this.Image; - - /// - /// - /// - public ContentVariant2Item5(global::Anthropic.RequestImageBlock? value) - { - Image = value; - } - - /// - /// - /// - public ContentVariant2Item5( - global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType? type, - global::Anthropic.RequestTextBlock? text, - global::Anthropic.RequestImageBlock? image - ) - { - Type = type; - - Text = text; - Image = image; - } - - /// - /// - /// - public object? Object => - Image as object ?? - Text as object - ; - - /// - /// - /// - public bool Validate() - { - return IsText && !IsImage || !IsText && IsImage; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsText && text != null) - { - return text(Text!); - } - else if (IsImage && image != null) - { - return image(Image!); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsText) - { - text?.Invoke(Text!); - } - else if (IsImage) - { - image?.Invoke(Image!); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - Text, - typeof(global::Anthropic.RequestTextBlock), - Image, - typeof(global::Anthropic.RequestImageBlock), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(ContentVariant2Item5 other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) - ; - } - - /// - /// - /// - public static bool operator ==(ContentVariant2Item5 obj1, ContentVariant2Item5 obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(ContentVariant2Item5 obj1, ContentVariant2Item5 obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is ContentVariant2Item5 o && Equals(o); - } - } -} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaTool.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensParams.Json.g.cs similarity index 86% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaTool.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensParams.Json.g.cs index a3c1e4a..2a15487 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaTool.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensParams.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class PromptCachingBetaTool + public sealed partial class CountMessageTokensParams { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.PromptCachingBetaTool? FromJson( + public static global::Anthropic.CountMessageTokensParams? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.PromptCachingBetaTool), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaTool; + typeof(global::Anthropic.CountMessageTokensParams), + jsonSerializerContext) as global::Anthropic.CountMessageTokensParams; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.PromptCachingBetaTool? FromJson( + public static global::Anthropic.CountMessageTokensParams? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.PromptCachingBetaTool), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaTool; + typeof(global::Anthropic.CountMessageTokensParams), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.CountMessageTokensParams; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaCreateMessageParams.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensParams.g.cs similarity index 66% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaCreateMessageParams.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensParams.g.cs index 7a95000..090a595 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaCreateMessageParams.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensParams.g.cs @@ -8,15 +8,67 @@ namespace Anthropic /// /// /// - public sealed partial class PromptCachingBetaCreateMessageParams + public sealed partial class CountMessageTokensParams { /// - /// The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. + /// How the model should use the provided tools. The model can use a specific tool, any available tool, or decide by itself. /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ModelJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.Model Model { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("tool_choice")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ToolChoiceJsonConverter))] + public global::Anthropic.ToolChoice? ToolChoice { get; set; } + + /// + /// Definitions of tools that the model may use.
+ /// If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+ /// Each tool definition includes:
+ /// * `name`: Name of the tool.
+ /// * `description`: Optional, but strongly-recommended description of the tool.
+ /// * `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+ /// For example, if you defined `tools` as:
+ /// ```json
+ /// [
+ /// {
+ /// "name": "get_stock_price",
+ /// "description": "Get the current stock price for a given ticker symbol.",
+ /// "input_schema": {
+ /// "type": "object",
+ /// "properties": {
+ /// "ticker": {
+ /// "type": "string",
+ /// "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ /// }
+ /// },
+ /// "required": ["ticker"]
+ /// }
+ /// }
+ /// ]
+ /// ```
+ /// And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+ /// ```json
+ /// [
+ /// {
+ /// "type": "tool_use",
+ /// "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ /// "name": "get_stock_price",
+ /// "input": { "ticker": "^GSPC" }
+ /// }
+ /// ]
+ /// ```
+ /// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+ /// ```json
+ /// [
+ /// {
+ /// "type": "tool_result",
+ /// "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ /// "content": "259.75 USD"
+ /// }
+ /// ]
+ /// ```
+ /// Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+ /// See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("tools")] + public global::System.Collections.Generic.IList? Tools { get; set; } /// /// Input messages.
@@ -69,39 +121,7 @@ public sealed partial class PromptCachingBetaCreateMessageParams ///
[global::System.Text.Json.Serialization.JsonPropertyName("messages")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Messages { get; set; } - - /// - /// The maximum number of tokens to generate before stopping.
- /// Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
- /// Different models have different maximum values for this parameter. See [models](https://docs.anthropic.com/en/docs/models-overview) for details.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int MaxTokens { get; set; } - - /// - /// An object describing metadata about the request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public global::Anthropic.Metadata? Metadata { get; set; } - - /// - /// Custom text sequences that will cause the model to stop generating.
- /// Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
- /// If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("stop_sequences")] - public global::System.Collections.Generic.IList? StopSequences { get; set; } - - /// - /// Whether to incrementally stream the response using server-sent events.
- /// See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("stream")] - public bool? Stream { get; set; } + public required global::System.Collections.Generic.IList Messages { get; set; } /// /// System prompt.
@@ -110,27 +130,30 @@ public sealed partial class PromptCachingBetaCreateMessageParams ///
/// [] [global::System.Text.Json.Serialization.JsonPropertyName("system")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>))] - public global::Anthropic.AnyOf>? System { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>))] + public global::Anthropic.AnyOf>? System { get; set; } /// - /// Amount of randomness injected into the response.
- /// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
- /// Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
- /// Example: 1 + /// The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. ///
- /// 1 - [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public double? Temperature { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ModelJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Anthropic.Model Model { get; set; } /// - /// How the model should use the provided tools. The model can use a specific tool, any available tool, or decide by itself. + /// Additional properties that are not explicitly defined in the schema /// - [global::System.Text.Json.Serialization.JsonPropertyName("tool_choice")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ToolChoiceJsonConverter))] - public global::Anthropic.ToolChoice? ToolChoice { get; set; } + [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. + /// + /// + /// How the model should use the provided tools. The model can use a specific tool, any available tool, or decide by itself. + /// + /// /// Definitions of tools that the model may use.
/// If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
/// Each tool definition includes:
@@ -179,41 +202,6 @@ public sealed partial class PromptCachingBetaCreateMessageParams /// ```
/// Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
/// See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("tools")] - public global::System.Collections.Generic.IList? Tools { get; set; } - - /// - /// Only sample from the top K options for each subsequent token.
- /// Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
- /// Recommended for advanced use cases only. You usually only need to use `temperature`.
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("top_k")] - public int? TopK { get; set; } - - /// - /// Use nucleus sampling.
- /// In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
- /// Recommended for advanced use cases only. You usually only need to use `temperature`.
- /// Example: 0.7 - ///
- /// 0.7 - [global::System.Text.Json.Serialization.JsonPropertyName("top_p")] - public double? TopP { get; set; } - - /// - /// 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. - /// - /// - /// The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. /// /// /// Input messages.
@@ -264,133 +252,33 @@ public sealed partial class PromptCachingBetaCreateMessageParams /// See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for more input examples.
/// Note that if you want to include a [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API. /// - /// - /// The maximum number of tokens to generate before stopping.
- /// Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
- /// Different models have different maximum values for this parameter. See [models](https://docs.anthropic.com/en/docs/models-overview) for details.
- /// Example: 1024 - /// - /// - /// An object describing metadata about the request. - /// - /// - /// Custom text sequences that will cause the model to stop generating.
- /// Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
- /// If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence. - /// - /// - /// Whether to incrementally stream the response using server-sent events.
- /// See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for details. - /// /// /// System prompt.
/// A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
/// Example: [] /// - /// - /// Amount of randomness injected into the response.
- /// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
- /// Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
- /// Example: 1 - /// - /// - /// How the model should use the provided tools. The model can use a specific tool, any available tool, or decide by itself. - /// - /// - /// Definitions of tools that the model may use.
- /// If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
- /// Each tool definition includes:
- /// * `name`: Name of the tool.
- /// * `description`: Optional, but strongly-recommended description of the tool.
- /// * `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
- /// For example, if you defined `tools` as:
- /// ```json
- /// [
- /// {
- /// "name": "get_stock_price",
- /// "description": "Get the current stock price for a given ticker symbol.",
- /// "input_schema": {
- /// "type": "object",
- /// "properties": {
- /// "ticker": {
- /// "type": "string",
- /// "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
- /// }
- /// },
- /// "required": ["ticker"]
- /// }
- /// }
- /// ]
- /// ```
- /// And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
- /// ```json
- /// [
- /// {
- /// "type": "tool_use",
- /// "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
- /// "name": "get_stock_price",
- /// "input": { "ticker": "^GSPC" }
- /// }
- /// ]
- /// ```
- /// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
- /// ```json
- /// [
- /// {
- /// "type": "tool_result",
- /// "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
- /// "content": "259.75 USD"
- /// }
- /// ]
- /// ```
- /// Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
- /// See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details. - /// - /// - /// Only sample from the top K options for each subsequent token.
- /// Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
- /// Recommended for advanced use cases only. You usually only need to use `temperature`.
- /// Example: 5 - /// - /// - /// Use nucleus sampling.
- /// In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
- /// Recommended for advanced use cases only. You usually only need to use `temperature`.
- /// Example: 0.7 + /// + /// The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PromptCachingBetaCreateMessageParams( + public CountMessageTokensParams( + global::System.Collections.Generic.IList messages, global::Anthropic.Model model, - global::System.Collections.Generic.IList messages, - int maxTokens, - global::Anthropic.Metadata? metadata, - global::System.Collections.Generic.IList? stopSequences, - bool? stream, - global::Anthropic.AnyOf>? system, - double? temperature, global::Anthropic.ToolChoice? toolChoice, - global::System.Collections.Generic.IList? tools, - int? topK, - double? topP) + global::System.Collections.Generic.IList? tools, + global::Anthropic.AnyOf>? system) { - this.Model = model; this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); - this.MaxTokens = maxTokens; - this.Metadata = metadata; - this.StopSequences = stopSequences; - this.Stream = stream; - this.System = system; - this.Temperature = temperature; + this.Model = model; this.ToolChoice = toolChoice; this.Tools = tools; - this.TopK = topK; - this.TopP = topP; + this.System = system; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public PromptCachingBetaCreateMessageParams() + public CountMessageTokensParams() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensResponse.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensResponse.Json.g.cs new file mode 100644 index 0000000..78b600c --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class CountMessageTokensResponse + { + /// + /// 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.CountMessageTokensResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.CountMessageTokensResponse), + jsonSerializerContext) as global::Anthropic.CountMessageTokensResponse; + } + + /// + /// 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.CountMessageTokensResponse? 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.CountMessageTokensResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.CountMessageTokensResponse; + } + + /// + /// 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.CountMessageTokensResponse.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensResponse.g.cs new file mode 100644 index 0000000..e106566 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CountMessageTokensResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class CountMessageTokensResponse + { + /// + /// The total number of tokens across the provided list of messages, system prompt, and tools.
+ /// Example: 2095 + ///
+ /// 2095 + [global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int InputTokens { get; set; } + + /// + /// 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. + /// + /// + /// The total number of tokens across the provided list of messages, system prompt, and tools.
+ /// Example: 2095 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CountMessageTokensResponse( + int inputTokens) + { + this.InputTokens = inputTokens; + } + + /// + /// Initializes a new instance of the class. + /// + public CountMessageTokensResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageBatchParams.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageBatchParams.Json.g.cs new file mode 100644 index 0000000..60fd50a --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageBatchParams.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class CreateMessageBatchParams + { + /// + /// 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.CreateMessageBatchParams? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.CreateMessageBatchParams), + jsonSerializerContext) as global::Anthropic.CreateMessageBatchParams; + } + + /// + /// 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.CreateMessageBatchParams? 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.CreateMessageBatchParams), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.CreateMessageBatchParams; + } + + /// + /// 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.CreateMessageBatchParams.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageBatchParams.g.cs new file mode 100644 index 0000000..1cdce37 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageBatchParams.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class CreateMessageBatchParams + { + /// + /// List of requests for prompt completion. Each is an individual request to create a Message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("requests")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Requests { get; set; } + + /// + /// 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. + /// + /// + /// List of requests for prompt completion. Each is an individual request to create a Message. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CreateMessageBatchParams( + global::System.Collections.Generic.IList requests) + { + this.Requests = requests ?? throw new global::System.ArgumentNullException(nameof(requests)); + } + + /// + /// Initializes a new instance of the class. + /// + public CreateMessageBatchParams() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Delta.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Delta.g.cs deleted file mode 100644 index 5482779..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Delta.g.cs +++ /dev/null @@ -1,222 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public readonly partial struct Delta : global::System.IEquatable - { - /// - /// - /// - public global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType? Type { get; } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.BetaTextContentBlockDelta? TextDelta { get; init; } -#else - public global::Anthropic.BetaTextContentBlockDelta? TextDelta { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TextDelta))] -#endif - public bool IsTextDelta => TextDelta != null; - - /// - /// - /// - public static implicit operator Delta(global::Anthropic.BetaTextContentBlockDelta value) => new Delta(value); - - /// - /// - /// - public static implicit operator global::Anthropic.BetaTextContentBlockDelta?(Delta @this) => @this.TextDelta; - - /// - /// - /// - public Delta(global::Anthropic.BetaTextContentBlockDelta? value) - { - TextDelta = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.BetaInputJsonContentBlockDelta? InputJsonDelta { get; init; } -#else - public global::Anthropic.BetaInputJsonContentBlockDelta? InputJsonDelta { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputJsonDelta))] -#endif - public bool IsInputJsonDelta => InputJsonDelta != null; - - /// - /// - /// - public static implicit operator Delta(global::Anthropic.BetaInputJsonContentBlockDelta value) => new Delta(value); - - /// - /// - /// - public static implicit operator global::Anthropic.BetaInputJsonContentBlockDelta?(Delta @this) => @this.InputJsonDelta; - - /// - /// - /// - public Delta(global::Anthropic.BetaInputJsonContentBlockDelta? value) - { - InputJsonDelta = value; - } - - /// - /// - /// - public Delta( - global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType? type, - global::Anthropic.BetaTextContentBlockDelta? textDelta, - global::Anthropic.BetaInputJsonContentBlockDelta? inputJsonDelta - ) - { - Type = type; - - TextDelta = textDelta; - InputJsonDelta = inputJsonDelta; - } - - /// - /// - /// - public object? Object => - InputJsonDelta as object ?? - TextDelta as object - ; - - /// - /// - /// - public bool Validate() - { - return IsTextDelta && !IsInputJsonDelta || !IsTextDelta && IsInputJsonDelta; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? textDelta = null, - global::System.Func? inputJsonDelta = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsTextDelta && textDelta != null) - { - return textDelta(TextDelta!); - } - else if (IsInputJsonDelta && inputJsonDelta != null) - { - return inputJsonDelta(InputJsonDelta!); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? textDelta = null, - global::System.Action? inputJsonDelta = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsTextDelta) - { - textDelta?.Invoke(TextDelta!); - } - else if (IsInputJsonDelta) - { - inputJsonDelta?.Invoke(InputJsonDelta!); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - TextDelta, - typeof(global::Anthropic.BetaTextContentBlockDelta), - InputJsonDelta, - typeof(global::Anthropic.BetaInputJsonContentBlockDelta), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(Delta other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(TextDelta, other.TextDelta) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(InputJsonDelta, other.InputJsonDelta) - ; - } - - /// - /// - /// - public static bool operator ==(Delta obj1, Delta obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(Delta obj1, Delta obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is Delta o && Equals(o); - } - } -} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Delta2.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Delta2.g.cs deleted file mode 100644 index c965a99..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Delta2.g.cs +++ /dev/null @@ -1,222 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public readonly partial struct Delta2 : global::System.IEquatable - { - /// - /// - /// - public global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType? Type { get; } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.TextContentBlockDelta? TextDelta { get; init; } -#else - public global::Anthropic.TextContentBlockDelta? TextDelta { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TextDelta))] -#endif - public bool IsTextDelta => TextDelta != null; - - /// - /// - /// - public static implicit operator Delta2(global::Anthropic.TextContentBlockDelta value) => new Delta2(value); - - /// - /// - /// - public static implicit operator global::Anthropic.TextContentBlockDelta?(Delta2 @this) => @this.TextDelta; - - /// - /// - /// - public Delta2(global::Anthropic.TextContentBlockDelta? value) - { - TextDelta = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.InputJsonContentBlockDelta? InputJsonDelta { get; init; } -#else - public global::Anthropic.InputJsonContentBlockDelta? InputJsonDelta { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputJsonDelta))] -#endif - public bool IsInputJsonDelta => InputJsonDelta != null; - - /// - /// - /// - public static implicit operator Delta2(global::Anthropic.InputJsonContentBlockDelta value) => new Delta2(value); - - /// - /// - /// - public static implicit operator global::Anthropic.InputJsonContentBlockDelta?(Delta2 @this) => @this.InputJsonDelta; - - /// - /// - /// - public Delta2(global::Anthropic.InputJsonContentBlockDelta? value) - { - InputJsonDelta = value; - } - - /// - /// - /// - public Delta2( - global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType? type, - global::Anthropic.TextContentBlockDelta? textDelta, - global::Anthropic.InputJsonContentBlockDelta? inputJsonDelta - ) - { - Type = type; - - TextDelta = textDelta; - InputJsonDelta = inputJsonDelta; - } - - /// - /// - /// - public object? Object => - InputJsonDelta as object ?? - TextDelta as object - ; - - /// - /// - /// - public bool Validate() - { - return IsTextDelta && !IsInputJsonDelta || !IsTextDelta && IsInputJsonDelta; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? textDelta = null, - global::System.Func? inputJsonDelta = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsTextDelta && textDelta != null) - { - return textDelta(TextDelta!); - } - else if (IsInputJsonDelta && inputJsonDelta != null) - { - return inputJsonDelta(InputJsonDelta!); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? textDelta = null, - global::System.Action? inputJsonDelta = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsTextDelta) - { - textDelta?.Invoke(TextDelta!); - } - else if (IsInputJsonDelta) - { - inputJsonDelta?.Invoke(InputJsonDelta!); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - TextDelta, - typeof(global::Anthropic.TextContentBlockDelta), - InputJsonDelta, - typeof(global::Anthropic.InputJsonContentBlockDelta), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(Delta2 other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(TextDelta, other.TextDelta) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(InputJsonDelta, other.InputJsonDelta) - ; - } - - /// - /// - /// - public static bool operator ==(Delta2 obj1, Delta2 obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(Delta2 obj1, Delta2 obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is Delta2 o && Equals(o); - } - } -} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Error.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Error.g.cs index 3d70536..58a61b7 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Error.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Error.g.cs @@ -84,6 +84,41 @@ public Error(global::Anthropic.BetaAuthenticationError? value) AuthenticationError = value; } + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.BetaBillingError? BillingError { get; init; } +#else + public global::Anthropic.BetaBillingError? BillingError { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(BillingError))] +#endif + public bool IsBillingError => BillingError != null; + + /// + /// + /// + public static implicit operator Error(global::Anthropic.BetaBillingError value) => new Error(value); + + /// + /// + /// + public static implicit operator global::Anthropic.BetaBillingError?(Error @this) => @this.BillingError; + + /// + /// + /// + public Error(global::Anthropic.BetaBillingError? value) + { + BillingError = value; + } + /// /// /// @@ -189,6 +224,41 @@ public Error(global::Anthropic.BetaRateLimitError? value) RateLimitError = value; } + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.BetaGatewayTimeoutError? TimeoutError { get; init; } +#else + public global::Anthropic.BetaGatewayTimeoutError? TimeoutError { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TimeoutError))] +#endif + public bool IsTimeoutError => TimeoutError != null; + + /// + /// + /// + public static implicit operator Error(global::Anthropic.BetaGatewayTimeoutError value) => new Error(value); + + /// + /// + /// + public static implicit operator global::Anthropic.BetaGatewayTimeoutError?(Error @this) => @this.TimeoutError; + + /// + /// + /// + public Error(global::Anthropic.BetaGatewayTimeoutError? value) + { + TimeoutError = value; + } + /// /// /// @@ -266,9 +336,11 @@ public Error( global::Anthropic.BetaErrorResponseErrorDiscriminatorType? type, global::Anthropic.BetaInvalidRequestError? invalidRequestError, global::Anthropic.BetaAuthenticationError? authenticationError, + global::Anthropic.BetaBillingError? billingError, global::Anthropic.BetaPermissionError? permissionError, global::Anthropic.BetaNotFoundError? notFoundError, global::Anthropic.BetaRateLimitError? rateLimitError, + global::Anthropic.BetaGatewayTimeoutError? timeoutError, global::Anthropic.BetaAPIError? apiError, global::Anthropic.BetaOverloadedError? overloadedError ) @@ -277,9 +349,11 @@ public Error( InvalidRequestError = invalidRequestError; AuthenticationError = authenticationError; + BillingError = billingError; PermissionError = permissionError; NotFoundError = notFoundError; RateLimitError = rateLimitError; + TimeoutError = timeoutError; ApiError = apiError; OverloadedError = overloadedError; } @@ -290,9 +364,11 @@ public Error( public object? Object => OverloadedError as object ?? ApiError as object ?? + TimeoutError as object ?? RateLimitError as object ?? NotFoundError as object ?? PermissionError as object ?? + BillingError as object ?? AuthenticationError as object ?? InvalidRequestError as object ; @@ -302,7 +378,7 @@ InvalidRequestError as object ///
public bool Validate() { - return IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && IsAuthenticationError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && IsNotFoundError && !IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && !IsNotFoundError && IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsApiError && IsOverloadedError; + return IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && IsOverloadedError; } /// @@ -311,9 +387,11 @@ public bool Validate() public TResult? Match( global::System.Func? invalidRequestError = null, global::System.Func? authenticationError = null, + global::System.Func? billingError = null, global::System.Func? permissionError = null, global::System.Func? notFoundError = null, global::System.Func? rateLimitError = null, + global::System.Func? timeoutError = null, global::System.Func? apiError = null, global::System.Func? overloadedError = null, bool validate = true) @@ -331,6 +409,10 @@ public bool Validate() { return authenticationError(AuthenticationError!); } + else if (IsBillingError && billingError != null) + { + return billingError(BillingError!); + } else if (IsPermissionError && permissionError != null) { return permissionError(PermissionError!); @@ -343,6 +425,10 @@ public bool Validate() { return rateLimitError(RateLimitError!); } + else if (IsTimeoutError && timeoutError != null) + { + return timeoutError(TimeoutError!); + } else if (IsApiError && apiError != null) { return apiError(ApiError!); @@ -361,9 +447,11 @@ public bool Validate() public void Match( global::System.Action? invalidRequestError = null, global::System.Action? authenticationError = null, + global::System.Action? billingError = null, global::System.Action? permissionError = null, global::System.Action? notFoundError = null, global::System.Action? rateLimitError = null, + global::System.Action? timeoutError = null, global::System.Action? apiError = null, global::System.Action? overloadedError = null, bool validate = true) @@ -381,6 +469,10 @@ public void Match( { authenticationError?.Invoke(AuthenticationError!); } + else if (IsBillingError) + { + billingError?.Invoke(BillingError!); + } else if (IsPermissionError) { permissionError?.Invoke(PermissionError!); @@ -393,6 +485,10 @@ public void Match( { rateLimitError?.Invoke(RateLimitError!); } + else if (IsTimeoutError) + { + timeoutError?.Invoke(TimeoutError!); + } else if (IsApiError) { apiError?.Invoke(ApiError!); @@ -414,12 +510,16 @@ public override int GetHashCode() typeof(global::Anthropic.BetaInvalidRequestError), AuthenticationError, typeof(global::Anthropic.BetaAuthenticationError), + BillingError, + typeof(global::Anthropic.BetaBillingError), PermissionError, typeof(global::Anthropic.BetaPermissionError), NotFoundError, typeof(global::Anthropic.BetaNotFoundError), RateLimitError, typeof(global::Anthropic.BetaRateLimitError), + TimeoutError, + typeof(global::Anthropic.BetaGatewayTimeoutError), ApiError, typeof(global::Anthropic.BetaAPIError), OverloadedError, @@ -442,9 +542,11 @@ public bool Equals(Error other) return global::System.Collections.Generic.EqualityComparer.Default.Equals(InvalidRequestError, other.InvalidRequestError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(AuthenticationError, other.AuthenticationError) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(BillingError, other.BillingError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(PermissionError, other.PermissionError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(NotFoundError, other.NotFoundError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(RateLimitError, other.RateLimitError) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(TimeoutError, other.TimeoutError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(ApiError, other.ApiError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(OverloadedError, other.OverloadedError) ; diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Error2.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Error2.g.cs index eaeb5fe..19aa09e 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Error2.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Error2.g.cs @@ -84,6 +84,41 @@ public Error2(global::Anthropic.AuthenticationError? value) AuthenticationError = value; } + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.BillingError? BillingError { get; init; } +#else + public global::Anthropic.BillingError? BillingError { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(BillingError))] +#endif + public bool IsBillingError => BillingError != null; + + /// + /// + /// + public static implicit operator Error2(global::Anthropic.BillingError value) => new Error2(value); + + /// + /// + /// + public static implicit operator global::Anthropic.BillingError?(Error2 @this) => @this.BillingError; + + /// + /// + /// + public Error2(global::Anthropic.BillingError? value) + { + BillingError = value; + } + /// /// /// @@ -189,6 +224,41 @@ public Error2(global::Anthropic.RateLimitError? value) RateLimitError = value; } + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.GatewayTimeoutError? TimeoutError { get; init; } +#else + public global::Anthropic.GatewayTimeoutError? TimeoutError { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TimeoutError))] +#endif + public bool IsTimeoutError => TimeoutError != null; + + /// + /// + /// + public static implicit operator Error2(global::Anthropic.GatewayTimeoutError value) => new Error2(value); + + /// + /// + /// + public static implicit operator global::Anthropic.GatewayTimeoutError?(Error2 @this) => @this.TimeoutError; + + /// + /// + /// + public Error2(global::Anthropic.GatewayTimeoutError? value) + { + TimeoutError = value; + } + /// /// /// @@ -266,9 +336,11 @@ public Error2( global::Anthropic.ErrorResponseErrorDiscriminatorType? type, global::Anthropic.InvalidRequestError? invalidRequestError, global::Anthropic.AuthenticationError? authenticationError, + global::Anthropic.BillingError? billingError, global::Anthropic.PermissionError? permissionError, global::Anthropic.NotFoundError? notFoundError, global::Anthropic.RateLimitError? rateLimitError, + global::Anthropic.GatewayTimeoutError? timeoutError, global::Anthropic.APIError? apiError, global::Anthropic.OverloadedError? overloadedError ) @@ -277,9 +349,11 @@ public Error2( InvalidRequestError = invalidRequestError; AuthenticationError = authenticationError; + BillingError = billingError; PermissionError = permissionError; NotFoundError = notFoundError; RateLimitError = rateLimitError; + TimeoutError = timeoutError; ApiError = apiError; OverloadedError = overloadedError; } @@ -290,9 +364,11 @@ public Error2( public object? Object => OverloadedError as object ?? ApiError as object ?? + TimeoutError as object ?? RateLimitError as object ?? NotFoundError as object ?? PermissionError as object ?? + BillingError as object ?? AuthenticationError as object ?? InvalidRequestError as object ; @@ -302,7 +378,7 @@ InvalidRequestError as object /// public bool Validate() { - return IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && IsAuthenticationError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && IsNotFoundError && !IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && !IsNotFoundError && IsRateLimitError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsApiError && IsOverloadedError; + return IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && IsRateLimitError && !IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && IsTimeoutError && !IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && IsApiError && !IsOverloadedError || !IsInvalidRequestError && !IsAuthenticationError && !IsBillingError && !IsPermissionError && !IsNotFoundError && !IsRateLimitError && !IsTimeoutError && !IsApiError && IsOverloadedError; } /// @@ -311,9 +387,11 @@ public bool Validate() public TResult? Match( global::System.Func? invalidRequestError = null, global::System.Func? authenticationError = null, + global::System.Func? billingError = null, global::System.Func? permissionError = null, global::System.Func? notFoundError = null, global::System.Func? rateLimitError = null, + global::System.Func? timeoutError = null, global::System.Func? apiError = null, global::System.Func? overloadedError = null, bool validate = true) @@ -331,6 +409,10 @@ public bool Validate() { return authenticationError(AuthenticationError!); } + else if (IsBillingError && billingError != null) + { + return billingError(BillingError!); + } else if (IsPermissionError && permissionError != null) { return permissionError(PermissionError!); @@ -343,6 +425,10 @@ public bool Validate() { return rateLimitError(RateLimitError!); } + else if (IsTimeoutError && timeoutError != null) + { + return timeoutError(TimeoutError!); + } else if (IsApiError && apiError != null) { return apiError(ApiError!); @@ -361,9 +447,11 @@ public bool Validate() public void Match( global::System.Action? invalidRequestError = null, global::System.Action? authenticationError = null, + global::System.Action? billingError = null, global::System.Action? permissionError = null, global::System.Action? notFoundError = null, global::System.Action? rateLimitError = null, + global::System.Action? timeoutError = null, global::System.Action? apiError = null, global::System.Action? overloadedError = null, bool validate = true) @@ -381,6 +469,10 @@ public void Match( { authenticationError?.Invoke(AuthenticationError!); } + else if (IsBillingError) + { + billingError?.Invoke(BillingError!); + } else if (IsPermissionError) { permissionError?.Invoke(PermissionError!); @@ -393,6 +485,10 @@ public void Match( { rateLimitError?.Invoke(RateLimitError!); } + else if (IsTimeoutError) + { + timeoutError?.Invoke(TimeoutError!); + } else if (IsApiError) { apiError?.Invoke(ApiError!); @@ -414,12 +510,16 @@ public override int GetHashCode() typeof(global::Anthropic.InvalidRequestError), AuthenticationError, typeof(global::Anthropic.AuthenticationError), + BillingError, + typeof(global::Anthropic.BillingError), PermissionError, typeof(global::Anthropic.PermissionError), NotFoundError, typeof(global::Anthropic.NotFoundError), RateLimitError, typeof(global::Anthropic.RateLimitError), + TimeoutError, + typeof(global::Anthropic.GatewayTimeoutError), ApiError, typeof(global::Anthropic.APIError), OverloadedError, @@ -442,9 +542,11 @@ public bool Equals(Error2 other) return global::System.Collections.Generic.EqualityComparer.Default.Equals(InvalidRequestError, other.InvalidRequestError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(AuthenticationError, other.AuthenticationError) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(BillingError, other.BillingError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(PermissionError, other.PermissionError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(NotFoundError, other.NotFoundError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(RateLimitError, other.RateLimitError) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(TimeoutError, other.TimeoutError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(ApiError, other.ApiError) && global::System.Collections.Generic.EqualityComparer.Default.Equals(OverloadedError, other.OverloadedError) ; diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ErrorResponseErrorDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ErrorResponseErrorDiscriminatorType.g.cs index bc48e43..3bdfa5b 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ErrorResponseErrorDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ErrorResponseErrorDiscriminatorType.g.cs @@ -19,6 +19,10 @@ public enum ErrorResponseErrorDiscriminatorType /// /// /// + BillingError, + /// + /// + /// InvalidRequestError, /// /// @@ -36,6 +40,10 @@ public enum ErrorResponseErrorDiscriminatorType /// /// RateLimitError, + /// + /// + /// + TimeoutError, } /// @@ -52,11 +60,13 @@ public static string ToValueString(this ErrorResponseErrorDiscriminatorType valu { ErrorResponseErrorDiscriminatorType.ApiError => "api_error", ErrorResponseErrorDiscriminatorType.AuthenticationError => "authentication_error", + ErrorResponseErrorDiscriminatorType.BillingError => "billing_error", ErrorResponseErrorDiscriminatorType.InvalidRequestError => "invalid_request_error", ErrorResponseErrorDiscriminatorType.NotFoundError => "not_found_error", ErrorResponseErrorDiscriminatorType.OverloadedError => "overloaded_error", ErrorResponseErrorDiscriminatorType.PermissionError => "permission_error", ErrorResponseErrorDiscriminatorType.RateLimitError => "rate_limit_error", + ErrorResponseErrorDiscriminatorType.TimeoutError => "timeout_error", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -69,11 +79,13 @@ public static string ToValueString(this ErrorResponseErrorDiscriminatorType valu { "api_error" => ErrorResponseErrorDiscriminatorType.ApiError, "authentication_error" => ErrorResponseErrorDiscriminatorType.AuthenticationError, + "billing_error" => ErrorResponseErrorDiscriminatorType.BillingError, "invalid_request_error" => ErrorResponseErrorDiscriminatorType.InvalidRequestError, "not_found_error" => ErrorResponseErrorDiscriminatorType.NotFoundError, "overloaded_error" => ErrorResponseErrorDiscriminatorType.OverloadedError, "permission_error" => ErrorResponseErrorDiscriminatorType.PermissionError, "rate_limit_error" => ErrorResponseErrorDiscriminatorType.RateLimitError, + "timeout_error" => ErrorResponseErrorDiscriminatorType.TimeoutError, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ErroredResult.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ErroredResult.Json.g.cs new file mode 100644 index 0000000..3fc0de1 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ErroredResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class ErroredResult + { + /// + /// 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.ErroredResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.ErroredResult), + jsonSerializerContext) as global::Anthropic.ErroredResult; + } + + /// + /// 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.ErroredResult? 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.ErroredResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ErroredResult; + } + + /// + /// 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.ErroredResult.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ErroredResult.g.cs new file mode 100644 index 0000000..fff4776 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ErroredResult.g.cs @@ -0,0 +1,55 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class ErroredResult + { + /// + /// Default Value: errored + /// + /// global::Anthropic.ErroredResultType.Errored + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ErroredResultTypeJsonConverter))] + public global::Anthropic.ErroredResultType Type { get; set; } = global::Anthropic.ErroredResultType.Errored; + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Anthropic.ErrorResponse Error { get; set; } + + /// + /// 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. + /// + /// + /// Default Value: errored + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ErroredResult( + global::Anthropic.ErrorResponse error, + global::Anthropic.ErroredResultType type = global::Anthropic.ErroredResultType.Errored) + { + this.Error = error ?? throw new global::System.ArgumentNullException(nameof(error)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public ErroredResult() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ErroredResultType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ErroredResultType.g.cs new file mode 100644 index 0000000..775df29 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ErroredResultType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Default Value: errored + /// + public enum ErroredResultType + { + /// + /// + /// + Errored, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ErroredResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ErroredResultType value) + { + return value switch + { + ErroredResultType.Errored => "errored", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ErroredResultType? ToEnum(string value) + { + return value switch + { + "errored" => ErroredResultType.Errored, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ExpiredResult.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ExpiredResult.Json.g.cs new file mode 100644 index 0000000..5b3b004 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ExpiredResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class ExpiredResult + { + /// + /// 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.ExpiredResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.ExpiredResult), + jsonSerializerContext) as global::Anthropic.ExpiredResult; + } + + /// + /// 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.ExpiredResult? 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.ExpiredResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ExpiredResult; + } + + /// + /// 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.ExpiredResult.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ExpiredResult.g.cs new file mode 100644 index 0000000..c1fed2a --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ExpiredResult.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class ExpiredResult + { + /// + /// Default Value: expired + /// + /// global::Anthropic.ExpiredResultType.Expired + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ExpiredResultTypeJsonConverter))] + public global::Anthropic.ExpiredResultType Type { get; set; } = global::Anthropic.ExpiredResultType.Expired; + + /// + /// 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. + /// + /// + /// Default Value: expired + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ExpiredResult( + global::Anthropic.ExpiredResultType type = global::Anthropic.ExpiredResultType.Expired) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public ExpiredResult() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ExpiredResultType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ExpiredResultType.g.cs new file mode 100644 index 0000000..b71d759 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ExpiredResultType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Default Value: expired + /// + public enum ExpiredResultType + { + /// + /// + /// + Expired, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ExpiredResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ExpiredResultType value) + { + return value switch + { + ExpiredResultType.Expired => "expired", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ExpiredResultType? ToEnum(string value) + { + return value switch + { + "expired" => ExpiredResultType.Expired, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.GatewayTimeoutError.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.GatewayTimeoutError.Json.g.cs new file mode 100644 index 0000000..506fdd6 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.GatewayTimeoutError.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class GatewayTimeoutError + { + /// + /// 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.GatewayTimeoutError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.GatewayTimeoutError), + jsonSerializerContext) as global::Anthropic.GatewayTimeoutError; + } + + /// + /// 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.GatewayTimeoutError? 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.GatewayTimeoutError), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.GatewayTimeoutError; + } + + /// + /// 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.GatewayTimeoutError.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.GatewayTimeoutError.g.cs new file mode 100644 index 0000000..49a3cf4 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.GatewayTimeoutError.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class GatewayTimeoutError + { + /// + /// Default Value: timeout_error + /// + /// global::Anthropic.GatewayTimeoutErrorType.TimeoutError + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.GatewayTimeoutErrorTypeJsonConverter))] + public global::Anthropic.GatewayTimeoutErrorType Type { get; set; } = global::Anthropic.GatewayTimeoutErrorType.TimeoutError; + + /// + /// Default Value: Request timeout + /// + /// "Request timeout" + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } = "Request timeout"; + + /// + /// 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. + /// + /// + /// Default Value: timeout_error + /// + /// + /// Default Value: Request timeout + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GatewayTimeoutError( + string message, + global::Anthropic.GatewayTimeoutErrorType type = global::Anthropic.GatewayTimeoutErrorType.TimeoutError) + { + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public GatewayTimeoutError() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.GatewayTimeoutErrorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.GatewayTimeoutErrorType.g.cs new file mode 100644 index 0000000..212a67d --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.GatewayTimeoutErrorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Default Value: timeout_error + /// + public enum GatewayTimeoutErrorType + { + /// + /// + /// + TimeoutError, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GatewayTimeoutErrorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GatewayTimeoutErrorType value) + { + return value switch + { + GatewayTimeoutErrorType.TimeoutError => "timeout_error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GatewayTimeoutErrorType? ToEnum(string value) + { + return value switch + { + "timeout_error" => GatewayTimeoutErrorType.TimeoutError, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlock.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlock.Json.g.cs new file mode 100644 index 0000000..c49723f --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlock.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public readonly partial struct InputContentBlock + { + /// + /// 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.InputContentBlock? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.InputContentBlock), + jsonSerializerContext) as global::Anthropic.InputContentBlock?; + } + + /// + /// 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.InputContentBlock? 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.InputContentBlock), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.InputContentBlock?; + } + + /// + /// 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.InputContentBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlock.g.cs new file mode 100644 index 0000000..3e9e134 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlock.g.cs @@ -0,0 +1,375 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public readonly partial struct InputContentBlock : global::System.IEquatable + { + /// + /// + /// + public global::Anthropic.InputContentBlockDiscriminatorType? Type { get; } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.RequestTextBlock? Text { get; init; } +#else + public global::Anthropic.RequestTextBlock? Text { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] +#endif + public bool IsText => Text != null; + + /// + /// + /// + public static implicit operator InputContentBlock(global::Anthropic.RequestTextBlock value) => new InputContentBlock(value); + + /// + /// + /// + public static implicit operator global::Anthropic.RequestTextBlock?(InputContentBlock @this) => @this.Text; + + /// + /// + /// + public InputContentBlock(global::Anthropic.RequestTextBlock? value) + { + Text = value; + } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.RequestImageBlock? Image { get; init; } +#else + public global::Anthropic.RequestImageBlock? Image { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] +#endif + public bool IsImage => Image != null; + + /// + /// + /// + public static implicit operator InputContentBlock(global::Anthropic.RequestImageBlock value) => new InputContentBlock(value); + + /// + /// + /// + public static implicit operator global::Anthropic.RequestImageBlock?(InputContentBlock @this) => @this.Image; + + /// + /// + /// + public InputContentBlock(global::Anthropic.RequestImageBlock? value) + { + Image = value; + } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.RequestToolUseBlock? ToolUse { get; init; } +#else + public global::Anthropic.RequestToolUseBlock? ToolUse { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ToolUse))] +#endif + public bool IsToolUse => ToolUse != null; + + /// + /// + /// + public static implicit operator InputContentBlock(global::Anthropic.RequestToolUseBlock value) => new InputContentBlock(value); + + /// + /// + /// + public static implicit operator global::Anthropic.RequestToolUseBlock?(InputContentBlock @this) => @this.ToolUse; + + /// + /// + /// + public InputContentBlock(global::Anthropic.RequestToolUseBlock? value) + { + ToolUse = value; + } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.RequestToolResultBlock? ToolResult { get; init; } +#else + public global::Anthropic.RequestToolResultBlock? ToolResult { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ToolResult))] +#endif + public bool IsToolResult => ToolResult != null; + + /// + /// + /// + public static implicit operator InputContentBlock(global::Anthropic.RequestToolResultBlock value) => new InputContentBlock(value); + + /// + /// + /// + public static implicit operator global::Anthropic.RequestToolResultBlock?(InputContentBlock @this) => @this.ToolResult; + + /// + /// + /// + public InputContentBlock(global::Anthropic.RequestToolResultBlock? value) + { + ToolResult = value; + } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.RequestDocumentBlock? Document { get; init; } +#else + public global::Anthropic.RequestDocumentBlock? Document { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Document))] +#endif + public bool IsDocument => Document != null; + + /// + /// + /// + public static implicit operator InputContentBlock(global::Anthropic.RequestDocumentBlock value) => new InputContentBlock(value); + + /// + /// + /// + public static implicit operator global::Anthropic.RequestDocumentBlock?(InputContentBlock @this) => @this.Document; + + /// + /// + /// + public InputContentBlock(global::Anthropic.RequestDocumentBlock? value) + { + Document = value; + } + + /// + /// + /// + public InputContentBlock( + global::Anthropic.InputContentBlockDiscriminatorType? type, + global::Anthropic.RequestTextBlock? text, + global::Anthropic.RequestImageBlock? image, + global::Anthropic.RequestToolUseBlock? toolUse, + global::Anthropic.RequestToolResultBlock? toolResult, + global::Anthropic.RequestDocumentBlock? document + ) + { + Type = type; + + Text = text; + Image = image; + ToolUse = toolUse; + ToolResult = toolResult; + Document = document; + } + + /// + /// + /// + public object? Object => + Document as object ?? + ToolResult as object ?? + ToolUse as object ?? + Image as object ?? + Text as object + ; + + /// + /// + /// + public bool Validate() + { + return IsText && !IsImage && !IsToolUse && !IsToolResult && !IsDocument || !IsText && IsImage && !IsToolUse && !IsToolResult && !IsDocument || !IsText && !IsImage && IsToolUse && !IsToolResult && !IsDocument || !IsText && !IsImage && !IsToolUse && IsToolResult && !IsDocument || !IsText && !IsImage && !IsToolUse && !IsToolResult && IsDocument; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolUse = null, + global::System.Func? toolResult = null, + global::System.Func? document = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText && text != null) + { + return text(Text!); + } + else if (IsImage && image != null) + { + return image(Image!); + } + else if (IsToolUse && toolUse != null) + { + return toolUse(ToolUse!); + } + else if (IsToolResult && toolResult != null) + { + return toolResult(ToolResult!); + } + else if (IsDocument && document != null) + { + return document(Document!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolUse = null, + global::System.Action? toolResult = null, + global::System.Action? document = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolUse) + { + toolUse?.Invoke(ToolUse!); + } + else if (IsToolResult) + { + toolResult?.Invoke(ToolResult!); + } + else if (IsDocument) + { + document?.Invoke(Document!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Text, + typeof(global::Anthropic.RequestTextBlock), + Image, + typeof(global::Anthropic.RequestImageBlock), + ToolUse, + typeof(global::Anthropic.RequestToolUseBlock), + ToolResult, + typeof(global::Anthropic.RequestToolResultBlock), + Document, + typeof(global::Anthropic.RequestDocumentBlock), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(InputContentBlock other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ToolUse, other.ToolUse) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ToolResult, other.ToolResult) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Document, other.Document) + ; + } + + /// + /// + /// + public static bool operator ==(InputContentBlock obj1, InputContentBlock obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(InputContentBlock obj1, InputContentBlock obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is InputContentBlock o && Equals(o); + } + } +} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminator.Json.g.cs new file mode 100644 index 0000000..4fdc5a1 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class InputContentBlockDiscriminator + { + /// + /// 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.InputContentBlockDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.InputContentBlockDiscriminator), + jsonSerializerContext) as global::Anthropic.InputContentBlockDiscriminator; + } + + /// + /// 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.InputContentBlockDiscriminator? 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.InputContentBlockDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.InputContentBlockDiscriminator; + } + + /// + /// 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.ContentBlockDeltaEventDeltaDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminator.g.cs similarity index 57% rename from src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEventDeltaDiscriminator.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminator.g.cs index 5d52f42..1e3aabe 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentBlockDeltaEventDeltaDiscriminator.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Anthropic /// /// /// - public sealed partial class ContentBlockDeltaEventDeltaDiscriminator + public sealed partial class InputContentBlockDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter))] - public global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.InputContentBlockDiscriminatorTypeJsonConverter))] + public global::Anthropic.InputContentBlockDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,20 +22,20 @@ public sealed partial class ContentBlockDeltaEventDeltaDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public ContentBlockDeltaEventDeltaDiscriminator( - global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType? type) + public InputContentBlockDiscriminator( + global::Anthropic.InputContentBlockDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ContentBlockDeltaEventDeltaDiscriminator() + public InputContentBlockDiscriminator() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminatorType.g.cs new file mode 100644 index 0000000..a5969fe --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.InputContentBlockDiscriminatorType.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public enum InputContentBlockDiscriminatorType + { + /// + /// + /// + Document, + /// + /// + /// + Image, + /// + /// + /// + Text, + /// + /// + /// + ToolResult, + /// + /// + /// + ToolUse, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class InputContentBlockDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this InputContentBlockDiscriminatorType value) + { + return value switch + { + InputContentBlockDiscriminatorType.Document => "document", + InputContentBlockDiscriminatorType.Image => "image", + InputContentBlockDiscriminatorType.Text => "text", + InputContentBlockDiscriminatorType.ToolResult => "tool_result", + InputContentBlockDiscriminatorType.ToolUse => "tool_use", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static InputContentBlockDiscriminatorType? ToEnum(string value) + { + return value switch + { + "document" => InputContentBlockDiscriminatorType.Document, + "image" => InputContentBlockDiscriminatorType.Image, + "text" => InputContentBlockDiscriminatorType.Text, + "tool_result" => InputContentBlockDiscriminatorType.ToolResult, + "tool_use" => InputContentBlockDiscriminatorType.ToolUse, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.InputMessage.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputMessage.g.cs index f0278ed..a91e69d 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.InputMessage.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.InputMessage.g.cs @@ -22,9 +22,9 @@ public sealed partial class InputMessage /// /// [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.AnyOf> Content { get; set; } + public required global::Anthropic.AnyOf> Content { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -40,7 +40,7 @@ public sealed partial class InputMessage [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public InputMessage( global::Anthropic.InputMessageRole role, - global::Anthropic.AnyOf> content) + global::Anthropic.AnyOf> content) { this.Role = role; this.Content = content; diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.InputMessageContentVariant2ItemDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputMessageContentVariant2ItemDiscriminator.Json.g.cs deleted file mode 100644 index 0ba7670..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.InputMessageContentVariant2ItemDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class InputMessageContentVariant2ItemDiscriminator - { - /// - /// 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.InputMessageContentVariant2ItemDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.InputMessageContentVariant2ItemDiscriminator), - jsonSerializerContext) as global::Anthropic.InputMessageContentVariant2ItemDiscriminator; - } - - /// - /// 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.InputMessageContentVariant2ItemDiscriminator? 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.InputMessageContentVariant2ItemDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.InputMessageContentVariant2ItemDiscriminator; - } - - /// - /// 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.InputMessageContentVariant2ItemDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputMessageContentVariant2ItemDiscriminator.g.cs deleted file mode 100644 index 74facfe..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.InputMessageContentVariant2ItemDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class InputMessageContentVariant2ItemDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.InputMessageContentVariant2ItemDiscriminatorTypeJsonConverter))] - public global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType? Type { get; set; } - - /// - /// 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 InputMessageContentVariant2ItemDiscriminator( - global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public InputMessageContentVariant2ItemDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.InputMessageContentVariant2ItemDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.InputMessageContentVariant2ItemDiscriminatorType.g.cs deleted file mode 100644 index 9713636..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.InputMessageContentVariant2ItemDiscriminatorType.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum InputMessageContentVariant2ItemDiscriminatorType - { - /// - /// - /// - Image, - /// - /// - /// - Text, - /// - /// - /// - ToolResult, - /// - /// - /// - ToolUse, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class InputMessageContentVariant2ItemDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this InputMessageContentVariant2ItemDiscriminatorType value) - { - return value switch - { - InputMessageContentVariant2ItemDiscriminatorType.Image => "image", - InputMessageContentVariant2ItemDiscriminatorType.Text => "text", - InputMessageContentVariant2ItemDiscriminatorType.ToolResult => "tool_result", - InputMessageContentVariant2ItemDiscriminatorType.ToolUse => "tool_use", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static InputMessageContentVariant2ItemDiscriminatorType? ToEnum(string value) - { - return value switch - { - "image" => InputMessageContentVariant2ItemDiscriminatorType.Image, - "text" => InputMessageContentVariant2ItemDiscriminatorType.Text, - "tool_result" => InputMessageContentVariant2ItemDiscriminatorType.ToolResult, - "tool_use" => InputMessageContentVariant2ItemDiscriminatorType.ToolUse, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseMessageBatch.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseMessageBatch.Json.g.cs new file mode 100644 index 0000000..e9c5613 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseMessageBatch.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class ListResponseMessageBatch + { + /// + /// 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.ListResponseMessageBatch? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.ListResponseMessageBatch), + jsonSerializerContext) as global::Anthropic.ListResponseMessageBatch; + } + + /// + /// 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.ListResponseMessageBatch? 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.ListResponseMessageBatch), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ListResponseMessageBatch; + } + + /// + /// 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.ListResponseMessageBatch.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseMessageBatch.g.cs new file mode 100644 index 0000000..7119f34 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseMessageBatch.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class ListResponseMessageBatch + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Indicates if there are more results in the requested page direction. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("has_more")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool HasMore { get; set; } + + /// + /// First ID in the `data` list. Can be used as the `before_id` for the previous page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("first_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string? FirstId { get; set; } + + /// + /// Last ID in the `data` list. Can be used as the `after_id` for the next page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string? LastId { get; set; } + + /// + /// 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. + /// + /// + /// + /// Indicates if there are more results in the requested page direction. + /// + /// + /// First ID in the `data` list. Can be used as the `before_id` for the previous page. + /// + /// + /// Last ID in the `data` list. Can be used as the `after_id` for the next page. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ListResponseMessageBatch( + global::System.Collections.Generic.IList data, + bool hasMore, + string? firstId, + string? lastId) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.HasMore = hasMore; + this.FirstId = firstId ?? throw new global::System.ArgumentNullException(nameof(firstId)); + this.LastId = lastId ?? throw new global::System.ArgumentNullException(nameof(lastId)); + } + + /// + /// Initializes a new instance of the class. + /// + public ListResponseMessageBatch() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseModelResponse.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseModelResponse.Json.g.cs new file mode 100644 index 0000000..fb91c14 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseModelResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class ListResponseModelResponse + { + /// + /// 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.ListResponseModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.ListResponseModelResponse), + jsonSerializerContext) as global::Anthropic.ListResponseModelResponse; + } + + /// + /// 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.ListResponseModelResponse? 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.ListResponseModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ListResponseModelResponse; + } + + /// + /// 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.ListResponseModelResponse.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseModelResponse.g.cs new file mode 100644 index 0000000..57ca8f0 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ListResponseModelResponse.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class ListResponseModelResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Indicates if there are more results in the requested page direction. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("has_more")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool HasMore { get; set; } + + /// + /// First ID in the `data` list. Can be used as the `before_id` for the previous page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("first_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string? FirstId { get; set; } + + /// + /// Last ID in the `data` list. Can be used as the `after_id` for the next page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string? LastId { get; set; } + + /// + /// 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. + /// + /// + /// + /// Indicates if there are more results in the requested page direction. + /// + /// + /// First ID in the `data` list. Can be used as the `before_id` for the previous page. + /// + /// + /// Last ID in the `data` list. Can be used as the `after_id` for the next page. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ListResponseModelResponse( + global::System.Collections.Generic.IList data, + bool hasMore, + string? firstId, + string? lastId) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.HasMore = hasMore; + this.FirstId = firstId ?? throw new global::System.ArgumentNullException(nameof(firstId)); + this.LastId = lastId ?? throw new global::System.ArgumentNullException(nameof(lastId)); + } + + /// + /// Initializes a new instance of the class. + /// + public ListResponseModelResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatch.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatch.Json.g.cs new file mode 100644 index 0000000..4aa2bf6 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatch.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class MessageBatch + { + /// + /// 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.MessageBatch? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.MessageBatch), + jsonSerializerContext) as global::Anthropic.MessageBatch; + } + + /// + /// 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.MessageBatch? 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.MessageBatch), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.MessageBatch; + } + + /// + /// 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.MessageBatch.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatch.g.cs new file mode 100644 index 0000000..a5b06a8 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatch.g.cs @@ -0,0 +1,172 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class MessageBatch + { + /// + /// Unique object identifier.
+ /// The format and length of IDs may change over time.
+ /// Example: msgbatch_013Zva2CMHLNnXjNJJKqJ2EF + ///
+ /// msgbatch_013Zva2CMHLNnXjNJJKqJ2EF + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Object type.
+ /// For Message Batches, this is always `"message_batch"`.
+ /// Default Value: message_batch + ///
+ /// global::Anthropic.MessageBatchType.MessageBatch + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.MessageBatchTypeJsonConverter))] + public global::Anthropic.MessageBatchType Type { get; set; } = global::Anthropic.MessageBatchType.MessageBatch; + + /// + /// Processing status of the Message Batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("processing_status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.MessageBatchProcessingStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Anthropic.MessageBatchProcessingStatus ProcessingStatus { get; set; } + + /// + /// Tallies requests within the Message Batch, categorized by their status.
+ /// Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("request_counts")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Anthropic.RequestCounts RequestCounts { get; set; } + + /// + /// RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+ /// Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("ended_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime? EndedAt { get; set; } + + /// + /// RFC 3339 datetime string representing the time at which the Message Batch was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("expires_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime ExpiresAt { get; set; } + + /// + /// RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("archived_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime? ArchivedAt { get; set; } + + /// + /// RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cancel_initiated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime? CancelInitiatedAt { get; set; } + + /// + /// URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+ /// Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+ /// Example: https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results + ///
+ /// https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results + [global::System.Text.Json.Serialization.JsonPropertyName("results_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string? ResultsUrl { get; set; } + + /// + /// 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. + /// + /// + /// Unique object identifier.
+ /// The format and length of IDs may change over time.
+ /// Example: msgbatch_013Zva2CMHLNnXjNJJKqJ2EF + /// + /// + /// Object type.
+ /// For Message Batches, this is always `"message_batch"`.
+ /// Default Value: message_batch + /// + /// + /// Processing status of the Message Batch. + /// + /// + /// Tallies requests within the Message Batch, categorized by their status.
+ /// Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch. + /// + /// + /// RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+ /// Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired. + /// + /// + /// RFC 3339 datetime string representing the time at which the Message Batch was created. + /// + /// + /// RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation. + /// + /// + /// RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable. + /// + /// + /// RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated. + /// + /// + /// URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+ /// Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+ /// Example: https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public MessageBatch( + string id, + global::Anthropic.MessageBatchProcessingStatus processingStatus, + global::Anthropic.RequestCounts requestCounts, + global::System.DateTime? endedAt, + global::System.DateTime createdAt, + global::System.DateTime expiresAt, + global::System.DateTime? archivedAt, + global::System.DateTime? cancelInitiatedAt, + string? resultsUrl, + global::Anthropic.MessageBatchType type = global::Anthropic.MessageBatchType.MessageBatch) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ProcessingStatus = processingStatus; + this.RequestCounts = requestCounts ?? throw new global::System.ArgumentNullException(nameof(requestCounts)); + this.EndedAt = endedAt; + this.CreatedAt = createdAt; + this.ExpiresAt = expiresAt; + this.ArchivedAt = archivedAt; + this.CancelInitiatedAt = cancelInitiatedAt; + this.ResultsUrl = resultsUrl ?? throw new global::System.ArgumentNullException(nameof(resultsUrl)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public MessageBatch() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEvent.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualRequestParams.Json.g.cs similarity index 84% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEvent.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualRequestParams.Json.g.cs index 81bbcc0..ee85b5a 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEvent.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualRequestParams.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public readonly partial struct PromptCachingBetaMessageStreamEvent + public sealed partial class MessageBatchIndividualRequestParams { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.PromptCachingBetaMessageStreamEvent? FromJson( + public static global::Anthropic.MessageBatchIndividualRequestParams? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.PromptCachingBetaMessageStreamEvent), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaMessageStreamEvent?; + typeof(global::Anthropic.MessageBatchIndividualRequestParams), + jsonSerializerContext) as global::Anthropic.MessageBatchIndividualRequestParams; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.PromptCachingBetaMessageStreamEvent? FromJson( + public static global::Anthropic.MessageBatchIndividualRequestParams? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.PromptCachingBetaMessageStreamEvent), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaMessageStreamEvent?; + typeof(global::Anthropic.MessageBatchIndividualRequestParams), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.MessageBatchIndividualRequestParams; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualRequestParams.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualRequestParams.g.cs new file mode 100644 index 0000000..94db127 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualRequestParams.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class MessageBatchIndividualRequestParams + { + /// + /// Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+ /// Must be unique for each request within the Message Batch.
+ /// Example: my-custom-id-1 + ///
+ /// my-custom-id-1 + [global::System.Text.Json.Serialization.JsonPropertyName("custom_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CustomId { get; set; } + + /// + /// Messages API creation parameters for the individual request.
+ /// See the [Messages API reference](/en/api/messages) for full documentation on available parameters. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("params")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Anthropic.CreateMessageParams Params { get; set; } + + /// + /// 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. + /// + /// + /// Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+ /// Must be unique for each request within the Message Batch.
+ /// Example: my-custom-id-1 + /// + /// + /// Messages API creation parameters for the individual request.
+ /// See the [Messages API reference](/en/api/messages) for full documentation on available parameters. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public MessageBatchIndividualRequestParams( + string customId, + global::Anthropic.CreateMessageParams @params) + { + this.CustomId = customId ?? throw new global::System.ArgumentNullException(nameof(customId)); + this.Params = @params ?? throw new global::System.ArgumentNullException(nameof(@params)); + } + + /// + /// Initializes a new instance of the class. + /// + public MessageBatchIndividualRequestParams() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponse.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponse.Json.g.cs new file mode 100644 index 0000000..f7caa5d --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class MessageBatchIndividualResponse + { + /// + /// 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.MessageBatchIndividualResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.MessageBatchIndividualResponse), + jsonSerializerContext) as global::Anthropic.MessageBatchIndividualResponse; + } + + /// + /// 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.MessageBatchIndividualResponse? 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.MessageBatchIndividualResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.MessageBatchIndividualResponse; + } + + /// + /// 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.MessageBatchIndividualResponse.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponse.g.cs new file mode 100644 index 0000000..10d40c7 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponse.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class MessageBatchIndividualResponse + { + /// + /// Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+ /// Must be unique for each request within the Message Batch.
+ /// Example: my-custom-id-1 + ///
+ /// my-custom-id-1 + [global::System.Text.Json.Serialization.JsonPropertyName("custom_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CustomId { get; set; } + + /// + /// Processing result for this request.
+ /// Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("result")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.Result2JsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Anthropic.Result2 Result { get; set; } + + /// + /// 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. + /// + /// + /// Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+ /// Must be unique for each request within the Message Batch.
+ /// Example: my-custom-id-1 + /// + /// + /// Processing result for this request.
+ /// Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public MessageBatchIndividualResponse( + string customId, + global::Anthropic.Result2 result) + { + this.CustomId = customId ?? throw new global::System.ArgumentNullException(nameof(customId)); + this.Result = result; + } + + /// + /// Initializes a new instance of the class. + /// + public MessageBatchIndividualResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponseResultDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponseResultDiscriminator.Json.g.cs new file mode 100644 index 0000000..ab621bc --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponseResultDiscriminator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class MessageBatchIndividualResponseResultDiscriminator + { + /// + /// 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.MessageBatchIndividualResponseResultDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.MessageBatchIndividualResponseResultDiscriminator), + jsonSerializerContext) as global::Anthropic.MessageBatchIndividualResponseResultDiscriminator; + } + + /// + /// 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.MessageBatchIndividualResponseResultDiscriminator? 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.MessageBatchIndividualResponseResultDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.MessageBatchIndividualResponseResultDiscriminator; + } + + /// + /// 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.MessageBatchIndividualResponseResultDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponseResultDiscriminator.g.cs new file mode 100644 index 0000000..ab199e3 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponseResultDiscriminator.g.cs @@ -0,0 +1,42 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class MessageBatchIndividualResponseResultDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.MessageBatchIndividualResponseResultDiscriminatorTypeJsonConverter))] + public global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType? Type { get; set; } + + /// + /// 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 MessageBatchIndividualResponseResultDiscriminator( + global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public MessageBatchIndividualResponseResultDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponseResultDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponseResultDiscriminatorType.g.cs new file mode 100644 index 0000000..0e1c17a --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchIndividualResponseResultDiscriminatorType.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public enum MessageBatchIndividualResponseResultDiscriminatorType + { + /// + /// + /// + Canceled, + /// + /// + /// + Errored, + /// + /// + /// + Expired, + /// + /// + /// + Succeeded, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class MessageBatchIndividualResponseResultDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this MessageBatchIndividualResponseResultDiscriminatorType value) + { + return value switch + { + MessageBatchIndividualResponseResultDiscriminatorType.Canceled => "canceled", + MessageBatchIndividualResponseResultDiscriminatorType.Errored => "errored", + MessageBatchIndividualResponseResultDiscriminatorType.Expired => "expired", + MessageBatchIndividualResponseResultDiscriminatorType.Succeeded => "succeeded", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static MessageBatchIndividualResponseResultDiscriminatorType? ToEnum(string value) + { + return value switch + { + "canceled" => MessageBatchIndividualResponseResultDiscriminatorType.Canceled, + "errored" => MessageBatchIndividualResponseResultDiscriminatorType.Errored, + "expired" => MessageBatchIndividualResponseResultDiscriminatorType.Expired, + "succeeded" => MessageBatchIndividualResponseResultDiscriminatorType.Succeeded, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchProcessingStatus.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchProcessingStatus.g.cs new file mode 100644 index 0000000..4d2d297 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchProcessingStatus.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Processing status of the Message Batch. + /// + public enum MessageBatchProcessingStatus + { + /// + /// + /// + InProgress, + /// + /// + /// + Canceling, + /// + /// + /// + Ended, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class MessageBatchProcessingStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this MessageBatchProcessingStatus value) + { + return value switch + { + MessageBatchProcessingStatus.InProgress => "in_progress", + MessageBatchProcessingStatus.Canceling => "canceling", + MessageBatchProcessingStatus.Ended => "ended", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static MessageBatchProcessingStatus? ToEnum(string value) + { + return value switch + { + "in_progress" => MessageBatchProcessingStatus.InProgress, + "canceling" => MessageBatchProcessingStatus.Canceling, + "ended" => MessageBatchProcessingStatus.Ended, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchType.g.cs new file mode 100644 index 0000000..124e331 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageBatchType.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Object type.
+ /// For Message Batches, this is always `"message_batch"`.
+ /// Default Value: message_batch + ///
+ public enum MessageBatchType + { + /// + /// + /// + MessageBatch, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class MessageBatchTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this MessageBatchType value) + { + return value switch + { + MessageBatchType.MessageBatch => "message_batch", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static MessageBatchType? ToEnum(string value) + { + return value switch + { + "message_batch" => MessageBatchType.MessageBatch, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ModelEnum.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ModelEnum.g.cs index a751d82..09a75c5 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ModelEnum.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ModelEnum.g.cs @@ -15,7 +15,7 @@ public enum ModelEnum /// /// Fast and cost-effective model /// - Claude3Haiku20241022, + Claude35Haiku20241022, /// /// Our most intelligent model /// @@ -52,10 +52,6 @@ public enum ModelEnum /// ///
Claude20, - /// - /// - /// - ClaudeInstant12, } /// @@ -71,7 +67,7 @@ public static string ToValueString(this ModelEnum value) return value switch { ModelEnum.Claude35HaikuLatest => "claude-3-5-haiku-latest", - ModelEnum.Claude3Haiku20241022 => "claude-3-haiku-20241022", + ModelEnum.Claude35Haiku20241022 => "claude-3-5-haiku-20241022", ModelEnum.Claude35SonnetLatest => "claude-3-5-sonnet-latest", ModelEnum.Claude35Sonnet20241022 => "claude-3-5-sonnet-20241022", ModelEnum.Claude35Sonnet20240620 => "claude-3-5-sonnet-20240620", @@ -81,7 +77,6 @@ public static string ToValueString(this ModelEnum value) ModelEnum.Claude3Haiku20240307 => "claude-3-haiku-20240307", ModelEnum.Claude21 => "claude-2.1", ModelEnum.Claude20 => "claude-2.0", - ModelEnum.ClaudeInstant12 => "claude-instant-1.2", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -93,7 +88,7 @@ public static string ToValueString(this ModelEnum value) return value switch { "claude-3-5-haiku-latest" => ModelEnum.Claude35HaikuLatest, - "claude-3-haiku-20241022" => ModelEnum.Claude3Haiku20241022, + "claude-3-5-haiku-20241022" => ModelEnum.Claude35Haiku20241022, "claude-3-5-sonnet-latest" => ModelEnum.Claude35SonnetLatest, "claude-3-5-sonnet-20241022" => ModelEnum.Claude35Sonnet20241022, "claude-3-5-sonnet-20240620" => ModelEnum.Claude35Sonnet20240620, @@ -103,7 +98,6 @@ public static string ToValueString(this ModelEnum value) "claude-3-haiku-20240307" => ModelEnum.Claude3Haiku20240307, "claude-2.1" => ModelEnum.Claude21, "claude-2.0" => ModelEnum.Claude20, - "claude-instant-1.2" => ModelEnum.ClaudeInstant12, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ModelResponse.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ModelResponse.Json.g.cs new file mode 100644 index 0000000..dddc57e --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ModelResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class ModelResponse + { + /// + /// 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.ModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.ModelResponse), + jsonSerializerContext) as global::Anthropic.ModelResponse; + } + + /// + /// 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.ModelResponse? 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.ModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ModelResponse; + } + + /// + /// 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.ModelResponse.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ModelResponse.g.cs new file mode 100644 index 0000000..69ef312 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ModelResponse.g.cs @@ -0,0 +1,91 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class ModelResponse + { + /// + /// Object type.
+ /// For Models, this is always `"model"`.
+ /// Default Value: model + ///
+ /// global::Anthropic.ModelResponseType.Model + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ModelResponseTypeJsonConverter))] + public global::Anthropic.ModelResponseType Type { get; set; } = global::Anthropic.ModelResponseType.Model; + + /// + /// Unique model identifier.
+ /// Example: claude-3-5-sonnet-20241022 + ///
+ /// claude-3-5-sonnet-20241022 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// A human-readable name for the model.
+ /// Example: Claude 3.5 Sonnet (New) + ///
+ /// Claude 3.5 Sonnet (New) + [global::System.Text.Json.Serialization.JsonPropertyName("display_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DisplayName { get; set; } + + /// + /// RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// 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. + /// + /// + /// Object type.
+ /// For Models, this is always `"model"`.
+ /// Default Value: model + /// + /// + /// Unique model identifier.
+ /// Example: claude-3-5-sonnet-20241022 + /// + /// + /// A human-readable name for the model.
+ /// Example: Claude 3.5 Sonnet (New) + /// + /// + /// RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ModelResponse( + string id, + string displayName, + global::System.DateTime createdAt, + global::Anthropic.ModelResponseType type = global::Anthropic.ModelResponseType.Model) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.DisplayName = displayName ?? throw new global::System.ArgumentNullException(nameof(displayName)); + this.CreatedAt = createdAt; + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ModelResponseType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ModelResponseType.g.cs new file mode 100644 index 0000000..a9521da --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ModelResponseType.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Object type.
+ /// For Models, this is always `"model"`.
+ /// Default Value: model + ///
+ public enum ModelResponseType + { + /// + /// + /// + Model, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ModelResponseTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ModelResponseType value) + { + return value switch + { + ModelResponseType.Model => "model", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ModelResponseType? ToEnum(string value) + { + return value switch + { + "model" => ModelResponseType.Model, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessage.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessage.g.cs deleted file mode 100644 index 29957c6..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessage.g.cs +++ /dev/null @@ -1,56 +0,0 @@ - -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaInputMessage - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaInputMessageRoleJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.PromptCachingBetaInputMessageRole Role { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.AnyOf> Content { get; set; } - - /// - /// 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 PromptCachingBetaInputMessage( - global::Anthropic.PromptCachingBetaInputMessageRole role, - global::Anthropic.AnyOf> content) - { - this.Role = role; - this.Content = content; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaInputMessage() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator.Json.g.cs deleted file mode 100644 index 2a3d37f..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaInputMessageContentVariant2ItemDiscriminator - { - /// - /// 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.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator; - } - - /// - /// 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.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator? 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.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator; - } - - /// - /// 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.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator.g.cs deleted file mode 100644 index 848ef36..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaInputMessageContentVariant2ItemDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaInputMessageContentVariant2ItemDiscriminator( - global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaInputMessageContentVariant2ItemDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.g.cs deleted file mode 100644 index acc0912..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType - { - /// - /// - /// - Image, - /// - /// - /// - Text, - /// - /// - /// - ToolResult, - /// - /// - /// - ToolUse, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType value) - { - return value switch - { - PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.Image => "image", - PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.Text => "text", - PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.ToolResult => "tool_result", - PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.ToolUse => "tool_use", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType? ToEnum(string value) - { - return value switch - { - "image" => PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.Image, - "text" => PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.Text, - "tool_result" => PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.ToolResult, - "tool_use" => PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.ToolUse, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageRole.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageRole.g.cs deleted file mode 100644 index 920457a..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessageRole.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaInputMessageRole - { - /// - /// - /// - User, - /// - /// - /// - Assistant, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaInputMessageRoleExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaInputMessageRole value) - { - return value switch - { - PromptCachingBetaInputMessageRole.User => "user", - PromptCachingBetaInputMessageRole.Assistant => "assistant", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaInputMessageRole? ToEnum(string value) - { - return value switch - { - "user" => PromptCachingBetaInputMessageRole.User, - "assistant" => PromptCachingBetaInputMessageRole.Assistant, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessage.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessage.g.cs deleted file mode 100644 index a92f631..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessage.g.cs +++ /dev/null @@ -1,202 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaMessage - { - /// - /// Unique object identifier.
- /// The format and length of IDs may change over time.
- /// Example: msg_013Zva2CMHLNnXjNJJKqJ2EF - ///
- /// msg_013Zva2CMHLNnXjNJJKqJ2EF - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// Object type.
- /// For Messages, this is always `"message"`.
- /// Default Value: message - ///
- /// global::Anthropic.PromptCachingBetaMessageType.Message - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaMessageType Type { get; set; } = global::Anthropic.PromptCachingBetaMessageType.Message; - - /// - /// Conversational role of the generated message.
- /// This will always be `"assistant"`.
- /// Default Value: assistant - ///
- /// global::Anthropic.PromptCachingBetaMessageRole.Assistant - [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageRoleJsonConverter))] - public global::Anthropic.PromptCachingBetaMessageRole Role { get; set; } = global::Anthropic.PromptCachingBetaMessageRole.Assistant; - - /// - /// Content generated by the model.
- /// This is an array of content blocks, each of which has a `type` that determines its shape.
- /// Example:
- /// ```json
- /// [{"type": "text", "text": "Hi, I'm Claude."}]
- /// ```
- /// If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
- /// For example, if the input `messages` were:
- /// ```json
- /// [
- /// {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
- /// {"role": "assistant", "content": "The best answer is ("}
- /// ]
- /// ```
- /// Then the response `content` might be:
- /// ```json
- /// [{"type": "text", "text": "B)"}]
- /// ```
- /// Example: [] - ///
- /// [] - [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Content { get; set; } - - /// - /// The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ModelJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.Model Model { get; set; } - - /// - /// The reason that we stopped.
- /// This may be one the following values:
- /// * `"end_turn"`: the model reached a natural stopping point
- /// * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
- /// * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
- /// * `"tool_use"`: the model invoked one or more tools
- /// In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("stop_reason")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStopReasonJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.PromptCachingBetaMessageStopReason? StopReason { get; set; } - - /// - /// Which custom stop sequence was generated, if any.
- /// This value will be a non-null string if one of your custom stop sequences was generated. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("stop_sequence")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string? StopSequence { get; set; } - - /// - /// Billing and rate-limit usage.
- /// Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
- /// Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
- /// For example, `output_tokens` will be non-zero, even for an empty string response from Claude. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("usage")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.PromptCachingBetaUsage Usage { get; set; } - - /// - /// 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. - /// - /// - /// Unique object identifier.
- /// The format and length of IDs may change over time.
- /// Example: msg_013Zva2CMHLNnXjNJJKqJ2EF - /// - /// - /// Object type.
- /// For Messages, this is always `"message"`.
- /// Default Value: message - /// - /// - /// Conversational role of the generated message.
- /// This will always be `"assistant"`.
- /// Default Value: assistant - /// - /// - /// Content generated by the model.
- /// This is an array of content blocks, each of which has a `type` that determines its shape.
- /// Example:
- /// ```json
- /// [{"type": "text", "text": "Hi, I'm Claude."}]
- /// ```
- /// If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
- /// For example, if the input `messages` were:
- /// ```json
- /// [
- /// {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
- /// {"role": "assistant", "content": "The best answer is ("}
- /// ]
- /// ```
- /// Then the response `content` might be:
- /// ```json
- /// [{"type": "text", "text": "B)"}]
- /// ```
- /// Example: [] - /// - /// - /// The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. - /// - /// - /// The reason that we stopped.
- /// This may be one the following values:
- /// * `"end_turn"`: the model reached a natural stopping point
- /// * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
- /// * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
- /// * `"tool_use"`: the model invoked one or more tools
- /// In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise. - /// - /// - /// Which custom stop sequence was generated, if any.
- /// This value will be a non-null string if one of your custom stop sequences was generated. - /// - /// - /// Billing and rate-limit usage.
- /// Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
- /// Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
- /// For example, `output_tokens` will be non-zero, even for an empty string response from Claude. - /// - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PromptCachingBetaMessage( - string id, - global::System.Collections.Generic.IList content, - global::Anthropic.Model model, - global::Anthropic.PromptCachingBetaMessageStopReason? stopReason, - string? stopSequence, - global::Anthropic.PromptCachingBetaUsage usage, - global::Anthropic.PromptCachingBetaMessageType type = global::Anthropic.PromptCachingBetaMessageType.Message, - global::Anthropic.PromptCachingBetaMessageRole role = global::Anthropic.PromptCachingBetaMessageRole.Assistant) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); - this.Model = model; - this.StopReason = stopReason; - this.StopSequence = stopSequence ?? throw new global::System.ArgumentNullException(nameof(stopSequence)); - this.Usage = usage ?? throw new global::System.ArgumentNullException(nameof(usage)); - this.Type = type; - this.Role = role; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaMessage() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageRole.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageRole.g.cs deleted file mode 100644 index c8c4a0a..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageRole.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// Conversational role of the generated message.
- /// This will always be `"assistant"`.
- /// Default Value: assistant - ///
- public enum PromptCachingBetaMessageRole - { - /// - /// - /// - Assistant, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaMessageRoleExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaMessageRole value) - { - return value switch - { - PromptCachingBetaMessageRole.Assistant => "assistant", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaMessageRole? ToEnum(string value) - { - return value switch - { - "assistant" => PromptCachingBetaMessageRole.Assistant, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStartEvent.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStartEvent.Json.g.cs deleted file mode 100644 index 779fbc8..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStartEvent.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaMessageStartEvent - { - /// - /// 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.PromptCachingBetaMessageStartEvent? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaMessageStartEvent), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaMessageStartEvent; - } - - /// - /// 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.PromptCachingBetaMessageStartEvent? 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.PromptCachingBetaMessageStartEvent), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaMessageStartEvent; - } - - /// - /// 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.PromptCachingBetaMessageStartEventType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStartEventType.g.cs deleted file mode 100644 index eaf5911..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStartEventType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// Default Value: message_start - /// - public enum PromptCachingBetaMessageStartEventType - { - /// - /// - /// - MessageStart, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaMessageStartEventTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaMessageStartEventType value) - { - return value switch - { - PromptCachingBetaMessageStartEventType.MessageStart => "message_start", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaMessageStartEventType? ToEnum(string value) - { - return value switch - { - "message_start" => PromptCachingBetaMessageStartEventType.MessageStart, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStopReason.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStopReason.g.cs deleted file mode 100644 index 91070ef..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStopReason.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// The reason that we stopped.
- /// This may be one the following values:
- /// * `"end_turn"`: the model reached a natural stopping point
- /// * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
- /// * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
- /// * `"tool_use"`: the model invoked one or more tools
- /// In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise. - ///
- public enum PromptCachingBetaMessageStopReason - { - /// - /// the model reached a natural stopping point - /// - EndTurn, - /// - /// we exceeded the requested `max_tokens` or the model's maximum - /// - MaxTokens, - /// - /// one of your provided custom `stop_sequences` was generated - /// - StopSequence, - /// - /// the model invoked one or more tools - /// - ToolUse, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaMessageStopReasonExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaMessageStopReason value) - { - return value switch - { - PromptCachingBetaMessageStopReason.EndTurn => "end_turn", - PromptCachingBetaMessageStopReason.MaxTokens => "max_tokens", - PromptCachingBetaMessageStopReason.StopSequence => "stop_sequence", - PromptCachingBetaMessageStopReason.ToolUse => "tool_use", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaMessageStopReason? ToEnum(string value) - { - return value switch - { - "end_turn" => PromptCachingBetaMessageStopReason.EndTurn, - "max_tokens" => PromptCachingBetaMessageStopReason.MaxTokens, - "stop_sequence" => PromptCachingBetaMessageStopReason.StopSequence, - "tool_use" => PromptCachingBetaMessageStopReason.ToolUse, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEvent.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEvent.g.cs deleted file mode 100644 index dc6c1ef..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEvent.g.cs +++ /dev/null @@ -1,426 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public readonly partial struct PromptCachingBetaMessageStreamEvent : global::System.IEquatable - { - /// - /// - /// - public global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType? Type { get; } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.PromptCachingBetaMessageStartEvent? MessageStart { get; init; } -#else - public global::Anthropic.PromptCachingBetaMessageStartEvent? MessageStart { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(MessageStart))] -#endif - public bool IsMessageStart => MessageStart != null; - - /// - /// - /// - public static implicit operator PromptCachingBetaMessageStreamEvent(global::Anthropic.PromptCachingBetaMessageStartEvent value) => new PromptCachingBetaMessageStreamEvent(value); - - /// - /// - /// - public static implicit operator global::Anthropic.PromptCachingBetaMessageStartEvent?(PromptCachingBetaMessageStreamEvent @this) => @this.MessageStart; - - /// - /// - /// - public PromptCachingBetaMessageStreamEvent(global::Anthropic.PromptCachingBetaMessageStartEvent? value) - { - MessageStart = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.MessageDeltaEvent? MessageDelta { get; init; } -#else - public global::Anthropic.MessageDeltaEvent? MessageDelta { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(MessageDelta))] -#endif - public bool IsMessageDelta => MessageDelta != null; - - /// - /// - /// - public static implicit operator PromptCachingBetaMessageStreamEvent(global::Anthropic.MessageDeltaEvent value) => new PromptCachingBetaMessageStreamEvent(value); - - /// - /// - /// - public static implicit operator global::Anthropic.MessageDeltaEvent?(PromptCachingBetaMessageStreamEvent @this) => @this.MessageDelta; - - /// - /// - /// - public PromptCachingBetaMessageStreamEvent(global::Anthropic.MessageDeltaEvent? value) - { - MessageDelta = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.MessageStopEvent? MessageStop { get; init; } -#else - public global::Anthropic.MessageStopEvent? MessageStop { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(MessageStop))] -#endif - public bool IsMessageStop => MessageStop != null; - - /// - /// - /// - public static implicit operator PromptCachingBetaMessageStreamEvent(global::Anthropic.MessageStopEvent value) => new PromptCachingBetaMessageStreamEvent(value); - - /// - /// - /// - public static implicit operator global::Anthropic.MessageStopEvent?(PromptCachingBetaMessageStreamEvent @this) => @this.MessageStop; - - /// - /// - /// - public PromptCachingBetaMessageStreamEvent(global::Anthropic.MessageStopEvent? value) - { - MessageStop = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.ContentBlockStartEvent? ContentBlockStart { get; init; } -#else - public global::Anthropic.ContentBlockStartEvent? ContentBlockStart { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ContentBlockStart))] -#endif - public bool IsContentBlockStart => ContentBlockStart != null; - - /// - /// - /// - public static implicit operator PromptCachingBetaMessageStreamEvent(global::Anthropic.ContentBlockStartEvent value) => new PromptCachingBetaMessageStreamEvent(value); - - /// - /// - /// - public static implicit operator global::Anthropic.ContentBlockStartEvent?(PromptCachingBetaMessageStreamEvent @this) => @this.ContentBlockStart; - - /// - /// - /// - public PromptCachingBetaMessageStreamEvent(global::Anthropic.ContentBlockStartEvent? value) - { - ContentBlockStart = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.ContentBlockDeltaEvent? ContentBlockDelta { get; init; } -#else - public global::Anthropic.ContentBlockDeltaEvent? ContentBlockDelta { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ContentBlockDelta))] -#endif - public bool IsContentBlockDelta => ContentBlockDelta != null; - - /// - /// - /// - public static implicit operator PromptCachingBetaMessageStreamEvent(global::Anthropic.ContentBlockDeltaEvent value) => new PromptCachingBetaMessageStreamEvent(value); - - /// - /// - /// - public static implicit operator global::Anthropic.ContentBlockDeltaEvent?(PromptCachingBetaMessageStreamEvent @this) => @this.ContentBlockDelta; - - /// - /// - /// - public PromptCachingBetaMessageStreamEvent(global::Anthropic.ContentBlockDeltaEvent? value) - { - ContentBlockDelta = value; - } - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Anthropic.ContentBlockStopEvent? ContentBlockStop { get; init; } -#else - public global::Anthropic.ContentBlockStopEvent? ContentBlockStop { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ContentBlockStop))] -#endif - public bool IsContentBlockStop => ContentBlockStop != null; - - /// - /// - /// - public static implicit operator PromptCachingBetaMessageStreamEvent(global::Anthropic.ContentBlockStopEvent value) => new PromptCachingBetaMessageStreamEvent(value); - - /// - /// - /// - public static implicit operator global::Anthropic.ContentBlockStopEvent?(PromptCachingBetaMessageStreamEvent @this) => @this.ContentBlockStop; - - /// - /// - /// - public PromptCachingBetaMessageStreamEvent(global::Anthropic.ContentBlockStopEvent? value) - { - ContentBlockStop = value; - } - - /// - /// - /// - public PromptCachingBetaMessageStreamEvent( - global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType? type, - global::Anthropic.PromptCachingBetaMessageStartEvent? messageStart, - global::Anthropic.MessageDeltaEvent? messageDelta, - global::Anthropic.MessageStopEvent? messageStop, - global::Anthropic.ContentBlockStartEvent? contentBlockStart, - global::Anthropic.ContentBlockDeltaEvent? contentBlockDelta, - global::Anthropic.ContentBlockStopEvent? contentBlockStop - ) - { - Type = type; - - MessageStart = messageStart; - MessageDelta = messageDelta; - MessageStop = messageStop; - ContentBlockStart = contentBlockStart; - ContentBlockDelta = contentBlockDelta; - ContentBlockStop = contentBlockStop; - } - - /// - /// - /// - public object? Object => - ContentBlockStop as object ?? - ContentBlockDelta as object ?? - ContentBlockStart as object ?? - MessageStop as object ?? - MessageDelta as object ?? - MessageStart as object - ; - - /// - /// - /// - public bool Validate() - { - return IsMessageStart && !IsMessageDelta && !IsMessageStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop || !IsMessageStart && IsMessageDelta && !IsMessageStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop || !IsMessageStart && !IsMessageDelta && IsMessageStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop || !IsMessageStart && !IsMessageDelta && !IsMessageStop && IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop || !IsMessageStart && !IsMessageDelta && !IsMessageStop && !IsContentBlockStart && IsContentBlockDelta && !IsContentBlockStop || !IsMessageStart && !IsMessageDelta && !IsMessageStop && !IsContentBlockStart && !IsContentBlockDelta && IsContentBlockStop; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? messageStart = null, - global::System.Func? messageDelta = null, - global::System.Func? messageStop = null, - global::System.Func? contentBlockStart = null, - global::System.Func? contentBlockDelta = null, - global::System.Func? contentBlockStop = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsMessageStart && messageStart != null) - { - return messageStart(MessageStart!); - } - else if (IsMessageDelta && messageDelta != null) - { - return messageDelta(MessageDelta!); - } - else if (IsMessageStop && messageStop != null) - { - return messageStop(MessageStop!); - } - else if (IsContentBlockStart && contentBlockStart != null) - { - return contentBlockStart(ContentBlockStart!); - } - else if (IsContentBlockDelta && contentBlockDelta != null) - { - return contentBlockDelta(ContentBlockDelta!); - } - else if (IsContentBlockStop && contentBlockStop != null) - { - return contentBlockStop(ContentBlockStop!); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? messageStart = null, - global::System.Action? messageDelta = null, - global::System.Action? messageStop = null, - global::System.Action? contentBlockStart = null, - global::System.Action? contentBlockDelta = null, - global::System.Action? contentBlockStop = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsMessageStart) - { - messageStart?.Invoke(MessageStart!); - } - else if (IsMessageDelta) - { - messageDelta?.Invoke(MessageDelta!); - } - else if (IsMessageStop) - { - messageStop?.Invoke(MessageStop!); - } - else if (IsContentBlockStart) - { - contentBlockStart?.Invoke(ContentBlockStart!); - } - else if (IsContentBlockDelta) - { - contentBlockDelta?.Invoke(ContentBlockDelta!); - } - else if (IsContentBlockStop) - { - contentBlockStop?.Invoke(ContentBlockStop!); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - MessageStart, - typeof(global::Anthropic.PromptCachingBetaMessageStartEvent), - MessageDelta, - typeof(global::Anthropic.MessageDeltaEvent), - MessageStop, - typeof(global::Anthropic.MessageStopEvent), - ContentBlockStart, - typeof(global::Anthropic.ContentBlockStartEvent), - ContentBlockDelta, - typeof(global::Anthropic.ContentBlockDeltaEvent), - ContentBlockStop, - typeof(global::Anthropic.ContentBlockStopEvent), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(PromptCachingBetaMessageStreamEvent other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(MessageStart, other.MessageStart) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(MessageDelta, other.MessageDelta) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(MessageStop, other.MessageStop) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ContentBlockStart, other.ContentBlockStart) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ContentBlockDelta, other.ContentBlockDelta) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ContentBlockStop, other.ContentBlockStop) - ; - } - - /// - /// - /// - public static bool operator ==(PromptCachingBetaMessageStreamEvent obj1, PromptCachingBetaMessageStreamEvent obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(PromptCachingBetaMessageStreamEvent obj1, PromptCachingBetaMessageStreamEvent obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is PromptCachingBetaMessageStreamEvent o && Equals(o); - } - } -} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEventDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEventDiscriminator.Json.g.cs deleted file mode 100644 index 0d8725a..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEventDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaMessageStreamEventDiscriminator - { - /// - /// 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.PromptCachingBetaMessageStreamEventDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminator; - } - - /// - /// 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.PromptCachingBetaMessageStreamEventDiscriminator? 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.PromptCachingBetaMessageStreamEventDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminator; - } - - /// - /// 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.PromptCachingBetaMessageStreamEventDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEventDiscriminator.g.cs deleted file mode 100644 index 47e816a..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEventDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaMessageStreamEventDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaMessageStreamEventDiscriminator( - global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaMessageStreamEventDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEventDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEventDiscriminatorType.g.cs deleted file mode 100644 index 129d8aa..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStreamEventDiscriminatorType.g.cs +++ /dev/null @@ -1,75 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaMessageStreamEventDiscriminatorType - { - /// - /// - /// - ContentBlockDelta, - /// - /// - /// - ContentBlockStart, - /// - /// - /// - ContentBlockStop, - /// - /// - /// - MessageDelta, - /// - /// - /// - MessageStart, - /// - /// - /// - MessageStop, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaMessageStreamEventDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaMessageStreamEventDiscriminatorType value) - { - return value switch - { - PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockDelta => "content_block_delta", - PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockStart => "content_block_start", - PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockStop => "content_block_stop", - PromptCachingBetaMessageStreamEventDiscriminatorType.MessageDelta => "message_delta", - PromptCachingBetaMessageStreamEventDiscriminatorType.MessageStart => "message_start", - PromptCachingBetaMessageStreamEventDiscriminatorType.MessageStop => "message_stop", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaMessageStreamEventDiscriminatorType? ToEnum(string value) - { - return value switch - { - "content_block_delta" => PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockDelta, - "content_block_start" => PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockStart, - "content_block_stop" => PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockStop, - "message_delta" => PromptCachingBetaMessageStreamEventDiscriminatorType.MessageDelta, - "message_start" => PromptCachingBetaMessageStreamEventDiscriminatorType.MessageStart, - "message_stop" => PromptCachingBetaMessageStreamEventDiscriminatorType.MessageStop, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlock.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlock.Json.g.cs deleted file mode 100644 index efc9bbf..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlock.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaRequestImageBlock - { - /// - /// 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.PromptCachingBetaRequestImageBlock? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaRequestImageBlock), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestImageBlock; - } - - /// - /// 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.PromptCachingBetaRequestImageBlock? 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.PromptCachingBetaRequestImageBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestImageBlock; - } - - /// - /// 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.PromptCachingBetaRequestImageBlockCacheControlDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockCacheControlDiscriminator.Json.g.cs deleted file mode 100644 index 13b1362..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockCacheControlDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaRequestImageBlockCacheControlDiscriminator - { - /// - /// 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.PromptCachingBetaRequestImageBlockCacheControlDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestImageBlockCacheControlDiscriminator? 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.PromptCachingBetaRequestImageBlockCacheControlDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestImageBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockCacheControlDiscriminator.g.cs deleted file mode 100644 index 3cf3bed..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockCacheControlDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestImageBlockCacheControlDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaRequestImageBlockCacheControlDiscriminator( - global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaRequestImageBlockCacheControlDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType.g.cs deleted file mode 100644 index dd127c1..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType - { - /// - /// - /// - Ephemeral, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType value) - { - return value switch - { - PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType? ToEnum(string value) - { - return value switch - { - "ephemeral" => PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType.Ephemeral, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminator.g.cs deleted file mode 100644 index f385f2d..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestImageBlockSourceDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaRequestImageBlockSourceDiscriminator( - global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaRequestImageBlockSourceDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminatorType.g.cs deleted file mode 100644 index b18bf5c..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlockSourceDiscriminatorType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaRequestImageBlockSourceDiscriminatorType - { - /// - /// - /// - Base64, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaRequestImageBlockSourceDiscriminatorType value) - { - return value switch - { - PromptCachingBetaRequestImageBlockSourceDiscriminatorType.Base64 => "base64", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaRequestImageBlockSourceDiscriminatorType? ToEnum(string value) - { - return value switch - { - "base64" => PromptCachingBetaRequestImageBlockSourceDiscriminatorType.Base64, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlock.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlock.Json.g.cs deleted file mode 100644 index a61df7a..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlock.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaRequestTextBlock - { - /// - /// 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.PromptCachingBetaRequestTextBlock? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaRequestTextBlock), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestTextBlock; - } - - /// - /// 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.PromptCachingBetaRequestTextBlock? 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.PromptCachingBetaRequestTextBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestTextBlock; - } - - /// - /// 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.PromptCachingBetaRequestTextBlockCacheControlDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockCacheControlDiscriminator.Json.g.cs deleted file mode 100644 index 04e6ae6..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockCacheControlDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaRequestTextBlockCacheControlDiscriminator - { - /// - /// 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.PromptCachingBetaRequestTextBlockCacheControlDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestTextBlockCacheControlDiscriminator? 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.PromptCachingBetaRequestTextBlockCacheControlDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestTextBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockCacheControlDiscriminator.g.cs deleted file mode 100644 index 8d2450f..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockCacheControlDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestTextBlockCacheControlDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaRequestTextBlockCacheControlDiscriminator( - global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaRequestTextBlockCacheControlDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType.g.cs deleted file mode 100644 index e4180b8..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType - { - /// - /// - /// - Ephemeral, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType value) - { - return value switch - { - PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType? ToEnum(string value) - { - return value switch - { - "ephemeral" => PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType.Ephemeral, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlock.g.cs deleted file mode 100644 index 2dc74fb..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlock.g.cs +++ /dev/null @@ -1,82 +0,0 @@ - -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestToolResultBlock - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] - public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestToolResultBlockType Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("tool_use_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ToolUseId { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_error")] - public bool? IsError { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>))] - public global::Anthropic.AnyOf>? Content { get; set; } - - /// - /// 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 PromptCachingBetaRequestToolResultBlock( - string toolUseId, - global::Anthropic.CacheControlEphemeral? cacheControl, - global::Anthropic.PromptCachingBetaRequestToolResultBlockType type, - bool? isError, - global::Anthropic.AnyOf>? content) - { - this.ToolUseId = toolUseId ?? throw new global::System.ArgumentNullException(nameof(toolUseId)); - this.CacheControl = cacheControl; - this.Type = type; - this.IsError = isError; - this.Content = content; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaRequestToolResultBlock() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator.Json.g.cs deleted file mode 100644 index ee679b2..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator - { - /// - /// 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.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator? 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.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator.g.cs deleted file mode 100644 index 75bf69a..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator( - global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator.Json.g.cs deleted file mode 100644 index 68ee18e..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator - { - /// - /// 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.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator? 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.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator.g.cs deleted file mode 100644 index 19ca4e3..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator( - global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.g.cs deleted file mode 100644 index c18e48c..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType - { - /// - /// - /// - Image, - /// - /// - /// - Text, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType value) - { - return value switch - { - PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.Image => "image", - PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.Text => "text", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? ToEnum(string value) - { - return value switch - { - "image" => PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.Image, - "text" => PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.Text, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlock.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlock.Json.g.cs deleted file mode 100644 index 5af096d..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlock.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaRequestToolUseBlock - { - /// - /// 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.PromptCachingBetaRequestToolUseBlock? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaRequestToolUseBlock), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestToolUseBlock; - } - - /// - /// 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.PromptCachingBetaRequestToolUseBlock? 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.PromptCachingBetaRequestToolUseBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestToolUseBlock; - } - - /// - /// 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.PromptCachingBetaRequestToolUseBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlock.g.cs deleted file mode 100644 index dfffa8b..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlock.g.cs +++ /dev/null @@ -1,81 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestToolUseBlock - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] - public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolUseBlockTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestToolUseBlockType Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("input")] - [global::System.Text.Json.Serialization.JsonRequired] - public required object Input { get; set; } - - /// - /// 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 PromptCachingBetaRequestToolUseBlock( - string id, - string name, - object input, - global::Anthropic.CacheControlEphemeral? cacheControl, - global::Anthropic.PromptCachingBetaRequestToolUseBlockType type) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Input = input ?? throw new global::System.ArgumentNullException(nameof(input)); - this.CacheControl = cacheControl; - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaRequestToolUseBlock() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator.Json.g.cs deleted file mode 100644 index 05a4501..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator - { - /// - /// 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.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator? 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.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator.g.cs deleted file mode 100644 index d07a250..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator( - global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType.g.cs deleted file mode 100644 index 52e4476..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType - { - /// - /// - /// - Ephemeral, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType value) - { - return value switch - { - PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType? ToEnum(string value) - { - return value switch - { - "ephemeral" => PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType.Ephemeral, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockInput.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockInput.g.cs deleted file mode 100644 index 3dada73..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockInput.g.cs +++ /dev/null @@ -1,27 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaRequestToolUseBlockInput - { - - /// - /// 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 PromptCachingBetaRequestToolUseBlockInput( - ) - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockType.g.cs deleted file mode 100644 index e7eb2e6..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public enum PromptCachingBetaRequestToolUseBlockType - { - /// - /// - /// - ToolUse, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PromptCachingBetaRequestToolUseBlockTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PromptCachingBetaRequestToolUseBlockType value) - { - return value switch - { - PromptCachingBetaRequestToolUseBlockType.ToolUse => "tool_use", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PromptCachingBetaRequestToolUseBlockType? ToEnum(string value) - { - return value switch - { - "tool_use" => PromptCachingBetaRequestToolUseBlockType.ToolUse, - _ => null, - }; - } - } -} \ 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 deleted file mode 100644 index dddf0f8..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaTool.g.cs +++ /dev/null @@ -1,85 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaTool - { - /// - /// Description of what this tool does.
- /// Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
- /// Example: Get the current weather in a given location - ///
- /// Get the current weather in a given location - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// Name of the tool.
- /// This is how the tool will be called by the model and in tool_use blocks. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// [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. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("input_schema")] - [global::System.Text.Json.Serialization.JsonRequired] - public required object InputSchema { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] - public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } - - /// - /// 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. - /// - /// - /// Description of what this tool does.
- /// Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
- /// Example: Get the current weather in a given location - /// - /// - /// Name of the tool.
- /// This is how the tool will be called by the model and in tool_use blocks. - /// - /// - /// [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. - /// - /// - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PromptCachingBetaTool( - string name, - object inputSchema, - string? description, - global::Anthropic.CacheControlEphemeral? cacheControl) - { - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.InputSchema = inputSchema ?? throw new global::System.ArgumentNullException(nameof(inputSchema)); - this.Description = description; - this.CacheControl = cacheControl; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaTool() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolCacheControlDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolCacheControlDiscriminator.Json.g.cs deleted file mode 100644 index ad18af1..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolCacheControlDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaToolCacheControlDiscriminator - { - /// - /// 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.PromptCachingBetaToolCacheControlDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaToolCacheControlDiscriminator), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaToolCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaToolCacheControlDiscriminator? 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.PromptCachingBetaToolCacheControlDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaToolCacheControlDiscriminator; - } - - /// - /// 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.PromptCachingBetaToolCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolCacheControlDiscriminator.g.cs deleted file mode 100644 index 1dea75e..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolCacheControlDiscriminator.g.cs +++ /dev/null @@ -1,42 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaToolCacheControlDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType? Type { get; set; } - - /// - /// 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 PromptCachingBetaToolCacheControlDiscriminator( - global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType? type) - { - this.Type = type; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaToolCacheControlDiscriminator() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.Json.g.cs deleted file mode 100644 index 50f9496..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#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 deleted file mode 100644 index 1d56c29..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolInputSchema.g.cs +++ /dev/null @@ -1,28 +0,0 @@ - -#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.PromptCachingBetaUsage.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaUsage.Json.g.cs deleted file mode 100644 index 9f1a65a..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaUsage.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Anthropic -{ - public sealed partial class PromptCachingBetaUsage - { - /// - /// 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.PromptCachingBetaUsage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Anthropic.PromptCachingBetaUsage), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaUsage; - } - - /// - /// 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.PromptCachingBetaUsage? 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.PromptCachingBetaUsage), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaUsage; - } - - /// - /// 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.PromptCachingBetaUsage.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaUsage.g.cs deleted file mode 100644 index 79c2896..0000000 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaUsage.g.cs +++ /dev/null @@ -1,92 +0,0 @@ - -#nullable enable - -namespace Anthropic -{ - /// - /// - /// - public sealed partial class PromptCachingBetaUsage - { - /// - /// The number of input tokens which were used.
- /// Example: 2095 - ///
- /// 2095 - [global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int InputTokens { get; set; } - - /// - /// The number of input tokens used to create the cache entry.
- /// Example: 2051 - ///
- /// 2051 - [global::System.Text.Json.Serialization.JsonPropertyName("cache_creation_input_tokens")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int? CacheCreationInputTokens { get; set; } - - /// - /// The number of input tokens read from the cache.
- /// Example: 2051 - ///
- /// 2051 - [global::System.Text.Json.Serialization.JsonPropertyName("cache_read_input_tokens")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int? CacheReadInputTokens { get; set; } - - /// - /// The number of output tokens which were used.
- /// Example: 503 - ///
- /// 503 - [global::System.Text.Json.Serialization.JsonPropertyName("output_tokens")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int OutputTokens { get; set; } - - /// - /// 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. - /// - /// - /// The number of input tokens which were used.
- /// Example: 2095 - /// - /// - /// The number of input tokens used to create the cache entry.
- /// Example: 2051 - /// - /// - /// The number of input tokens read from the cache.
- /// Example: 2051 - /// - /// - /// The number of output tokens which were used.
- /// Example: 503 - /// - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PromptCachingBetaUsage( - int inputTokens, - int? cacheCreationInputTokens, - int? cacheReadInputTokens, - int outputTokens) - { - this.InputTokens = inputTokens; - this.CacheCreationInputTokens = cacheCreationInputTokens; - this.CacheReadInputTokens = cacheReadInputTokens; - this.OutputTokens = outputTokens; - } - - /// - /// Initializes a new instance of the class. - /// - public PromptCachingBetaUsage() - { - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestCounts.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestCounts.Json.g.cs new file mode 100644 index 0000000..a12c0c4 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestCounts.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class RequestCounts + { + /// + /// 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.RequestCounts? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.RequestCounts), + jsonSerializerContext) as global::Anthropic.RequestCounts; + } + + /// + /// 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.RequestCounts? 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.RequestCounts), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestCounts; + } + + /// + /// 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.RequestCounts.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestCounts.g.cs new file mode 100644 index 0000000..545879a --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestCounts.g.cs @@ -0,0 +1,130 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class RequestCounts + { + /// + /// Number of requests in the Message Batch that are processing.
+ /// Default Value: 0
+ /// Example: 100 + ///
+ /// 0 + /// 100 + [global::System.Text.Json.Serialization.JsonPropertyName("processing")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Processing { get; set; } = 0; + + /// + /// Number of requests in the Message Batch that have completed successfully.
+ /// This is zero until processing of the entire Message Batch has ended.
+ /// Default Value: 0
+ /// Example: 50 + ///
+ /// 0 + /// 50 + [global::System.Text.Json.Serialization.JsonPropertyName("succeeded")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Succeeded { get; set; } = 0; + + /// + /// Number of requests in the Message Batch that encountered an error.
+ /// This is zero until processing of the entire Message Batch has ended.
+ /// Default Value: 0
+ /// Example: 30 + ///
+ /// 0 + /// 30 + [global::System.Text.Json.Serialization.JsonPropertyName("errored")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Errored { get; set; } = 0; + + /// + /// Number of requests in the Message Batch that have been canceled.
+ /// This is zero until processing of the entire Message Batch has ended.
+ /// Default Value: 0
+ /// Example: 10 + ///
+ /// 0 + /// 10 + [global::System.Text.Json.Serialization.JsonPropertyName("canceled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Canceled { get; set; } = 0; + + /// + /// Number of requests in the Message Batch that have expired.
+ /// This is zero until processing of the entire Message Batch has ended.
+ /// Default Value: 0
+ /// Example: 10 + ///
+ /// 0 + /// 10 + [global::System.Text.Json.Serialization.JsonPropertyName("expired")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Expired { get; set; } = 0; + + /// + /// 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. + /// + /// + /// Number of requests in the Message Batch that are processing.
+ /// Default Value: 0
+ /// Example: 100 + /// + /// + /// Number of requests in the Message Batch that have completed successfully.
+ /// This is zero until processing of the entire Message Batch has ended.
+ /// Default Value: 0
+ /// Example: 50 + /// + /// + /// Number of requests in the Message Batch that encountered an error.
+ /// This is zero until processing of the entire Message Batch has ended.
+ /// Default Value: 0
+ /// Example: 30 + /// + /// + /// Number of requests in the Message Batch that have been canceled.
+ /// This is zero until processing of the entire Message Batch has ended.
+ /// Default Value: 0
+ /// Example: 10 + /// + /// + /// Number of requests in the Message Batch that have expired.
+ /// This is zero until processing of the entire Message Batch has ended.
+ /// Default Value: 0
+ /// Example: 10 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RequestCounts( + int processing, + int succeeded, + int errored, + int canceled, + int expired) + { + this.Processing = processing; + this.Succeeded = succeeded; + this.Errored = errored; + this.Canceled = canceled; + this.Expired = expired; + } + + /// + /// Initializes a new instance of the class. + /// + public RequestCounts() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item4.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlock.Json.g.cs similarity index 87% rename from src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item4.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlock.Json.g.cs index 070a367..614f679 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ContentVariant2Item4.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlock.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public readonly partial struct ContentVariant2Item4 + public sealed partial class RequestDocumentBlock { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.ContentVariant2Item4? FromJson( + public static global::Anthropic.RequestDocumentBlock? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.ContentVariant2Item4), - jsonSerializerContext) as global::Anthropic.ContentVariant2Item4?; + typeof(global::Anthropic.RequestDocumentBlock), + jsonSerializerContext) as global::Anthropic.RequestDocumentBlock; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.ContentVariant2Item4? FromJson( + public static global::Anthropic.RequestDocumentBlock? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.ContentVariant2Item4), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ContentVariant2Item4?; + typeof(global::Anthropic.RequestDocumentBlock), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestDocumentBlock; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlock.g.cs similarity index 68% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlock.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlock.g.cs index e139cab..d040010 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestImageBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlock.g.cs @@ -6,7 +6,7 @@ namespace Anthropic /// /// /// - public sealed partial class PromptCachingBetaRequestImageBlock + public sealed partial class RequestDocumentBlock { /// /// @@ -18,15 +18,15 @@ public sealed partial class PromptCachingBetaRequestImageBlock /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaRequestImageBlockType Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.RequestDocumentBlockTypeJsonConverter))] + public global::Anthropic.RequestDocumentBlockType Type { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("source")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.Base64ImageSource Source { get; set; } + public required global::Anthropic.Base64PDFSource Source { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -35,16 +35,16 @@ public sealed partial class PromptCachingBetaRequestImageBlock public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PromptCachingBetaRequestImageBlock( - global::Anthropic.Base64ImageSource source, + public RequestDocumentBlock( + global::Anthropic.Base64PDFSource source, global::Anthropic.CacheControlEphemeral? cacheControl, - global::Anthropic.PromptCachingBetaRequestImageBlockType type) + global::Anthropic.RequestDocumentBlockType type) { this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); this.CacheControl = cacheControl; @@ -52,9 +52,9 @@ public PromptCachingBetaRequestImageBlock( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public PromptCachingBetaRequestImageBlock() + public RequestDocumentBlock() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlock.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminator.Json.g.cs similarity index 82% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlock.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminator.Json.g.cs index 36e9553..43aff0e 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlock.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class PromptCachingBetaRequestToolResultBlock + public sealed partial class RequestDocumentBlockCacheControlDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.PromptCachingBetaRequestToolResultBlock? FromJson( + public static global::Anthropic.RequestDocumentBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.PromptCachingBetaRequestToolResultBlock), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestToolResultBlock; + typeof(global::Anthropic.RequestDocumentBlockCacheControlDiscriminator), + jsonSerializerContext) as global::Anthropic.RequestDocumentBlockCacheControlDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.PromptCachingBetaRequestToolResultBlock? FromJson( + public static global::Anthropic.RequestDocumentBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.PromptCachingBetaRequestToolResultBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestToolResultBlock; + typeof(global::Anthropic.RequestDocumentBlockCacheControlDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestDocumentBlockCacheControlDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminator.g.cs new file mode 100644 index 0000000..79452dc --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminator.g.cs @@ -0,0 +1,42 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class RequestDocumentBlockCacheControlDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.RequestDocumentBlockCacheControlDiscriminatorTypeJsonConverter))] + public global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType? Type { get; set; } + + /// + /// 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 RequestDocumentBlockCacheControlDiscriminator( + global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public RequestDocumentBlockCacheControlDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminatorType.g.cs similarity index 58% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolCacheControlDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminatorType.g.cs index 22f8043..73ac767 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaToolCacheControlDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockCacheControlDiscriminatorType.g.cs @@ -6,7 +6,7 @@ namespace Anthropic /// /// /// - public enum PromptCachingBetaToolCacheControlDiscriminatorType + public enum RequestDocumentBlockCacheControlDiscriminatorType { /// /// @@ -17,27 +17,27 @@ public enum PromptCachingBetaToolCacheControlDiscriminatorType /// /// Enum extensions to do fast conversions without the reflection. /// - public static class PromptCachingBetaToolCacheControlDiscriminatorTypeExtensions + public static class RequestDocumentBlockCacheControlDiscriminatorTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this PromptCachingBetaToolCacheControlDiscriminatorType value) + public static string ToValueString(this RequestDocumentBlockCacheControlDiscriminatorType value) { return value switch { - PromptCachingBetaToolCacheControlDiscriminatorType.Ephemeral => "ephemeral", + RequestDocumentBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static PromptCachingBetaToolCacheControlDiscriminatorType? ToEnum(string value) + public static RequestDocumentBlockCacheControlDiscriminatorType? ToEnum(string value) { return value switch { - "ephemeral" => PromptCachingBetaToolCacheControlDiscriminatorType.Ephemeral, + "ephemeral" => RequestDocumentBlockCacheControlDiscriminatorType.Ephemeral, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminator.Json.g.cs similarity index 84% rename from src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminator.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminator.Json.g.cs index 34d6f2e..8e7db14 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminator.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class RequestImageBlockSourceDiscriminator + public sealed partial class RequestDocumentBlockSourceDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.RequestImageBlockSourceDiscriminator? FromJson( + public static global::Anthropic.RequestDocumentBlockSourceDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.RequestImageBlockSourceDiscriminator), - jsonSerializerContext) as global::Anthropic.RequestImageBlockSourceDiscriminator; + typeof(global::Anthropic.RequestDocumentBlockSourceDiscriminator), + jsonSerializerContext) as global::Anthropic.RequestDocumentBlockSourceDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.RequestImageBlockSourceDiscriminator? FromJson( + public static global::Anthropic.RequestDocumentBlockSourceDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.RequestImageBlockSourceDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestImageBlockSourceDiscriminator; + typeof(global::Anthropic.RequestDocumentBlockSourceDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestDocumentBlockSourceDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminator.g.cs similarity index 66% rename from src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminator.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminator.g.cs index dfb2bcd..c3729b6 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminator.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Anthropic /// /// /// - public sealed partial class RequestImageBlockSourceDiscriminator + public sealed partial class RequestDocumentBlockSourceDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.RequestImageBlockSourceDiscriminatorTypeJsonConverter))] - public global::Anthropic.RequestImageBlockSourceDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.RequestDocumentBlockSourceDiscriminatorTypeJsonConverter))] + public global::Anthropic.RequestDocumentBlockSourceDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,20 +22,20 @@ public sealed partial class RequestImageBlockSourceDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public RequestImageBlockSourceDiscriminator( - global::Anthropic.RequestImageBlockSourceDiscriminatorType? type) + public RequestDocumentBlockSourceDiscriminator( + global::Anthropic.RequestDocumentBlockSourceDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public RequestImageBlockSourceDiscriminator() + public RequestDocumentBlockSourceDiscriminator() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminatorType.g.cs similarity index 61% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminatorType.g.cs index bfaef80..49d3591 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockSourceDiscriminatorType.g.cs @@ -6,38 +6,38 @@ namespace Anthropic /// /// /// - public enum PromptCachingBetaRequestToolResultBlockType + public enum RequestDocumentBlockSourceDiscriminatorType { /// /// /// - ToolResult, + Base64, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class PromptCachingBetaRequestToolResultBlockTypeExtensions + public static class RequestDocumentBlockSourceDiscriminatorTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this PromptCachingBetaRequestToolResultBlockType value) + public static string ToValueString(this RequestDocumentBlockSourceDiscriminatorType value) { return value switch { - PromptCachingBetaRequestToolResultBlockType.ToolResult => "tool_result", + RequestDocumentBlockSourceDiscriminatorType.Base64 => "base64", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static PromptCachingBetaRequestToolResultBlockType? ToEnum(string value) + public static RequestDocumentBlockSourceDiscriminatorType? ToEnum(string value) { return value switch { - "tool_result" => PromptCachingBetaRequestToolResultBlockType.ToolResult, + "base64" => RequestDocumentBlockSourceDiscriminatorType.Base64, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockType.g.cs similarity index 66% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockType.g.cs index 632fd8d..fd03e13 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestDocumentBlockType.g.cs @@ -6,7 +6,7 @@ namespace Anthropic /// /// /// - public enum BetaRequestPDFBlockType + public enum RequestDocumentBlockType { /// /// @@ -17,27 +17,27 @@ public enum BetaRequestPDFBlockType /// /// Enum extensions to do fast conversions without the reflection. /// - public static class BetaRequestPDFBlockTypeExtensions + public static class RequestDocumentBlockTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this BetaRequestPDFBlockType value) + public static string ToValueString(this RequestDocumentBlockType value) { return value switch { - BetaRequestPDFBlockType.Document => "document", + RequestDocumentBlockType.Document => "document", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static BetaRequestPDFBlockType? ToEnum(string value) + public static RequestDocumentBlockType? ToEnum(string value) { return value switch { - "document" => BetaRequestPDFBlockType.Document, + "document" => RequestDocumentBlockType.Document, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlock.g.cs index c02bc76..7408557 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlock.g.cs @@ -8,6 +8,12 @@ namespace Anthropic /// public sealed partial class RequestImageBlock { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] + public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } + /// /// /// @@ -31,14 +37,17 @@ public sealed partial class RequestImageBlock /// /// Initializes a new instance of the class. /// + /// /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public RequestImageBlock( global::Anthropic.Base64ImageSource source, + global::Anthropic.CacheControlEphemeral? cacheControl, global::Anthropic.RequestImageBlockType type) { this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); + this.CacheControl = cacheControl; this.Type = type; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaCreateMessageParams.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminator.Json.g.cs similarity index 83% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaCreateMessageParams.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminator.Json.g.cs index 0b6240d..5a59184 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaCreateMessageParams.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class PromptCachingBetaCreateMessageParams + public sealed partial class RequestImageBlockCacheControlDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.PromptCachingBetaCreateMessageParams? FromJson( + public static global::Anthropic.RequestImageBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.PromptCachingBetaCreateMessageParams), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaCreateMessageParams; + typeof(global::Anthropic.RequestImageBlockCacheControlDiscriminator), + jsonSerializerContext) as global::Anthropic.RequestImageBlockCacheControlDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.PromptCachingBetaCreateMessageParams? FromJson( + public static global::Anthropic.RequestImageBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.PromptCachingBetaCreateMessageParams), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaCreateMessageParams; + typeof(global::Anthropic.RequestImageBlockCacheControlDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestImageBlockCacheControlDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminator.g.cs new file mode 100644 index 0000000..e0af461 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminator.g.cs @@ -0,0 +1,42 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class RequestImageBlockCacheControlDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.RequestImageBlockCacheControlDiscriminatorTypeJsonConverter))] + public global::Anthropic.RequestImageBlockCacheControlDiscriminatorType? Type { get; set; } + + /// + /// 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 RequestImageBlockCacheControlDiscriminator( + global::Anthropic.RequestImageBlockCacheControlDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public RequestImageBlockCacheControlDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminatorType.g.cs similarity index 63% rename from src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminatorType.g.cs index 7f0567a..dd009fa 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockSourceDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestImageBlockCacheControlDiscriminatorType.g.cs @@ -6,38 +6,38 @@ namespace Anthropic /// /// /// - public enum RequestImageBlockSourceDiscriminatorType + public enum RequestImageBlockCacheControlDiscriminatorType { /// /// /// - Base64, + Ephemeral, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class RequestImageBlockSourceDiscriminatorTypeExtensions + public static class RequestImageBlockCacheControlDiscriminatorTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this RequestImageBlockSourceDiscriminatorType value) + public static string ToValueString(this RequestImageBlockCacheControlDiscriminatorType value) { return value switch { - RequestImageBlockSourceDiscriminatorType.Base64 => "base64", + RequestImageBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static RequestImageBlockSourceDiscriminatorType? ToEnum(string value) + public static RequestImageBlockCacheControlDiscriminatorType? ToEnum(string value) { return value switch { - "base64" => RequestImageBlockSourceDiscriminatorType.Base64, + "ephemeral" => RequestImageBlockCacheControlDiscriminatorType.Ephemeral, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlock.g.cs index 5524fc9..8c9a8f6 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlock.g.cs @@ -8,6 +8,12 @@ namespace Anthropic /// public sealed partial class RequestTextBlock { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] + public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } + /// /// /// @@ -31,14 +37,17 @@ public sealed partial class RequestTextBlock /// /// Initializes a new instance of the class. /// + /// /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public RequestTextBlock( string text, + global::Anthropic.CacheControlEphemeral? cacheControl, global::Anthropic.RequestTextBlockType type) { this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.CacheControl = cacheControl; this.Type = type; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockInput.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminator.Json.g.cs similarity index 83% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockInput.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminator.Json.g.cs index 05dc7ef..cc42f69 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolUseBlockInput.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class PromptCachingBetaRequestToolUseBlockInput + public sealed partial class RequestTextBlockCacheControlDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.PromptCachingBetaRequestToolUseBlockInput? FromJson( + public static global::Anthropic.RequestTextBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.PromptCachingBetaRequestToolUseBlockInput), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaRequestToolUseBlockInput; + typeof(global::Anthropic.RequestTextBlockCacheControlDiscriminator), + jsonSerializerContext) as global::Anthropic.RequestTextBlockCacheControlDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.PromptCachingBetaRequestToolUseBlockInput? FromJson( + public static global::Anthropic.RequestTextBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.PromptCachingBetaRequestToolUseBlockInput), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaRequestToolUseBlockInput; + typeof(global::Anthropic.RequestTextBlockCacheControlDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestTextBlockCacheControlDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminator.g.cs new file mode 100644 index 0000000..f03b8c4 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminator.g.cs @@ -0,0 +1,42 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class RequestTextBlockCacheControlDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.RequestTextBlockCacheControlDiscriminatorTypeJsonConverter))] + public global::Anthropic.RequestTextBlockCacheControlDiscriminatorType? Type { get; set; } + + /// + /// 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 RequestTextBlockCacheControlDiscriminator( + global::Anthropic.RequestTextBlockCacheControlDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public RequestTextBlockCacheControlDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminatorType.g.cs new file mode 100644 index 0000000..1ebe15c --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestTextBlockCacheControlDiscriminatorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public enum RequestTextBlockCacheControlDiscriminatorType + { + /// + /// + /// + Ephemeral, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RequestTextBlockCacheControlDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RequestTextBlockCacheControlDiscriminatorType value) + { + return value switch + { + RequestTextBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RequestTextBlockCacheControlDiscriminatorType? ToEnum(string value) + { + return value switch + { + "ephemeral" => RequestTextBlockCacheControlDiscriminatorType.Ephemeral, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlock.g.cs index f2d0160..7bd7860 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlock.g.cs @@ -10,6 +10,12 @@ namespace Anthropic /// public sealed partial class RequestToolResultBlock { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] + public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } + /// /// /// @@ -34,8 +40,8 @@ public sealed partial class RequestToolResultBlock /// /// [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>))] - public global::Anthropic.AnyOf>? Content { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>))] + public global::Anthropic.AnyOf>? Content { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -46,6 +52,7 @@ public sealed partial class RequestToolResultBlock /// /// Initializes a new instance of the class. /// + /// /// /// /// @@ -53,11 +60,13 @@ public sealed partial class RequestToolResultBlock [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public RequestToolResultBlock( string toolUseId, + global::Anthropic.CacheControlEphemeral? cacheControl, global::Anthropic.RequestToolResultBlockType type, bool? isError, - global::Anthropic.AnyOf>? content) + global::Anthropic.AnyOf>? content) { this.ToolUseId = toolUseId ?? throw new global::System.ArgumentNullException(nameof(toolUseId)); + this.CacheControl = cacheControl; this.Type = type; this.IsError = isError; this.Content = content; diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminator.Json.g.cs new file mode 100644 index 0000000..57e5cdf --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class RequestToolResultBlockCacheControlDiscriminator + { + /// + /// 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.RequestToolResultBlockCacheControlDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.RequestToolResultBlockCacheControlDiscriminator), + jsonSerializerContext) as global::Anthropic.RequestToolResultBlockCacheControlDiscriminator; + } + + /// + /// 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.RequestToolResultBlockCacheControlDiscriminator? 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.RequestToolResultBlockCacheControlDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestToolResultBlockCacheControlDiscriminator; + } + + /// + /// 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.BetaContentBlockDeltaEventDeltaDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminator.g.cs similarity index 58% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEventDeltaDiscriminator.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminator.g.cs index 77d308d..e18764b 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaContentBlockDeltaEventDeltaDiscriminator.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Anthropic /// /// /// - public sealed partial class BetaContentBlockDeltaEventDeltaDiscriminator + public sealed partial class RequestToolResultBlockCacheControlDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter))] - public global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.RequestToolResultBlockCacheControlDiscriminatorTypeJsonConverter))] + public global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,20 +22,20 @@ public sealed partial class BetaContentBlockDeltaEventDeltaDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public BetaContentBlockDeltaEventDeltaDiscriminator( - global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType? type) + public RequestToolResultBlockCacheControlDiscriminator( + global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public BetaContentBlockDeltaEventDeltaDiscriminator() + public RequestToolResultBlockCacheControlDiscriminator() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminatorType.g.cs similarity index 57% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminatorType.g.cs index 42e5608..aa23a86 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolResultBlockCacheControlDiscriminatorType.g.cs @@ -6,7 +6,7 @@ namespace Anthropic /// /// /// - public enum PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType + public enum RequestToolResultBlockCacheControlDiscriminatorType { /// /// @@ -17,27 +17,27 @@ public enum PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType /// /// Enum extensions to do fast conversions without the reflection. /// - public static class PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeExtensions + public static class RequestToolResultBlockCacheControlDiscriminatorTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType value) + public static string ToValueString(this RequestToolResultBlockCacheControlDiscriminatorType value) { return value switch { - PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", + RequestToolResultBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType? ToEnum(string value) + public static RequestToolResultBlockCacheControlDiscriminatorType? ToEnum(string value) { return value switch { - "ephemeral" => PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType.Ephemeral, + "ephemeral" => RequestToolResultBlockCacheControlDiscriminatorType.Ephemeral, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlock.g.cs index f012f1d..afed8ce 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlock.g.cs @@ -8,6 +8,12 @@ namespace Anthropic /// public sealed partial class RequestToolUseBlock { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] + public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } + /// /// /// @@ -45,6 +51,7 @@ public sealed partial class RequestToolUseBlock /// /// Initializes a new instance of the class. /// + /// /// /// /// @@ -54,11 +61,13 @@ public RequestToolUseBlock( string id, string name, object input, + global::Anthropic.CacheControlEphemeral? cacheControl, global::Anthropic.RequestToolUseBlockType type) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.Input = input ?? throw new global::System.ArgumentNullException(nameof(input)); + this.CacheControl = cacheControl; this.Type = type; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminator.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminator.Json.g.cs similarity index 86% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminator.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminator.Json.g.cs index 91ae732..bbdbd42 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminator.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class BetaRequestPDFBlockCacheControlDiscriminator + public sealed partial class RequestToolUseBlockCacheControlDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminator? FromJson( + public static global::Anthropic.RequestToolUseBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminator), - jsonSerializerContext) as global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminator; + typeof(global::Anthropic.RequestToolUseBlockCacheControlDiscriminator), + jsonSerializerContext) as global::Anthropic.RequestToolUseBlockCacheControlDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.BetaRequestPDFBlockCacheControlDiscriminator? FromJson( + public static global::Anthropic.RequestToolUseBlockCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.BetaRequestPDFBlockCacheControlDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminator; + typeof(global::Anthropic.RequestToolUseBlockCacheControlDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.RequestToolUseBlockCacheControlDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminator.g.cs similarity index 63% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminator.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminator.g.cs index d862c51..f5f9c97 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminator.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Anthropic /// /// /// - public sealed partial class BetaRequestPDFBlockCacheControlDiscriminator + public sealed partial class RequestToolUseBlockCacheControlDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorTypeJsonConverter))] - public global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.RequestToolUseBlockCacheControlDiscriminatorTypeJsonConverter))] + public global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,20 +22,20 @@ public sealed partial class BetaRequestPDFBlockCacheControlDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public BetaRequestPDFBlockCacheControlDiscriminator( - global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType? type) + public RequestToolUseBlockCacheControlDiscriminator( + global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public BetaRequestPDFBlockCacheControlDiscriminator() + public RequestToolUseBlockCacheControlDiscriminator() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminatorType.g.cs similarity index 70% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminatorType.g.cs index c00f253..703fadf 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaRequestPDFBlockCacheControlDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.RequestToolUseBlockCacheControlDiscriminatorType.g.cs @@ -6,7 +6,7 @@ namespace Anthropic /// /// /// - public enum BetaRequestPDFBlockCacheControlDiscriminatorType + public enum RequestToolUseBlockCacheControlDiscriminatorType { /// /// @@ -17,27 +17,27 @@ public enum BetaRequestPDFBlockCacheControlDiscriminatorType /// /// Enum extensions to do fast conversions without the reflection. /// - public static class BetaRequestPDFBlockCacheControlDiscriminatorTypeExtensions + public static class RequestToolUseBlockCacheControlDiscriminatorTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this BetaRequestPDFBlockCacheControlDiscriminatorType value) + public static string ToValueString(this RequestToolUseBlockCacheControlDiscriminatorType value) { return value switch { - BetaRequestPDFBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", + RequestToolUseBlockCacheControlDiscriminatorType.Ephemeral => "ephemeral", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static BetaRequestPDFBlockCacheControlDiscriminatorType? ToEnum(string value) + public static RequestToolUseBlockCacheControlDiscriminatorType? ToEnum(string value) { return value switch { - "ephemeral" => BetaRequestPDFBlockCacheControlDiscriminatorType.Ephemeral, + "ephemeral" => RequestToolUseBlockCacheControlDiscriminatorType.Ephemeral, _ => null, }; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Delta.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Result.Json.g.cs similarity index 89% rename from src/libs/Anthropic/Generated/Anthropic.Models.Delta.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.Result.Json.g.cs index 876fffa..d0826ae 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Delta.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Result.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public readonly partial struct Delta + public readonly partial struct Result { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.Delta? FromJson( + public static global::Anthropic.Result? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.Delta), - jsonSerializerContext) as global::Anthropic.Delta?; + typeof(global::Anthropic.Result), + jsonSerializerContext) as global::Anthropic.Result?; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.Delta? FromJson( + public static global::Anthropic.Result? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Delta), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.Delta?; + typeof(global::Anthropic.Result), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.Result?; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResult.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Result.g.cs similarity index 82% rename from src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResult.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.Result.g.cs index 3b7f10f..b831285 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BetaMessageBatchResult.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Result.g.cs @@ -8,12 +8,12 @@ namespace Anthropic /// Processing result for this request.
/// Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration. ///
- public readonly partial struct BetaMessageBatchResult : global::System.IEquatable + public readonly partial struct Result : global::System.IEquatable { /// /// /// - public global::Anthropic.BetaMessageBatchResultDiscriminatorType? Type { get; } + public global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType? Type { get; } /// /// @@ -35,17 +35,17 @@ namespace Anthropic /// /// /// - public static implicit operator BetaMessageBatchResult(global::Anthropic.BetaSucceededResult value) => new BetaMessageBatchResult(value); + public static implicit operator Result(global::Anthropic.BetaSucceededResult value) => new Result(value); /// /// /// - public static implicit operator global::Anthropic.BetaSucceededResult?(BetaMessageBatchResult @this) => @this.Succeeded; + public static implicit operator global::Anthropic.BetaSucceededResult?(Result @this) => @this.Succeeded; /// /// /// - public BetaMessageBatchResult(global::Anthropic.BetaSucceededResult? value) + public Result(global::Anthropic.BetaSucceededResult? value) { Succeeded = value; } @@ -70,17 +70,17 @@ public BetaMessageBatchResult(global::Anthropic.BetaSucceededResult? value) /// /// /// - public static implicit operator BetaMessageBatchResult(global::Anthropic.BetaErroredResult value) => new BetaMessageBatchResult(value); + public static implicit operator Result(global::Anthropic.BetaErroredResult value) => new Result(value); /// /// /// - public static implicit operator global::Anthropic.BetaErroredResult?(BetaMessageBatchResult @this) => @this.Errored; + public static implicit operator global::Anthropic.BetaErroredResult?(Result @this) => @this.Errored; /// /// /// - public BetaMessageBatchResult(global::Anthropic.BetaErroredResult? value) + public Result(global::Anthropic.BetaErroredResult? value) { Errored = value; } @@ -105,17 +105,17 @@ public BetaMessageBatchResult(global::Anthropic.BetaErroredResult? value) /// /// /// - public static implicit operator BetaMessageBatchResult(global::Anthropic.BetaCanceledResult value) => new BetaMessageBatchResult(value); + public static implicit operator Result(global::Anthropic.BetaCanceledResult value) => new Result(value); /// /// /// - public static implicit operator global::Anthropic.BetaCanceledResult?(BetaMessageBatchResult @this) => @this.Canceled; + public static implicit operator global::Anthropic.BetaCanceledResult?(Result @this) => @this.Canceled; /// /// /// - public BetaMessageBatchResult(global::Anthropic.BetaCanceledResult? value) + public Result(global::Anthropic.BetaCanceledResult? value) { Canceled = value; } @@ -140,17 +140,17 @@ public BetaMessageBatchResult(global::Anthropic.BetaCanceledResult? value) /// /// /// - public static implicit operator BetaMessageBatchResult(global::Anthropic.BetaExpiredResult value) => new BetaMessageBatchResult(value); + public static implicit operator Result(global::Anthropic.BetaExpiredResult value) => new Result(value); /// /// /// - public static implicit operator global::Anthropic.BetaExpiredResult?(BetaMessageBatchResult @this) => @this.Expired; + public static implicit operator global::Anthropic.BetaExpiredResult?(Result @this) => @this.Expired; /// /// /// - public BetaMessageBatchResult(global::Anthropic.BetaExpiredResult? value) + public Result(global::Anthropic.BetaExpiredResult? value) { Expired = value; } @@ -158,8 +158,8 @@ public BetaMessageBatchResult(global::Anthropic.BetaExpiredResult? value) /// /// /// - public BetaMessageBatchResult( - global::Anthropic.BetaMessageBatchResultDiscriminatorType? type, + public Result( + global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType? type, global::Anthropic.BetaSucceededResult? succeeded, global::Anthropic.BetaErroredResult? errored, global::Anthropic.BetaCanceledResult? canceled, @@ -288,7 +288,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(BetaMessageBatchResult other) + public bool Equals(Result other) { return global::System.Collections.Generic.EqualityComparer.Default.Equals(Succeeded, other.Succeeded) && @@ -301,15 +301,15 @@ public bool Equals(BetaMessageBatchResult other) /// /// /// - public static bool operator ==(BetaMessageBatchResult obj1, BetaMessageBatchResult obj2) + public static bool operator ==(Result obj1, Result obj2) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(BetaMessageBatchResult obj1, BetaMessageBatchResult obj2) + public static bool operator !=(Result obj1, Result obj2) { return !(obj1 == obj2); } @@ -319,7 +319,7 @@ public bool Equals(BetaMessageBatchResult other) /// public override bool Equals(object? obj) { - return obj is BetaMessageBatchResult o && Equals(o); + return obj is Result o && Equals(o); } } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Delta2.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Result2.Json.g.cs similarity index 89% rename from src/libs/Anthropic/Generated/Anthropic.Models.Delta2.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.Result2.Json.g.cs index b9c682b..4f9cd17 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Delta2.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Result2.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public readonly partial struct Delta2 + public readonly partial struct Result2 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.Delta2? FromJson( + public static global::Anthropic.Result2? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.Delta2), - jsonSerializerContext) as global::Anthropic.Delta2?; + typeof(global::Anthropic.Result2), + jsonSerializerContext) as global::Anthropic.Result2?; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.Delta2? FromJson( + public static global::Anthropic.Result2? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Delta2), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.Delta2?; + typeof(global::Anthropic.Result2), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.Result2?; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Result2.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Result2.g.cs new file mode 100644 index 0000000..7a8c68d --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Result2.g.cs @@ -0,0 +1,325 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Anthropic +{ + /// + /// Processing result for this request.
+ /// Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration. + ///
+ public readonly partial struct Result2 : global::System.IEquatable + { + /// + /// + /// + public global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType? Type { get; } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.SucceededResult? Succeeded { get; init; } +#else + public global::Anthropic.SucceededResult? Succeeded { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Succeeded))] +#endif + public bool IsSucceeded => Succeeded != null; + + /// + /// + /// + public static implicit operator Result2(global::Anthropic.SucceededResult value) => new Result2(value); + + /// + /// + /// + public static implicit operator global::Anthropic.SucceededResult?(Result2 @this) => @this.Succeeded; + + /// + /// + /// + public Result2(global::Anthropic.SucceededResult? value) + { + Succeeded = value; + } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.ErroredResult? Errored { get; init; } +#else + public global::Anthropic.ErroredResult? Errored { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Errored))] +#endif + public bool IsErrored => Errored != null; + + /// + /// + /// + public static implicit operator Result2(global::Anthropic.ErroredResult value) => new Result2(value); + + /// + /// + /// + public static implicit operator global::Anthropic.ErroredResult?(Result2 @this) => @this.Errored; + + /// + /// + /// + public Result2(global::Anthropic.ErroredResult? value) + { + Errored = value; + } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.CanceledResult? Canceled { get; init; } +#else + public global::Anthropic.CanceledResult? Canceled { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Canceled))] +#endif + public bool IsCanceled => Canceled != null; + + /// + /// + /// + public static implicit operator Result2(global::Anthropic.CanceledResult value) => new Result2(value); + + /// + /// + /// + public static implicit operator global::Anthropic.CanceledResult?(Result2 @this) => @this.Canceled; + + /// + /// + /// + public Result2(global::Anthropic.CanceledResult? value) + { + Canceled = value; + } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Anthropic.ExpiredResult? Expired { get; init; } +#else + public global::Anthropic.ExpiredResult? Expired { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Expired))] +#endif + public bool IsExpired => Expired != null; + + /// + /// + /// + public static implicit operator Result2(global::Anthropic.ExpiredResult value) => new Result2(value); + + /// + /// + /// + public static implicit operator global::Anthropic.ExpiredResult?(Result2 @this) => @this.Expired; + + /// + /// + /// + public Result2(global::Anthropic.ExpiredResult? value) + { + Expired = value; + } + + /// + /// + /// + public Result2( + global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType? type, + global::Anthropic.SucceededResult? succeeded, + global::Anthropic.ErroredResult? errored, + global::Anthropic.CanceledResult? canceled, + global::Anthropic.ExpiredResult? expired + ) + { + Type = type; + + Succeeded = succeeded; + Errored = errored; + Canceled = canceled; + Expired = expired; + } + + /// + /// + /// + public object? Object => + Expired as object ?? + Canceled as object ?? + Errored as object ?? + Succeeded as object + ; + + /// + /// + /// + public bool Validate() + { + return IsSucceeded && !IsErrored && !IsCanceled && !IsExpired || !IsSucceeded && IsErrored && !IsCanceled && !IsExpired || !IsSucceeded && !IsErrored && IsCanceled && !IsExpired || !IsSucceeded && !IsErrored && !IsCanceled && IsExpired; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? succeeded = null, + global::System.Func? errored = null, + global::System.Func? canceled = null, + global::System.Func? expired = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSucceeded && succeeded != null) + { + return succeeded(Succeeded!); + } + else if (IsErrored && errored != null) + { + return errored(Errored!); + } + else if (IsCanceled && canceled != null) + { + return canceled(Canceled!); + } + else if (IsExpired && expired != null) + { + return expired(Expired!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? succeeded = null, + global::System.Action? errored = null, + global::System.Action? canceled = null, + global::System.Action? expired = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSucceeded) + { + succeeded?.Invoke(Succeeded!); + } + else if (IsErrored) + { + errored?.Invoke(Errored!); + } + else if (IsCanceled) + { + canceled?.Invoke(Canceled!); + } + else if (IsExpired) + { + expired?.Invoke(Expired!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Succeeded, + typeof(global::Anthropic.SucceededResult), + Errored, + typeof(global::Anthropic.ErroredResult), + Canceled, + typeof(global::Anthropic.CanceledResult), + Expired, + typeof(global::Anthropic.ExpiredResult), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(Result2 other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Succeeded, other.Succeeded) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Errored, other.Errored) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Canceled, other.Canceled) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Expired, other.Expired) + ; + } + + /// + /// + /// + public static bool operator ==(Result2 obj1, Result2 obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(Result2 obj1, Result2 obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is Result2 o && Equals(o); + } + } +} diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.SucceededResult.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.SucceededResult.Json.g.cs new file mode 100644 index 0000000..424998c --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.SucceededResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Anthropic +{ + public sealed partial class SucceededResult + { + /// + /// 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.SucceededResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Anthropic.SucceededResult), + jsonSerializerContext) as global::Anthropic.SucceededResult; + } + + /// + /// 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.SucceededResult? 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.SucceededResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.SucceededResult; + } + + /// + /// 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.PromptCachingBetaMessageStartEvent.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.SucceededResult.g.cs similarity index 53% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStartEvent.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.SucceededResult.g.cs index cf60839..3ae1f29 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaMessageStartEvent.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.SucceededResult.g.cs @@ -6,22 +6,22 @@ namespace Anthropic /// /// /// - public sealed partial class PromptCachingBetaMessageStartEvent + public sealed partial class SucceededResult { /// - /// Default Value: message_start + /// Default Value: succeeded /// - /// global::Anthropic.PromptCachingBetaMessageStartEventType.MessageStart + /// global::Anthropic.SucceededResultType.Succeeded [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStartEventTypeJsonConverter))] - public global::Anthropic.PromptCachingBetaMessageStartEventType Type { get; set; } = global::Anthropic.PromptCachingBetaMessageStartEventType.MessageStart; + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.SucceededResultTypeJsonConverter))] + public global::Anthropic.SucceededResultType Type { get; set; } = global::Anthropic.SucceededResultType.Succeeded; /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("message")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Anthropic.PromptCachingBetaMessage Message { get; set; } + public required global::Anthropic.Message Message { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -30,25 +30,25 @@ public sealed partial class PromptCachingBetaMessageStartEvent public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - /// Default Value: message_start + /// Default Value: succeeded /// /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PromptCachingBetaMessageStartEvent( - global::Anthropic.PromptCachingBetaMessage message, - global::Anthropic.PromptCachingBetaMessageStartEventType type = global::Anthropic.PromptCachingBetaMessageStartEventType.MessageStart) + public SucceededResult( + global::Anthropic.Message message, + global::Anthropic.SucceededResultType type = global::Anthropic.SucceededResultType.Succeeded) { this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public PromptCachingBetaMessageStartEvent() + public SucceededResult() { } } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.SucceededResultType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.SucceededResultType.g.cs new file mode 100644 index 0000000..c841c75 --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.SucceededResultType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// Default Value: succeeded + /// + public enum SucceededResultType + { + /// + /// + /// + Succeeded, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SucceededResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SucceededResultType value) + { + return value switch + { + SucceededResultType.Succeeded => "succeeded", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SucceededResultType? ToEnum(string value) + { + return value switch + { + "succeeded" => SucceededResultType.Succeeded, + _ => null, + }; + } + } +} \ 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 f6e770b..72d98c0 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Tool.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Tool.g.cs @@ -33,6 +33,12 @@ public sealed partial class Tool [global::System.Text.Json.Serialization.JsonRequired] public required object InputSchema { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] + public global::Anthropic.CacheControlEphemeral? CacheControl { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -55,15 +61,18 @@ public sealed partial class Tool /// [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. /// + /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public Tool( string name, object inputSchema, - string? description) + string? description, + global::Anthropic.CacheControlEphemeral? cacheControl) { this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.InputSchema = inputSchema ?? throw new global::System.ArgumentNullException(nameof(inputSchema)); this.Description = description; + this.CacheControl = cacheControl; } /// diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessage.Json.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminator.Json.g.cs similarity index 85% rename from src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessage.Json.g.cs rename to src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminator.Json.g.cs index 77b4cfb..2e07963 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.PromptCachingBetaInputMessage.Json.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Anthropic { - public sealed partial class PromptCachingBetaInputMessage + public sealed partial class ToolCacheControlDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Anthropic.PromptCachingBetaInputMessage? FromJson( + public static global::Anthropic.ToolCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Anthropic.PromptCachingBetaInputMessage), - jsonSerializerContext) as global::Anthropic.PromptCachingBetaInputMessage; + typeof(global::Anthropic.ToolCacheControlDiscriminator), + jsonSerializerContext) as global::Anthropic.ToolCacheControlDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [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.PromptCachingBetaInputMessage? FromJson( + public static global::Anthropic.ToolCacheControlDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.PromptCachingBetaInputMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.PromptCachingBetaInputMessage; + typeof(global::Anthropic.ToolCacheControlDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Anthropic.ToolCacheControlDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [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( + 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( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminator.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminator.g.cs new file mode 100644 index 0000000..7292b2b --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminator.g.cs @@ -0,0 +1,42 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public sealed partial class ToolCacheControlDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.ToolCacheControlDiscriminatorTypeJsonConverter))] + public global::Anthropic.ToolCacheControlDiscriminatorType? Type { get; set; } + + /// + /// 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 ToolCacheControlDiscriminator( + global::Anthropic.ToolCacheControlDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public ToolCacheControlDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminatorType.g.cs new file mode 100644 index 0000000..259b46f --- /dev/null +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolCacheControlDiscriminatorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Anthropic +{ + /// + /// + /// + public enum ToolCacheControlDiscriminatorType + { + /// + /// + /// + Ephemeral, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ToolCacheControlDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ToolCacheControlDiscriminatorType value) + { + return value switch + { + ToolCacheControlDiscriminatorType.Ephemeral => "ephemeral", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ToolCacheControlDiscriminatorType? ToEnum(string value) + { + return value switch + { + "ephemeral" => ToolCacheControlDiscriminatorType.Ephemeral, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Usage.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Usage.g.cs index c78abae..e39389b 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Usage.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Usage.g.cs @@ -17,6 +17,24 @@ public sealed partial class Usage [global::System.Text.Json.Serialization.JsonRequired] public required int InputTokens { get; set; } + /// + /// The number of input tokens used to create the cache entry.
+ /// Example: 2051 + ///
+ /// 2051 + [global::System.Text.Json.Serialization.JsonPropertyName("cache_creation_input_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int? CacheCreationInputTokens { get; set; } + + /// + /// The number of input tokens read from the cache.
+ /// Example: 2051 + ///
+ /// 2051 + [global::System.Text.Json.Serialization.JsonPropertyName("cache_read_input_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int? CacheReadInputTokens { get; set; } + /// /// The number of output tokens which were used.
/// Example: 503 @@ -39,6 +57,14 @@ public sealed partial class Usage /// The number of input tokens which were used.
/// Example: 2095 /// + /// + /// The number of input tokens used to create the cache entry.
+ /// Example: 2051 + /// + /// + /// The number of input tokens read from the cache.
+ /// Example: 2051 + /// /// /// The number of output tokens which were used.
/// Example: 503 @@ -46,9 +72,13 @@ public sealed partial class Usage [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public Usage( int inputTokens, + int? cacheCreationInputTokens, + int? cacheReadInputTokens, int outputTokens) { this.InputTokens = inputTokens; + this.CacheCreationInputTokens = cacheCreationInputTokens; + this.CacheReadInputTokens = cacheReadInputTokens; this.OutputTokens = outputTokens; } diff --git a/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceMediaType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceMediaType.g.cs new file mode 100644 index 0000000..597863d --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceMediaType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class Base64PDFSourceMediaTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.Base64PDFSourceMediaType 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.Base64PDFSourceMediaTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.Base64PDFSourceMediaType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.Base64PDFSourceMediaType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.Base64PDFSourceMediaTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceMediaTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceMediaTypeNullable.g.cs new file mode 100644 index 0000000..95a75c9 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceMediaTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class Base64PDFSourceMediaTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.Base64PDFSourceMediaType? 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.Base64PDFSourceMediaTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.Base64PDFSourceMediaType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.Base64PDFSourceMediaType? 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.Base64PDFSourceMediaTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceType.g.cs new file mode 100644 index 0000000..df4e720 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class Base64PDFSourceTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.Base64PDFSourceType 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.Base64PDFSourceTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.Base64PDFSourceType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.Base64PDFSourceType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.Base64PDFSourceTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceTypeNullable.g.cs new file mode 100644 index 0000000..931d1b3 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.Base64PDFSourceTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class Base64PDFSourceTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.Base64PDFSourceType? 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.Base64PDFSourceTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.Base64PDFSourceType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.Base64PDFSourceType? 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.Base64PDFSourceTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaBillingErrorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaBillingErrorType.g.cs new file mode 100644 index 0000000..d09bd5f --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaBillingErrorType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BetaBillingErrorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BetaBillingErrorType 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.BetaBillingErrorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BetaBillingErrorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BetaBillingErrorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.BetaBillingErrorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaBillingErrorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaBillingErrorTypeNullable.g.cs new file mode 100644 index 0000000..93e5a6e --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaBillingErrorTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BetaBillingErrorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BetaBillingErrorType? 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.BetaBillingErrorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BetaBillingErrorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BetaBillingErrorType? 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.BetaBillingErrorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaGatewayTimeoutErrorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaGatewayTimeoutErrorType.g.cs new file mode 100644 index 0000000..6ebb376 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaGatewayTimeoutErrorType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BetaGatewayTimeoutErrorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BetaGatewayTimeoutErrorType 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.BetaGatewayTimeoutErrorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BetaGatewayTimeoutErrorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BetaGatewayTimeoutErrorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.BetaGatewayTimeoutErrorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaGatewayTimeoutErrorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaGatewayTimeoutErrorTypeNullable.g.cs new file mode 100644 index 0000000..c33d38e --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaGatewayTimeoutErrorTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BetaGatewayTimeoutErrorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BetaGatewayTimeoutErrorType? 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.BetaGatewayTimeoutErrorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BetaGatewayTimeoutErrorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BetaGatewayTimeoutErrorType? 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.BetaGatewayTimeoutErrorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaInputContentBlock.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaInputContentBlock.g.cs index 150c297..5f573a0 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaInputContentBlock.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaInputContentBlock.g.cs @@ -49,11 +49,11 @@ public class BetaInputContentBlockJsonConverter : global::System.Text.Json.Seria throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaRequestToolResultBlock)}"); toolResult = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Anthropic.BetaRequestPDFBlock? document = default; + global::Anthropic.BetaRequestDocumentBlock? document = default; if (discriminator?.Type == global::Anthropic.BetaInputContentBlockDiscriminatorType.Document) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaRequestPDFBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaRequestPDFBlock)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaRequestDocumentBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaRequestDocumentBlock)}"); document = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -104,8 +104,8 @@ public override void Write( } else if (value.IsDocument) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaRequestPDFBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BetaRequestPDFBlock).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaRequestDocumentBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BetaRequestDocumentBlock).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Document, typeInfo); } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResultDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorType.g.cs similarity index 66% rename from src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResultDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorType.g.cs index cef2cd6..aafe380 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResultDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaMessageBatchResultDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class BetaMessageBatchIndividualResponseResultDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaMessageBatchResultDiscriminatorType Read( + public override global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaMessageBatchResultDiscriminatorTypeJsonConverter : globa var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaMessageBatchResultDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class BetaMessageBatchResultDiscriminatorTypeJsonConverter : globa case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaMessageBatchResultDiscriminatorType)numValue; + return (global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class BetaMessageBatchResultDiscriminatorTypeJsonConverter : globa /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaMessageBatchResultDiscriminatorType value, + global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.BetaMessageBatchResultDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResultDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorTypeNullable.g.cs similarity index 68% rename from src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResultDiscriminatorTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorTypeNullable.g.cs index e65cf98..56c93eb 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResultDiscriminatorTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaMessageBatchResultDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class BetaMessageBatchIndividualResponseResultDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaMessageBatchResultDiscriminatorType? Read( + public override global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaMessageBatchResultDiscriminatorTypeNullableJsonConverter var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaMessageBatchResultDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class BetaMessageBatchResultDiscriminatorTypeNullableJsonConverter case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaMessageBatchResultDiscriminatorType)numValue; + return (global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class BetaMessageBatchResultDiscriminatorTypeNullableJsonConverter /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaMessageBatchResultDiscriminatorType? value, + global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.BetaMessageBatchResultDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaModelResponseType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaModelResponseType.g.cs new file mode 100644 index 0000000..8e02225 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaModelResponseType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BetaModelResponseTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BetaModelResponseType 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.BetaModelResponseTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BetaModelResponseType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BetaModelResponseType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.BetaModelResponseTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaModelResponseTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaModelResponseTypeNullable.g.cs new file mode 100644 index 0000000..4147bba --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaModelResponseTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BetaModelResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BetaModelResponseType? 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.BetaModelResponseTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BetaModelResponseType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BetaModelResponseType? 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.BetaModelResponseTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorType.g.cs new file mode 100644 index 0000000..caeb1c1 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BetaRequestDocumentBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType 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.BetaRequestDocumentBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorTypeNullable.g.cs new file mode 100644 index 0000000..4d27500 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BetaRequestDocumentBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType? 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.BetaRequestDocumentBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType? 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.BetaRequestDocumentBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestImageBlockSourceDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorType.g.cs similarity index 65% rename from src/libs/Anthropic/Generated/JsonConverters.BetaRequestImageBlockSourceDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorType.g.cs index 719c164..0e9896b 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestImageBlockSourceDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaRequestImageBlockSourceDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class BetaRequestDocumentBlockSourceDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType Read( + public override global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaRequestImageBlockSourceDiscriminatorTypeJsonConverter : var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaRequestImageBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class BetaRequestImageBlockSourceDiscriminatorTypeJsonConverter : case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType)numValue; + return (global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class BetaRequestImageBlockSourceDiscriminatorTypeJsonConverter : /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType value, + global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.BetaRequestImageBlockSourceDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestImageBlockSourceDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorTypeNullable.g.cs similarity index 67% rename from src/libs/Anthropic/Generated/JsonConverters.BetaRequestImageBlockSourceDiscriminatorTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorTypeNullable.g.cs index 6d437c5..1f9b9f7 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestImageBlockSourceDiscriminatorTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaRequestImageBlockSourceDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class BetaRequestDocumentBlockSourceDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType? Read( + public override global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaRequestImageBlockSourceDiscriminatorTypeNullableJsonConv var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaRequestImageBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class BetaRequestImageBlockSourceDiscriminatorTypeNullableJsonConv case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType)numValue; + return (global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class BetaRequestImageBlockSourceDiscriminatorTypeNullableJsonConv /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType? value, + global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.BetaRequestImageBlockSourceDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageRole.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockType.g.cs similarity index 70% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageRole.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockType.g.cs index 42c8bc3..03f9375 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageRole.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaMessageRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class BetaRequestDocumentBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaMessageRole Read( + public override global::Anthropic.BetaRequestDocumentBlockType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaMessageRoleJsonConverter : global::System.T var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaMessageRoleExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.BetaRequestDocumentBlockTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaMessageRoleJsonConverter : global::System.T case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageRole)numValue; + return (global::Anthropic.BetaRequestDocumentBlockType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class PromptCachingBetaMessageRoleJsonConverter : global::System.T /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageRole value, + global::Anthropic.BetaRequestDocumentBlockType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.PromptCachingBetaMessageRoleExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.BetaRequestDocumentBlockTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageRoleNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockTypeNullable.g.cs similarity index 72% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageRoleNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockTypeNullable.g.cs index db24d78..94eb8cd 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageRoleNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.BetaRequestDocumentBlockTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class BetaRequestDocumentBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaMessageRole? Read( + public override global::Anthropic.BetaRequestDocumentBlockType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaMessageRoleNullableJsonConverter : global:: var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaMessageRoleExtensions.ToEnum(stringValue); + return global::Anthropic.BetaRequestDocumentBlockTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaMessageRoleNullableJsonConverter : global:: case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageRole)numValue; + return (global::Anthropic.BetaRequestDocumentBlockType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class PromptCachingBetaMessageRoleNullableJsonConverter : global:: /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageRole? value, + global::Anthropic.BetaRequestDocumentBlockType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.PromptCachingBetaMessageRoleExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.BetaRequestDocumentBlockTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BillingErrorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BillingErrorType.g.cs new file mode 100644 index 0000000..89c6798 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BillingErrorType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BillingErrorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BillingErrorType 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.BillingErrorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BillingErrorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BillingErrorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.BillingErrorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BillingErrorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.BillingErrorTypeNullable.g.cs new file mode 100644 index 0000000..4072baf --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.BillingErrorTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class BillingErrorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.BillingErrorType? 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.BillingErrorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.BillingErrorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.BillingErrorType? 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.BillingErrorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.CanceledResultType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.CanceledResultType.g.cs new file mode 100644 index 0000000..6e1fd16 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.CanceledResultType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class CanceledResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.CanceledResultType 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.CanceledResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.CanceledResultType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.CanceledResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.CanceledResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.CanceledResultTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.CanceledResultTypeNullable.g.cs new file mode 100644 index 0000000..899f0ab --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.CanceledResultTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class CanceledResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.CanceledResultType? 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.CanceledResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.CanceledResultType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.CanceledResultType? 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.CanceledResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item2.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item2.g.cs index 962e789..01bfd72 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item2.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item2.g.cs @@ -17,45 +17,29 @@ public class ContentVariant2Item2JsonConverter : global::System.Text.Json.Serial var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.InputMessageContentVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.InputMessageContentVariant2ItemDiscriminator)}"); + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); global::Anthropic.RequestTextBlock? text = default; - if (discriminator?.Type == global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType.Text) + if (discriminator?.Type == global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType.Text) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestTextBlock)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Anthropic.RequestImageBlock? image = default; - if (discriminator?.Type == global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType.Image) + if (discriminator?.Type == global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType.Image) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestImageBlock)}"); image = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Anthropic.RequestToolUseBlock? toolUse = default; - if (discriminator?.Type == global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType.ToolUse) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolUseBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestToolUseBlock)}"); - toolUse = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.RequestToolResultBlock? toolResult = default; - if (discriminator?.Type == global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType.ToolResult) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolResultBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestToolResultBlock)}"); - toolResult = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } var result = new global::Anthropic.ContentVariant2Item2( discriminator?.Type, text, - image, - toolUse, - toolResult + image ); return result; @@ -82,18 +66,6 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestImageBlock).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Image, typeInfo); } - else if (value.IsToolUse) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolUseBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestToolUseBlock).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.ToolUse, typeInfo); - } - else if (value.IsToolResult) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolResultBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestToolResultBlock).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.ToolResult, typeInfo); - } } } } \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item4.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item4.g.cs deleted file mode 100644 index d536f04..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item4.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Anthropic.JsonConverters -{ - /// - public class ContentVariant2Item4JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.ContentVariant2Item4 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator)}"); - var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - - global::Anthropic.PromptCachingBetaRequestTextBlock? text = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.Text) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaRequestTextBlock)}"); - text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.PromptCachingBetaRequestImageBlock? image = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.Image) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaRequestImageBlock)}"); - image = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - - var result = new global::Anthropic.ContentVariant2Item4( - discriminator?.Type, - text, - image - ); - - return result; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.ContentVariant2Item4 value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsText) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.PromptCachingBetaRequestTextBlock).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); - } - else if (value.IsImage) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.PromptCachingBetaRequestImageBlock).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Image, typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item5.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item5.g.cs deleted file mode 100644 index 167098a..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item5.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Anthropic.JsonConverters -{ - /// - public class ContentVariant2Item5JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.ContentVariant2Item5 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminator)}"); - var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - - global::Anthropic.RequestTextBlock? text = default; - if (discriminator?.Type == global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType.Text) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestTextBlock)}"); - text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.RequestImageBlock? image = default; - if (discriminator?.Type == global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType.Image) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestImageBlock)}"); - image = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - - var result = new global::Anthropic.ContentVariant2Item5( - discriminator?.Type, - text, - image - ); - - return result; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.ContentVariant2Item5 value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsText) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestTextBlock).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); - } - else if (value.IsImage) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestImageBlock).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Image, typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.Delta.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Delta.g.cs deleted file mode 100644 index 5ff81e5..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.Delta.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Anthropic.JsonConverters -{ - /// - public class DeltaJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.Delta Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminator)}"); - var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - - global::Anthropic.BetaTextContentBlockDelta? textDelta = default; - if (discriminator?.Type == global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType.TextDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaTextContentBlockDelta), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaTextContentBlockDelta)}"); - textDelta = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.BetaInputJsonContentBlockDelta? inputJsonDelta = default; - if (discriminator?.Type == global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType.InputJsonDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaInputJsonContentBlockDelta), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaInputJsonContentBlockDelta)}"); - inputJsonDelta = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - - var result = new global::Anthropic.Delta( - discriminator?.Type, - textDelta, - inputJsonDelta - ); - - return result; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.Delta value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsTextDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaTextContentBlockDelta), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BetaTextContentBlockDelta).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.TextDelta, typeInfo); - } - else if (value.IsInputJsonDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaInputJsonContentBlockDelta), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BetaInputJsonContentBlockDelta).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.InputJsonDelta, typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.Delta2.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Delta2.g.cs deleted file mode 100644 index ed7b6ad..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.Delta2.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Anthropic.JsonConverters -{ - /// - public class Delta2JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.Delta2 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ContentBlockDeltaEventDeltaDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.ContentBlockDeltaEventDeltaDiscriminator)}"); - var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - - global::Anthropic.TextContentBlockDelta? textDelta = default; - if (discriminator?.Type == global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType.TextDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.TextContentBlockDelta), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.TextContentBlockDelta)}"); - textDelta = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.InputJsonContentBlockDelta? inputJsonDelta = default; - if (discriminator?.Type == global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType.InputJsonDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.InputJsonContentBlockDelta), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.InputJsonContentBlockDelta)}"); - inputJsonDelta = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - - var result = new global::Anthropic.Delta2( - discriminator?.Type, - textDelta, - inputJsonDelta - ); - - return result; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.Delta2 value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsTextDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.TextContentBlockDelta), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.TextContentBlockDelta).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.TextDelta, typeInfo); - } - else if (value.IsInputJsonDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.InputJsonContentBlockDelta), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.InputJsonContentBlockDelta).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.InputJsonDelta, typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.Error.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Error.g.cs index 074b7e2..7e0181c 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.Error.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.Error.g.cs @@ -35,6 +35,13 @@ public class ErrorJsonConverter : global::System.Text.Json.Serialization.JsonCon throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaAuthenticationError)}"); authenticationError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::Anthropic.BetaBillingError? billingError = default; + if (discriminator?.Type == global::Anthropic.BetaErrorResponseErrorDiscriminatorType.BillingError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaBillingError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaBillingError)}"); + billingError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } global::Anthropic.BetaPermissionError? permissionError = default; if (discriminator?.Type == global::Anthropic.BetaErrorResponseErrorDiscriminatorType.PermissionError) { @@ -56,6 +63,13 @@ public class ErrorJsonConverter : global::System.Text.Json.Serialization.JsonCon throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaRateLimitError)}"); rateLimitError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::Anthropic.BetaGatewayTimeoutError? timeoutError = default; + if (discriminator?.Type == global::Anthropic.BetaErrorResponseErrorDiscriminatorType.TimeoutError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaGatewayTimeoutError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaGatewayTimeoutError)}"); + timeoutError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } global::Anthropic.BetaAPIError? apiError = default; if (discriminator?.Type == global::Anthropic.BetaErrorResponseErrorDiscriminatorType.ApiError) { @@ -75,9 +89,11 @@ public class ErrorJsonConverter : global::System.Text.Json.Serialization.JsonCon discriminator?.Type, invalidRequestError, authenticationError, + billingError, permissionError, notFoundError, rateLimitError, + timeoutError, apiError, overloadedError ); @@ -106,6 +122,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BetaAuthenticationError).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.AuthenticationError, typeInfo); } + else if (value.IsBillingError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaBillingError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BetaBillingError).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.BillingError, typeInfo); + } else if (value.IsPermissionError) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaPermissionError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? @@ -124,6 +146,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BetaRateLimitError).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.RateLimitError, typeInfo); } + else if (value.IsTimeoutError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaGatewayTimeoutError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BetaGatewayTimeoutError).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.TimeoutError, typeInfo); + } else if (value.IsApiError) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaAPIError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? diff --git a/src/libs/Anthropic/Generated/JsonConverters.Error2.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Error2.g.cs index f411733..4818df0 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.Error2.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.Error2.g.cs @@ -35,6 +35,13 @@ public class Error2JsonConverter : global::System.Text.Json.Serialization.JsonCo throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.AuthenticationError)}"); authenticationError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::Anthropic.BillingError? billingError = default; + if (discriminator?.Type == global::Anthropic.ErrorResponseErrorDiscriminatorType.BillingError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BillingError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BillingError)}"); + billingError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } global::Anthropic.PermissionError? permissionError = default; if (discriminator?.Type == global::Anthropic.ErrorResponseErrorDiscriminatorType.PermissionError) { @@ -56,6 +63,13 @@ public class Error2JsonConverter : global::System.Text.Json.Serialization.JsonCo throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RateLimitError)}"); rateLimitError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::Anthropic.GatewayTimeoutError? timeoutError = default; + if (discriminator?.Type == global::Anthropic.ErrorResponseErrorDiscriminatorType.TimeoutError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.GatewayTimeoutError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.GatewayTimeoutError)}"); + timeoutError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } global::Anthropic.APIError? apiError = default; if (discriminator?.Type == global::Anthropic.ErrorResponseErrorDiscriminatorType.ApiError) { @@ -75,9 +89,11 @@ public class Error2JsonConverter : global::System.Text.Json.Serialization.JsonCo discriminator?.Type, invalidRequestError, authenticationError, + billingError, permissionError, notFoundError, rateLimitError, + timeoutError, apiError, overloadedError ); @@ -106,6 +122,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.AuthenticationError).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.AuthenticationError, typeInfo); } + else if (value.IsBillingError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BillingError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.BillingError).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.BillingError, typeInfo); + } else if (value.IsPermissionError) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PermissionError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? @@ -124,6 +146,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RateLimitError).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.RateLimitError, typeInfo); } + else if (value.IsTimeoutError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.GatewayTimeoutError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.GatewayTimeoutError).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.TimeoutError, typeInfo); + } else if (value.IsApiError) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.APIError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? diff --git a/src/libs/Anthropic/Generated/JsonConverters.ErroredResultType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ErroredResultType.g.cs new file mode 100644 index 0000000..5d5ccf5 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ErroredResultType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ErroredResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ErroredResultType 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.ErroredResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ErroredResultType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ErroredResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.ErroredResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ErroredResultTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ErroredResultTypeNullable.g.cs new file mode 100644 index 0000000..7ae2263 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ErroredResultTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ErroredResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ErroredResultType? 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.ErroredResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ErroredResultType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ErroredResultType? 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.ErroredResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ExpiredResultType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ExpiredResultType.g.cs new file mode 100644 index 0000000..d11bed9 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ExpiredResultType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ExpiredResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ExpiredResultType 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.ExpiredResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ExpiredResultType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ExpiredResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.ExpiredResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ExpiredResultTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ExpiredResultTypeNullable.g.cs new file mode 100644 index 0000000..de70f4e --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ExpiredResultTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ExpiredResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ExpiredResultType? 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.ExpiredResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ExpiredResultType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ExpiredResultType? 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.ExpiredResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.GatewayTimeoutErrorType.g.cs similarity index 72% rename from src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.GatewayTimeoutErrorType.g.cs index 25fea1e..5103519 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.GatewayTimeoutErrorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaRequestPDFBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class GatewayTimeoutErrorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaRequestPDFBlockType Read( + public override global::Anthropic.GatewayTimeoutErrorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaRequestPDFBlockTypeJsonConverter : global::System.Text.J var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaRequestPDFBlockTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.GatewayTimeoutErrorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class BetaRequestPDFBlockTypeJsonConverter : global::System.Text.J case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaRequestPDFBlockType)numValue; + return (global::Anthropic.GatewayTimeoutErrorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class BetaRequestPDFBlockTypeJsonConverter : global::System.Text.J /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaRequestPDFBlockType value, + global::Anthropic.GatewayTimeoutErrorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.BetaRequestPDFBlockTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.GatewayTimeoutErrorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.GatewayTimeoutErrorTypeNullable.g.cs similarity index 73% rename from src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.GatewayTimeoutErrorTypeNullable.g.cs index 83093ba..238b683 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.GatewayTimeoutErrorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaRequestPDFBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class GatewayTimeoutErrorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaRequestPDFBlockType? Read( + public override global::Anthropic.GatewayTimeoutErrorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaRequestPDFBlockTypeNullableJsonConverter : global::Syste var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaRequestPDFBlockTypeExtensions.ToEnum(stringValue); + return global::Anthropic.GatewayTimeoutErrorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class BetaRequestPDFBlockTypeNullableJsonConverter : global::Syste case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaRequestPDFBlockType)numValue; + return (global::Anthropic.GatewayTimeoutErrorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class BetaRequestPDFBlockTypeNullableJsonConverter : global::Syste /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaRequestPDFBlockType? value, + global::Anthropic.GatewayTimeoutErrorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.BetaRequestPDFBlockTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.GatewayTimeoutErrorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item3.g.cs b/src/libs/Anthropic/Generated/JsonConverters.InputContentBlock.g.cs similarity index 52% rename from src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item3.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.InputContentBlock.g.cs index c7389c5..b8560c8 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.ContentVariant2Item3.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.InputContentBlock.g.cs @@ -4,10 +4,10 @@ namespace Anthropic.JsonConverters { /// - public class ContentVariant2Item3JsonConverter : global::System.Text.Json.Serialization.JsonConverter + public class InputContentBlockJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.ContentVariant2Item3 Read( + public override global::Anthropic.InputContentBlock Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -17,45 +17,53 @@ public class ContentVariant2Item3JsonConverter : global::System.Text.Json.Serial var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator)}"); + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.InputContentBlockDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.InputContentBlockDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Anthropic.PromptCachingBetaRequestTextBlock? text = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.Text) + global::Anthropic.RequestTextBlock? text = default; + if (discriminator?.Type == global::Anthropic.InputContentBlockDiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaRequestTextBlock)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestTextBlock)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Anthropic.PromptCachingBetaRequestImageBlock? image = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.Image) + global::Anthropic.RequestImageBlock? image = default; + if (discriminator?.Type == global::Anthropic.InputContentBlockDiscriminatorType.Image) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaRequestImageBlock)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestImageBlock)}"); image = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Anthropic.PromptCachingBetaRequestToolUseBlock? toolUse = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.ToolUse) + global::Anthropic.RequestToolUseBlock? toolUse = default; + if (discriminator?.Type == global::Anthropic.InputContentBlockDiscriminatorType.ToolUse) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestToolUseBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaRequestToolUseBlock)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolUseBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestToolUseBlock)}"); toolUse = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Anthropic.PromptCachingBetaRequestToolResultBlock? toolResult = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.ToolResult) + global::Anthropic.RequestToolResultBlock? toolResult = default; + if (discriminator?.Type == global::Anthropic.InputContentBlockDiscriminatorType.ToolResult) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestToolResultBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaRequestToolResultBlock)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolResultBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestToolResultBlock)}"); toolResult = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::Anthropic.RequestDocumentBlock? document = default; + if (discriminator?.Type == global::Anthropic.InputContentBlockDiscriminatorType.Document) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestDocumentBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.RequestDocumentBlock)}"); + document = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } - var result = new global::Anthropic.ContentVariant2Item3( + var result = new global::Anthropic.InputContentBlock( discriminator?.Type, text, image, toolUse, - toolResult + toolResult, + document ); return result; @@ -64,7 +72,7 @@ public class ContentVariant2Item3JsonConverter : global::System.Text.Json.Serial /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.ContentVariant2Item3 value, + global::Anthropic.InputContentBlock value, global::System.Text.Json.JsonSerializerOptions options) { options = options ?? throw new global::System.ArgumentNullException(nameof(options)); @@ -72,28 +80,34 @@ public override void Write( if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.PromptCachingBetaRequestTextBlock).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestTextBlock).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } else if (value.IsImage) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.PromptCachingBetaRequestImageBlock).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestImageBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestImageBlock).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Image, typeInfo); } else if (value.IsToolUse) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestToolUseBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.PromptCachingBetaRequestToolUseBlock).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolUseBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestToolUseBlock).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.ToolUse, typeInfo); } else if (value.IsToolResult) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaRequestToolResultBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.PromptCachingBetaRequestToolResultBlock).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestToolResultBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestToolResultBlock).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.ToolResult, typeInfo); } + else if (value.IsDocument) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.RequestDocumentBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.RequestDocumentBlock).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Document, typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStopReason.g.cs b/src/libs/Anthropic/Generated/JsonConverters.InputContentBlockDiscriminatorType.g.cs similarity index 69% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStopReason.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.InputContentBlockDiscriminatorType.g.cs index e52022c..b629b44 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStopReason.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.InputContentBlockDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaMessageStopReasonJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class InputContentBlockDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaMessageStopReason Read( + public override global::Anthropic.InputContentBlockDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaMessageStopReasonJsonConverter : global::Sy var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaMessageStopReasonExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.InputContentBlockDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaMessageStopReasonJsonConverter : global::Sy case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageStopReason)numValue; + return (global::Anthropic.InputContentBlockDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class PromptCachingBetaMessageStopReasonJsonConverter : global::Sy /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageStopReason value, + global::Anthropic.InputContentBlockDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.PromptCachingBetaMessageStopReasonExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.InputContentBlockDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStopReasonNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.InputContentBlockDiscriminatorTypeNullable.g.cs similarity index 71% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStopReasonNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.InputContentBlockDiscriminatorTypeNullable.g.cs index 2344fdc..93b40e8 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStopReasonNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.InputContentBlockDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaMessageStopReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class InputContentBlockDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaMessageStopReason? Read( + public override global::Anthropic.InputContentBlockDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaMessageStopReasonNullableJsonConverter : gl var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaMessageStopReasonExtensions.ToEnum(stringValue); + return global::Anthropic.InputContentBlockDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaMessageStopReasonNullableJsonConverter : gl case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageStopReason)numValue; + return (global::Anthropic.InputContentBlockDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class PromptCachingBetaMessageStopReasonNullableJsonConverter : gl /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageStopReason? value, + global::Anthropic.InputContentBlockDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.PromptCachingBetaMessageStopReasonExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.InputContentBlockDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.InputMessageContentVariant2ItemDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.InputMessageContentVariant2ItemDiscriminatorType.g.cs deleted file mode 100644 index 94ea22d..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.InputMessageContentVariant2ItemDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class InputMessageContentVariant2ItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType 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.InputMessageContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.InputMessageContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.InputMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.InputMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs deleted file mode 100644 index 74ee413..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.InputMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class InputMessageContentVariant2ItemDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType? 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.InputMessageContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType? 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.InputMessageContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.MessageBatchIndividualResponseResultDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchIndividualResponseResultDiscriminatorType.g.cs new file mode 100644 index 0000000..562c251 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchIndividualResponseResultDiscriminatorType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class MessageBatchIndividualResponseResultDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType 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.MessageBatchIndividualResponseResultDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.MessageBatchIndividualResponseResultDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchIndividualResponseResultDiscriminatorTypeNullable.g.cs new file mode 100644 index 0000000..34aa9b8 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchIndividualResponseResultDiscriminatorTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class MessageBatchIndividualResponseResultDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType? 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.MessageBatchIndividualResponseResultDiscriminatorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType? 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.MessageBatchIndividualResponseResultDiscriminatorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchProcessingStatus.g.cs similarity index 70% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.MessageBatchProcessingStatus.g.cs index f9603a4..b3ef467 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchProcessingStatus.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaMessageTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class MessageBatchProcessingStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaMessageType Read( + public override global::Anthropic.MessageBatchProcessingStatus Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaMessageTypeJsonConverter : global::System.T var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaMessageTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.MessageBatchProcessingStatusExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaMessageTypeJsonConverter : global::System.T case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageType)numValue; + return (global::Anthropic.MessageBatchProcessingStatus)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class PromptCachingBetaMessageTypeJsonConverter : global::System.T /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageType value, + global::Anthropic.MessageBatchProcessingStatus value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.PromptCachingBetaMessageTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.MessageBatchProcessingStatusExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchProcessingStatusNullable.g.cs similarity index 72% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.MessageBatchProcessingStatusNullable.g.cs index 76154c8..8a57d22 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchProcessingStatusNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaMessageTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class MessageBatchProcessingStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaMessageType? Read( + public override global::Anthropic.MessageBatchProcessingStatus? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaMessageTypeNullableJsonConverter : global:: var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaMessageTypeExtensions.ToEnum(stringValue); + return global::Anthropic.MessageBatchProcessingStatusExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaMessageTypeNullableJsonConverter : global:: case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageType)numValue; + return (global::Anthropic.MessageBatchProcessingStatus)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class PromptCachingBetaMessageTypeNullableJsonConverter : global:: /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageType? value, + global::Anthropic.MessageBatchProcessingStatus? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.PromptCachingBetaMessageTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.MessageBatchProcessingStatusExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.MessageBatchType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchType.g.cs new file mode 100644 index 0000000..ecc4a4a --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class MessageBatchTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.MessageBatchType 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.MessageBatchTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.MessageBatchType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.MessageBatchType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.MessageBatchTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.MessageBatchTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchTypeNullable.g.cs new file mode 100644 index 0000000..593b710 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.MessageBatchTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class MessageBatchTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.MessageBatchType? 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.MessageBatchTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.MessageBatchType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.MessageBatchType? 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.MessageBatchTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ModelResponseType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ModelResponseType.g.cs new file mode 100644 index 0000000..ca261d1 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ModelResponseType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ModelResponseTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ModelResponseType 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.ModelResponseTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ModelResponseType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ModelResponseType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.ModelResponseTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.ModelResponseTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ModelResponseTypeNullable.g.cs new file mode 100644 index 0000000..1f91161 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.ModelResponseTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class ModelResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.ModelResponseType? 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.ModelResponseTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.ModelResponseType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.ModelResponseType? 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.ModelResponseTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.g.cs deleted file mode 100644 index cc6dcb0..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType 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.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs deleted file mode 100644 index a7b0f9d..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType? 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.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType? 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.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStartEventType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStartEventType.g.cs deleted file mode 100644 index ba40ace..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStartEventType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaMessageStartEventTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaMessageStartEventType 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.PromptCachingBetaMessageStartEventTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageStartEventType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageStartEventType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaMessageStartEventTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStartEventTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStartEventTypeNullable.g.cs deleted file mode 100644 index 4cd7eab..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStartEventTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaMessageStartEventTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaMessageStartEventType? 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.PromptCachingBetaMessageStartEventTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageStartEventType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageStartEventType? 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.PromptCachingBetaMessageStartEventTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEvent.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEvent.g.cs deleted file mode 100644 index aa83131..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEvent.g.cs +++ /dev/null @@ -1,127 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Anthropic.JsonConverters -{ - /// - public class PromptCachingBetaMessageStreamEventJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaMessageStreamEvent Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminator)}"); - var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - - global::Anthropic.PromptCachingBetaMessageStartEvent? messageStart = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType.MessageStart) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaMessageStartEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.PromptCachingBetaMessageStartEvent)}"); - messageStart = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.MessageDeltaEvent? messageDelta = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType.MessageDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.MessageDeltaEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.MessageDeltaEvent)}"); - messageDelta = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.MessageStopEvent? messageStop = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType.MessageStop) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.MessageStopEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.MessageStopEvent)}"); - messageStop = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.ContentBlockStartEvent? contentBlockStart = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockStart) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ContentBlockStartEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.ContentBlockStartEvent)}"); - contentBlockStart = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.ContentBlockDeltaEvent? contentBlockDelta = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ContentBlockDeltaEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.ContentBlockDeltaEvent)}"); - contentBlockDelta = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Anthropic.ContentBlockStopEvent? contentBlockStop = default; - if (discriminator?.Type == global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType.ContentBlockStop) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ContentBlockStopEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.ContentBlockStopEvent)}"); - contentBlockStop = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - - var result = new global::Anthropic.PromptCachingBetaMessageStreamEvent( - discriminator?.Type, - messageStart, - messageDelta, - messageStop, - contentBlockStart, - contentBlockDelta, - contentBlockStop - ); - - return result; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageStreamEvent value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsMessageStart) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.PromptCachingBetaMessageStartEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.PromptCachingBetaMessageStartEvent).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageStart, typeInfo); - } - else if (value.IsMessageDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.MessageDeltaEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.MessageDeltaEvent).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageDelta, typeInfo); - } - else if (value.IsMessageStop) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.MessageStopEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.MessageStopEvent).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageStop, typeInfo); - } - else if (value.IsContentBlockStart) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ContentBlockStartEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.ContentBlockStartEvent).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.ContentBlockStart, typeInfo); - } - else if (value.IsContentBlockDelta) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ContentBlockDeltaEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.ContentBlockDeltaEvent).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.ContentBlockDelta, typeInfo); - } - else if (value.IsContentBlockStop) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ContentBlockStopEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.ContentBlockStopEvent).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.ContentBlockStop, typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorType.g.cs deleted file mode 100644 index 8336d1a..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaMessageStreamEventDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType 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.PromptCachingBetaMessageStreamEventDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorTypeNullable.g.cs deleted file mode 100644 index ccf3f02..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaMessageStreamEventDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType? 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.PromptCachingBetaMessageStreamEventDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType? 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.PromptCachingBetaMessageStreamEventDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType.g.cs deleted file mode 100644 index 88798db..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType 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.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeNullable.g.cs deleted file mode 100644 index 5c92d89..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType? 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.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType? 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.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorType.g.cs deleted file mode 100644 index 41a4cee..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType 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.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeNullable.g.cs deleted file mode 100644 index f7f2e5c..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType? 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.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType? 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.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockType.g.cs deleted file mode 100644 index 4aa6e7b..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestImageBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestImageBlockType 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.PromptCachingBetaRequestImageBlockTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestImageBlockType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestImageBlockType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestImageBlockTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockTypeNullable.g.cs deleted file mode 100644 index 07946e5..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestImageBlockTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestImageBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestImageBlockType? 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.PromptCachingBetaRequestImageBlockTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestImageBlockType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestImageBlockType? 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.PromptCachingBetaRequestImageBlockTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType.g.cs deleted file mode 100644 index e12e858..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType 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.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeNullable.g.cs deleted file mode 100644 index 87d3ce9..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType? 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.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType? 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.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockType.g.cs deleted file mode 100644 index 717ef62..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestTextBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestTextBlockType 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.PromptCachingBetaRequestTextBlockTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestTextBlockType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestTextBlockType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestTextBlockTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockTypeNullable.g.cs deleted file mode 100644 index 8d564ca..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestTextBlockTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestTextBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestTextBlockType? 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.PromptCachingBetaRequestTextBlockTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestTextBlockType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestTextBlockType? 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.PromptCachingBetaRequestTextBlockTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType.g.cs deleted file mode 100644 index b8754e7..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType 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.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeNullable.g.cs deleted file mode 100644 index 77159ea..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType? 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.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType? 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.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.g.cs deleted file mode 100644 index f4ee785..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType 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.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeNullable.g.cs deleted file mode 100644 index f050396..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? 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.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? 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.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType.g.cs deleted file mode 100644 index 616da8b..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType 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.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeNullable.g.cs deleted file mode 100644 index d2fb5b7..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType? 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.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType? 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.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockType.g.cs deleted file mode 100644 index e701537..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestToolUseBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestToolUseBlockType 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.PromptCachingBetaRequestToolUseBlockTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolUseBlockType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolUseBlockType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestToolUseBlockTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockTypeNullable.g.cs deleted file mode 100644 index a1fa15b..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolUseBlockTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaRequestToolUseBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaRequestToolUseBlockType? 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.PromptCachingBetaRequestToolUseBlockTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolUseBlockType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolUseBlockType? 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.PromptCachingBetaRequestToolUseBlockTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorType.g.cs deleted file mode 100644 index 90c0e57..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorType.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaToolCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType 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.PromptCachingBetaToolCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorTypeNullable.g.cs deleted file mode 100644 index 6a89c98..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorTypeNullable.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class PromptCachingBetaToolCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType? 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.PromptCachingBetaToolCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType? 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.PromptCachingBetaToolCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockCacheControlDiscriminatorType.g.cs similarity index 62% rename from src/libs/Anthropic/Generated/JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockCacheControlDiscriminatorType.g.cs index ebec803..1ee6aec 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockCacheControlDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestDocumentBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType Read( + public override global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverte var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class BetaContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverte case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType)numValue; + return (global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class BetaContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverte /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType value, + global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockCacheControlDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockCacheControlDiscriminatorTypeNullable.g.cs new file mode 100644 index 0000000..3733c58 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockCacheControlDiscriminatorTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class RequestDocumentBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType? 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.RequestDocumentBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType? 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.RequestDocumentBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockSourceDiscriminatorType.g.cs similarity index 67% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockSourceDiscriminatorType.g.cs index 4e30828..b89ebcb 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockSourceDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaRequestToolResultBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestDocumentBlockSourceDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaRequestToolResultBlockType Read( + public override global::Anthropic.RequestDocumentBlockSourceDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaRequestToolResultBlockTypeJsonConverter : g var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaRequestToolResultBlockTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.RequestDocumentBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaRequestToolResultBlockTypeJsonConverter : g case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolResultBlockType)numValue; + return (global::Anthropic.RequestDocumentBlockSourceDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class PromptCachingBetaRequestToolResultBlockTypeJsonConverter : g /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolResultBlockType value, + global::Anthropic.RequestDocumentBlockSourceDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestToolResultBlockTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.RequestDocumentBlockSourceDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockSourceDiscriminatorTypeNullable.g.cs similarity index 69% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockSourceDiscriminatorTypeNullable.g.cs index 8979ea0..8c6ab49 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaRequestToolResultBlockTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockSourceDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaRequestToolResultBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestDocumentBlockSourceDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaRequestToolResultBlockType? Read( + public override global::Anthropic.RequestDocumentBlockSourceDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaRequestToolResultBlockTypeNullableJsonConve var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaRequestToolResultBlockTypeExtensions.ToEnum(stringValue); + return global::Anthropic.RequestDocumentBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaRequestToolResultBlockTypeNullableJsonConve case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaRequestToolResultBlockType)numValue; + return (global::Anthropic.RequestDocumentBlockSourceDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class PromptCachingBetaRequestToolResultBlockTypeNullableJsonConve /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaRequestToolResultBlockType? value, + global::Anthropic.RequestDocumentBlockSourceDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.PromptCachingBetaRequestToolResultBlockTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.RequestDocumentBlockSourceDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockType.g.cs new file mode 100644 index 0000000..e320c44 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class RequestDocumentBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.RequestDocumentBlockType 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.RequestDocumentBlockTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.RequestDocumentBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.RequestDocumentBlockType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.RequestDocumentBlockTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockTypeNullable.g.cs new file mode 100644 index 0000000..0591990 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestDocumentBlockTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class RequestDocumentBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.RequestDocumentBlockType? 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.RequestDocumentBlockTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.RequestDocumentBlockType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.RequestDocumentBlockType? 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.RequestDocumentBlockTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockSourceDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockCacheControlDiscriminatorType.g.cs similarity index 69% rename from src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockSourceDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockCacheControlDiscriminatorType.g.cs index 94e8c18..91e08c9 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockSourceDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockCacheControlDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class RequestImageBlockSourceDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestImageBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.RequestImageBlockSourceDiscriminatorType Read( + public override global::Anthropic.RequestImageBlockCacheControlDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class RequestImageBlockSourceDiscriminatorTypeJsonConverter : glob var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.RequestImageBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.RequestImageBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class RequestImageBlockSourceDiscriminatorTypeJsonConverter : glob case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.RequestImageBlockSourceDiscriminatorType)numValue; + return (global::Anthropic.RequestImageBlockCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class RequestImageBlockSourceDiscriminatorTypeJsonConverter : glob /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.RequestImageBlockSourceDiscriminatorType value, + global::Anthropic.RequestImageBlockCacheControlDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.RequestImageBlockSourceDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.RequestImageBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockSourceDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockCacheControlDiscriminatorTypeNullable.g.cs similarity index 70% rename from src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockSourceDiscriminatorTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockCacheControlDiscriminatorTypeNullable.g.cs index 430f47d..3dce337 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockSourceDiscriminatorTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestImageBlockCacheControlDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class RequestImageBlockSourceDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestImageBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.RequestImageBlockSourceDiscriminatorType? Read( + public override global::Anthropic.RequestImageBlockCacheControlDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class RequestImageBlockSourceDiscriminatorTypeNullableJsonConverte var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.RequestImageBlockSourceDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Anthropic.RequestImageBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class RequestImageBlockSourceDiscriminatorTypeNullableJsonConverte case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.RequestImageBlockSourceDiscriminatorType)numValue; + return (global::Anthropic.RequestImageBlockCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class RequestImageBlockSourceDiscriminatorTypeNullableJsonConverte /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.RequestImageBlockSourceDiscriminatorType? value, + global::Anthropic.RequestImageBlockCacheControlDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.RequestImageBlockSourceDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.RequestImageBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestTextBlockCacheControlDiscriminatorType.g.cs similarity index 63% rename from src/libs/Anthropic/Generated/JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestTextBlockCacheControlDiscriminatorType.g.cs index e82ee68..5f0348b 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestTextBlockCacheControlDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class ContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestTextBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType Read( + public override global::Anthropic.RequestTextBlockCacheControlDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter : var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.RequestTextBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class ContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter : case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType)numValue; + return (global::Anthropic.RequestTextBlockCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class ContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter : /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType value, + global::Anthropic.RequestTextBlockCacheControlDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.RequestTextBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestTextBlockCacheControlDiscriminatorTypeNullable.g.cs similarity index 65% rename from src/libs/Anthropic/Generated/JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestTextBlockCacheControlDiscriminatorTypeNullable.g.cs index 8fb4670..9e1ca56 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestTextBlockCacheControlDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class ContentBlockDeltaEventDeltaDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestTextBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType? Read( + public override global::Anthropic.RequestTextBlockCacheControlDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ContentBlockDeltaEventDeltaDiscriminatorTypeNullableJsonConv var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Anthropic.RequestTextBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class ContentBlockDeltaEventDeltaDiscriminatorTypeNullableJsonConv case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType)numValue; + return (global::Anthropic.RequestTextBlockCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class ContentBlockDeltaEventDeltaDiscriminatorTypeNullableJsonConv /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType? value, + global::Anthropic.RequestTextBlockCacheControlDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.RequestTextBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.RequestToolResultBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestToolResultBlockCacheControlDiscriminatorType.g.cs new file mode 100644 index 0000000..35ad9f8 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestToolResultBlockCacheControlDiscriminatorType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class RequestToolResultBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType 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.RequestToolResultBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestToolResultBlockCacheControlDiscriminatorTypeNullable.g.cs similarity index 64% rename from src/libs/Anthropic/Generated/JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestToolResultBlockCacheControlDiscriminatorTypeNullable.g.cs index d68196b..4929e17 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestToolResultBlockCacheControlDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaContentBlockDeltaEventDeltaDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestToolResultBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType? Read( + public override global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaContentBlockDeltaEventDeltaDiscriminatorTypeNullableJson var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class BetaContentBlockDeltaEventDeltaDiscriminatorTypeNullableJson case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType)numValue; + return (global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class BetaContentBlockDeltaEventDeltaDiscriminatorTypeNullableJson /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType? value, + global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestToolUseBlockCacheControlDiscriminatorType.g.cs similarity index 75% rename from src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorType.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestToolUseBlockCacheControlDiscriminatorType.g.cs index 2d7ec2f..d574c85 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorType.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestToolUseBlockCacheControlDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaRequestPDFBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestToolUseBlockCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType Read( + public override global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaRequestPDFBlockCacheControlDiscriminatorTypeJsonConverte var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class BetaRequestPDFBlockCacheControlDiscriminatorTypeJsonConverte case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType)numValue; + return (global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class BetaRequestPDFBlockCacheControlDiscriminatorTypeJsonConverte /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType value, + global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.RequestToolUseBlockCacheControlDiscriminatorTypeNullable.g.cs similarity index 76% rename from src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorTypeNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.RequestToolUseBlockCacheControlDiscriminatorTypeNullable.g.cs index eec5938..a383779 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorTypeNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.RequestToolUseBlockCacheControlDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class BetaRequestPDFBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RequestToolUseBlockCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType? Read( + public override global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class BetaRequestPDFBlockCacheControlDiscriminatorTypeNullableJson var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class BetaRequestPDFBlockCacheControlDiscriminatorTypeNullableJson case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType)numValue; + return (global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class BetaRequestPDFBlockCacheControlDiscriminatorTypeNullableJson /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType? value, + global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResult.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Result.g.cs similarity index 88% rename from src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResult.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.Result.g.cs index 4c3aadf..270ae95 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.BetaMessageBatchResult.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.Result.g.cs @@ -4,10 +4,10 @@ namespace Anthropic.JsonConverters { /// - public class BetaMessageBatchResultJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public class ResultJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.BetaMessageBatchResult Read( + public override global::Anthropic.Result Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -17,40 +17,40 @@ public class BetaMessageBatchResultJsonConverter : global::System.Text.Json.Seri var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaMessageBatchResultDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaMessageBatchResultDiscriminator)}"); + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); global::Anthropic.BetaSucceededResult? succeeded = default; - if (discriminator?.Type == global::Anthropic.BetaMessageBatchResultDiscriminatorType.Succeeded) + if (discriminator?.Type == global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType.Succeeded) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaSucceededResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaSucceededResult)}"); succeeded = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Anthropic.BetaErroredResult? errored = default; - if (discriminator?.Type == global::Anthropic.BetaMessageBatchResultDiscriminatorType.Errored) + if (discriminator?.Type == global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType.Errored) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaErroredResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaErroredResult)}"); errored = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Anthropic.BetaCanceledResult? canceled = default; - if (discriminator?.Type == global::Anthropic.BetaMessageBatchResultDiscriminatorType.Canceled) + if (discriminator?.Type == global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType.Canceled) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaCanceledResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaCanceledResult)}"); canceled = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Anthropic.BetaExpiredResult? expired = default; - if (discriminator?.Type == global::Anthropic.BetaMessageBatchResultDiscriminatorType.Expired) + if (discriminator?.Type == global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType.Expired) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.BetaExpiredResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.BetaExpiredResult)}"); expired = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - var result = new global::Anthropic.BetaMessageBatchResult( + var result = new global::Anthropic.Result( discriminator?.Type, succeeded, errored, @@ -64,7 +64,7 @@ public class BetaMessageBatchResultJsonConverter : global::System.Text.Json.Seri /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.BetaMessageBatchResult value, + global::Anthropic.Result value, global::System.Text.Json.JsonSerializerOptions options) { options = options ?? throw new global::System.ArgumentNullException(nameof(options)); diff --git a/src/libs/Anthropic/Generated/JsonConverters.Result2.g.cs b/src/libs/Anthropic/Generated/JsonConverters.Result2.g.cs new file mode 100644 index 0000000..1bb0162 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.Result2.g.cs @@ -0,0 +1,99 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Anthropic.JsonConverters +{ + /// + public class Result2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.Result2 Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + var readerCopy = reader; + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.MessageBatchIndividualResponseResultDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.MessageBatchIndividualResponseResultDiscriminator)}"); + var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); + + global::Anthropic.SucceededResult? succeeded = default; + if (discriminator?.Type == global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType.Succeeded) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.SucceededResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.SucceededResult)}"); + succeeded = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Anthropic.ErroredResult? errored = default; + if (discriminator?.Type == global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType.Errored) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ErroredResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.ErroredResult)}"); + errored = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Anthropic.CanceledResult? canceled = default; + if (discriminator?.Type == global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType.Canceled) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.CanceledResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.CanceledResult)}"); + canceled = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Anthropic.ExpiredResult? expired = default; + if (discriminator?.Type == global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType.Expired) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ExpiredResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Anthropic.ExpiredResult)}"); + expired = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + var result = new global::Anthropic.Result2( + discriminator?.Type, + succeeded, + errored, + canceled, + expired + ); + + return result; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.Result2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsSucceeded) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.SucceededResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.SucceededResult).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Succeeded, typeInfo); + } + else if (value.IsErrored) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ErroredResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.ErroredResult).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Errored, typeInfo); + } + else if (value.IsCanceled) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.CanceledResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.CanceledResult).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Canceled, typeInfo); + } + else if (value.IsExpired) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Anthropic.ExpiredResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Anthropic.ExpiredResult).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Expired, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Anthropic/Generated/JsonConverters.SucceededResultType.g.cs b/src/libs/Anthropic/Generated/JsonConverters.SucceededResultType.g.cs new file mode 100644 index 0000000..3be2fd5 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.SucceededResultType.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class SucceededResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.SucceededResultType 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.SucceededResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.SucceededResultType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.SucceededResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Anthropic.SucceededResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.SucceededResultTypeNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.SucceededResultTypeNullable.g.cs new file mode 100644 index 0000000..84f7817 --- /dev/null +++ b/src/libs/Anthropic/Generated/JsonConverters.SucceededResultTypeNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Anthropic.JsonConverters +{ + /// + public sealed class SucceededResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Anthropic.SucceededResultType? 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.SucceededResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Anthropic.SucceededResultType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Anthropic.SucceededResultType? 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.SucceededResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageRole.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ToolCacheControlDiscriminatorType.g.cs similarity index 69% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageRole.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.ToolCacheControlDiscriminatorType.g.cs index f58f89c..97d7a79 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageRole.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.ToolCacheControlDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaInputMessageRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ToolCacheControlDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaInputMessageRole Read( + public override global::Anthropic.ToolCacheControlDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaInputMessageRoleJsonConverter : global::Sys var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaInputMessageRoleExtensions.ToEnum(stringValue) ?? default; + return global::Anthropic.ToolCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaInputMessageRoleJsonConverter : global::Sys case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaInputMessageRole)numValue; + return (global::Anthropic.ToolCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,12 +38,12 @@ public sealed class PromptCachingBetaInputMessageRoleJsonConverter : global::Sys /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaInputMessageRole value, + global::Anthropic.ToolCacheControlDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Anthropic.PromptCachingBetaInputMessageRoleExtensions.ToValueString(value)); + writer.WriteStringValue(global::Anthropic.ToolCacheControlDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageRoleNullable.g.cs b/src/libs/Anthropic/Generated/JsonConverters.ToolCacheControlDiscriminatorTypeNullable.g.cs similarity index 71% rename from src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageRoleNullable.g.cs rename to src/libs/Anthropic/Generated/JsonConverters.ToolCacheControlDiscriminatorTypeNullable.g.cs index b065196..5991519 100644 --- a/src/libs/Anthropic/Generated/JsonConverters.PromptCachingBetaInputMessageRoleNullable.g.cs +++ b/src/libs/Anthropic/Generated/JsonConverters.ToolCacheControlDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Anthropic.JsonConverters { /// - public sealed class PromptCachingBetaInputMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ToolCacheControlDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Anthropic.PromptCachingBetaInputMessageRole? Read( + public override global::Anthropic.ToolCacheControlDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class PromptCachingBetaInputMessageRoleNullableJsonConverter : glo var stringValue = reader.GetString(); if (stringValue != null) { - return global::Anthropic.PromptCachingBetaInputMessageRoleExtensions.ToEnum(stringValue); + return global::Anthropic.ToolCacheControlDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,7 +26,7 @@ public sealed class PromptCachingBetaInputMessageRoleNullableJsonConverter : glo case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Anthropic.PromptCachingBetaInputMessageRole)numValue; + return (global::Anthropic.ToolCacheControlDiscriminatorType)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -38,7 +38,7 @@ public sealed class PromptCachingBetaInputMessageRoleNullableJsonConverter : glo /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Anthropic.PromptCachingBetaInputMessageRole? value, + global::Anthropic.ToolCacheControlDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -49,7 +49,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Anthropic.PromptCachingBetaInputMessageRoleExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Anthropic.ToolCacheControlDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs b/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs index 04caeae..2c60e3c 100644 --- a/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs +++ b/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs @@ -21,6 +21,10 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.Base64ImageSourceTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.Base64ImageSourceMediaTypeJsonConverter), typeof(global::Anthropic.JsonConverters.Base64ImageSourceMediaTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.Base64PDFSourceTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.Base64PDFSourceTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.Base64PDFSourceMediaTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.Base64PDFSourceMediaTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaAPIErrorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaAPIErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaAuthenticationErrorTypeJsonConverter), @@ -41,6 +45,8 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaBashTool20241022TypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaBashTool20241022NameJsonConverter), typeof(global::Anthropic.JsonConverters.BetaBashTool20241022NameNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaBillingErrorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaBillingErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaCanceledResultTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaCanceledResultTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaComputerUseTool20241022CacheControlDiscriminatorTypeJsonConverter), @@ -55,8 +61,6 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaTextContentBlockDeltaTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaInputJsonContentBlockDeltaTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaInputJsonContentBlockDeltaTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaContentBlockDeltaEventDeltaDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaContentBlockStartEventTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaContentBlockStartEventTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaResponseTextBlockTypeJsonConverter), @@ -97,8 +101,6 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaRequestImageBlockCacheControlDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRequestImageBlockTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRequestImageBlockTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaRequestImageBlockSourceDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaRequestImageBlockSourceDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRequestToolUseBlockCacheControlDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRequestToolUseBlockCacheControlDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRequestToolUseBlockTypeJsonConverter), @@ -109,10 +111,12 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaRequestToolResultBlockTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaRequestPDFBlockCacheControlDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaRequestPDFBlockTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaRequestPDFBlockTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockCacheControlDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaRequestDocumentBlockSourceDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaInputContentBlockDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaInputContentBlockDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ModelEnumJsonConverter), @@ -129,6 +133,8 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaNotFoundErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRateLimitErrorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaRateLimitErrorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaGatewayTimeoutErrorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaGatewayTimeoutErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaOverloadedErrorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaOverloadedErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaErrorResponseErrorDiscriminatorTypeJsonConverter), @@ -143,6 +149,8 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaMessageBatchTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageBatchProcessingStatusJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageBatchProcessingStatusNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaModelResponseTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaModelResponseTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageRoleJsonConverter), @@ -153,8 +161,8 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaMessageStopReasonNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaSucceededResultTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaSucceededResultTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaMessageBatchResultDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaMessageBatchResultDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BetaMessageBatchIndividualResponseResultDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageDeltaStopReasonJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageDeltaStopReasonNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageDeltaEventTypeJsonConverter), @@ -165,8 +173,12 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BetaMessageStopEventTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageStreamEventDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageStreamEventDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.BillingErrorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.BillingErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.CacheControlEphemeralTypeJsonConverter), typeof(global::Anthropic.JsonConverters.CacheControlEphemeralTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.CanceledResultTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.CanceledResultTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.CompletionResponseTypeJsonConverter), typeof(global::Anthropic.JsonConverters.CompletionResponseTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ContentBlockDeltaEventTypeJsonConverter), @@ -175,8 +187,6 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.TextContentBlockDeltaTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.InputJsonContentBlockDeltaTypeJsonConverter), typeof(global::Anthropic.JsonConverters.InputJsonContentBlockDeltaTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.ContentBlockDeltaEventDeltaDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ContentBlockStartEventTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ContentBlockStartEventTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ResponseTextBlockTypeJsonConverter), @@ -187,30 +197,44 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.ContentBlockStartEventContentBlockDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ContentBlockStopEventTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ContentBlockStopEventTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolChoiceAutoTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolChoiceAutoTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolChoiceAnyTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolChoiceAnyTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolChoiceToolTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolChoiceToolTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolChoiceDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolChoiceDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolCacheControlDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ToolCacheControlDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.InputMessageRoleJsonConverter), typeof(global::Anthropic.JsonConverters.InputMessageRoleNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestTextBlockCacheControlDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestTextBlockCacheControlDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.RequestTextBlockTypeJsonConverter), typeof(global::Anthropic.JsonConverters.RequestTextBlockTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestImageBlockCacheControlDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestImageBlockCacheControlDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.RequestImageBlockTypeJsonConverter), typeof(global::Anthropic.JsonConverters.RequestImageBlockTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.RequestImageBlockSourceDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.RequestImageBlockSourceDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestToolUseBlockCacheControlDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestToolUseBlockCacheControlDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.RequestToolUseBlockTypeJsonConverter), typeof(global::Anthropic.JsonConverters.RequestToolUseBlockTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestToolResultBlockCacheControlDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestToolResultBlockCacheControlDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.RequestToolResultBlockTypeJsonConverter), typeof(global::Anthropic.JsonConverters.RequestToolResultBlockTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.RequestToolResultBlockContentVariant2ItemDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.RequestToolResultBlockContentVariant2ItemDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.InputMessageContentVariant2ItemDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.InputMessageContentVariant2ItemDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.ToolChoiceAutoTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.ToolChoiceAutoTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.ToolChoiceAnyTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.ToolChoiceAnyTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.ToolChoiceToolTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.ToolChoiceToolTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.ToolChoiceDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.ToolChoiceDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestDocumentBlockCacheControlDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestDocumentBlockCacheControlDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestDocumentBlockTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestDocumentBlockTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestDocumentBlockSourceDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.RequestDocumentBlockSourceDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.InputContentBlockDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.InputContentBlockDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ErrorResponseTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ErrorResponseTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.InvalidRequestErrorTypeJsonConverter), @@ -221,12 +245,24 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.NotFoundErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.RateLimitErrorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.RateLimitErrorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.GatewayTimeoutErrorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.GatewayTimeoutErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.OverloadedErrorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.OverloadedErrorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.ErrorResponseErrorDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.ErrorResponseErrorDiscriminatorTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ErroredResultTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ErroredResultTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ExpiredResultTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ExpiredResultTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.InputSchemaTypeJsonConverter), typeof(global::Anthropic.JsonConverters.InputSchemaTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.MessageBatchTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.MessageBatchTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.MessageBatchProcessingStatusJsonConverter), + typeof(global::Anthropic.JsonConverters.MessageBatchProcessingStatusNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.ModelResponseTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.ModelResponseTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageTypeJsonConverter), typeof(global::Anthropic.JsonConverters.MessageTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageRoleJsonConverter), @@ -235,6 +271,10 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.ContentBlockDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageStopReasonJsonConverter), typeof(global::Anthropic.JsonConverters.MessageStopReasonNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.SucceededResultTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.SucceededResultTypeNullableJsonConverter), + typeof(global::Anthropic.JsonConverters.MessageBatchIndividualResponseResultDiscriminatorTypeJsonConverter), + typeof(global::Anthropic.JsonConverters.MessageBatchIndividualResponseResultDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageDeltaStopReasonJsonConverter), typeof(global::Anthropic.JsonConverters.MessageDeltaStopReasonNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageDeltaEventTypeJsonConverter), @@ -247,45 +287,8 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.PingTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageStreamEventDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.MessageStreamEventDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaInputMessageRoleJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaInputMessageRoleNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestTextBlockTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestTextBlockTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestImageBlockSourceDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolUseBlockTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolUseBlockTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaToolCacheControlDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageRoleJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageRoleNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStopReasonJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStopReasonNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStartEventTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStartEventTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorTypeJsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStreamEventDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.AnthropicBetaEnumJsonConverter), typeof(global::Anthropic.JsonConverters.AnthropicBetaEnumNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.DeltaJsonConverter), typeof(global::Anthropic.JsonConverters.ContentBlockJsonConverter), typeof(global::Anthropic.JsonConverters.BetaToolChoiceJsonConverter), typeof(global::Anthropic.JsonConverters.ToolsItemJsonConverter), @@ -295,30 +298,27 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.ToolsItem2JsonConverter), typeof(global::Anthropic.JsonConverters.ErrorJsonConverter), typeof(global::Anthropic.JsonConverters.BetaContentBlockJsonConverter), - typeof(global::Anthropic.JsonConverters.BetaMessageBatchResultJsonConverter), + typeof(global::Anthropic.JsonConverters.ResultJsonConverter), typeof(global::Anthropic.JsonConverters.BetaMessageStreamEventJsonConverter), - typeof(global::Anthropic.JsonConverters.Delta2JsonConverter), typeof(global::Anthropic.JsonConverters.ContentBlock2JsonConverter), - typeof(global::Anthropic.JsonConverters.ContentVariant2Item2JsonConverter), - typeof(global::Anthropic.JsonConverters.ContentVariant2Item5JsonConverter), typeof(global::Anthropic.JsonConverters.ToolChoiceJsonConverter), + typeof(global::Anthropic.JsonConverters.InputContentBlockJsonConverter), + typeof(global::Anthropic.JsonConverters.ContentVariant2Item2JsonConverter), typeof(global::Anthropic.JsonConverters.Error2JsonConverter), typeof(global::Anthropic.JsonConverters.ContentBlock3JsonConverter), + typeof(global::Anthropic.JsonConverters.Result2JsonConverter), typeof(global::Anthropic.JsonConverters.MessageStreamEventJsonConverter), - typeof(global::Anthropic.JsonConverters.ContentVariant2Item3JsonConverter), - typeof(global::Anthropic.JsonConverters.ContentVariant2Item4JsonConverter), - typeof(global::Anthropic.JsonConverters.PromptCachingBetaMessageStreamEventJsonConverter), typeof(global::Anthropic.JsonConverters.AnthropicBetaJsonConverter), + typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter), typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), + typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter), + typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), - typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), - typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), - typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), - typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), + typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter>), typeof(global::Anthropic.JsonConverters.UnixTimestampJsonConverter), })] diff --git a/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs b/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs index 6027685..97edb2d 100644 --- a/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs +++ b/src/libs/Anthropic/Generated/JsonSerializerContextTypes.g.cs @@ -54,1322 +54,1338 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Anthropic.BetaAPIError? Type9 { get; set; } + public global::Anthropic.Base64PDFSource? Type9 { get; set; } /// /// /// - public global::Anthropic.BetaAPIErrorType? Type10 { get; set; } + public global::Anthropic.Base64PDFSourceType? Type10 { get; set; } /// /// /// - public global::Anthropic.BetaAuthenticationError? Type11 { get; set; } + public global::Anthropic.Base64PDFSourceMediaType? Type11 { get; set; } /// /// /// - public global::Anthropic.BetaAuthenticationErrorType? Type12 { get; set; } + public global::Anthropic.BetaAPIError? Type12 { get; set; } /// /// /// - public global::Anthropic.BetaBase64ImageSource? Type13 { get; set; } + public global::Anthropic.BetaAPIErrorType? Type13 { get; set; } /// /// /// - public global::Anthropic.BetaBase64ImageSourceType? Type14 { get; set; } + public global::Anthropic.BetaAuthenticationError? Type14 { get; set; } /// /// /// - public global::Anthropic.BetaBase64ImageSourceMediaType? Type15 { get; set; } + public global::Anthropic.BetaAuthenticationErrorType? Type15 { get; set; } /// /// /// - public global::Anthropic.BetaBase64PDFSource? Type16 { get; set; } + public global::Anthropic.BetaBase64ImageSource? Type16 { get; set; } /// /// /// - public global::Anthropic.BetaBase64PDFSourceType? Type17 { get; set; } + public global::Anthropic.BetaBase64ImageSourceType? Type17 { get; set; } /// /// /// - public global::Anthropic.BetaBase64PDFSourceMediaType? Type18 { get; set; } + public global::Anthropic.BetaBase64ImageSourceMediaType? Type18 { get; set; } /// /// /// - public global::Anthropic.BetaBashTool20241022? Type19 { get; set; } + public global::Anthropic.BetaBase64PDFSource? Type19 { get; set; } /// /// /// - public global::Anthropic.BetaCacheControlEphemeral? Type20 { get; set; } + public global::Anthropic.BetaBase64PDFSourceType? Type20 { get; set; } /// /// /// - public global::Anthropic.BetaCacheControlEphemeralType? Type21 { get; set; } + public global::Anthropic.BetaBase64PDFSourceMediaType? Type21 { get; set; } /// /// /// - public global::Anthropic.BetaBashTool20241022CacheControlDiscriminator? Type22 { get; set; } + public global::Anthropic.BetaBashTool20241022? Type22 { get; set; } /// /// /// - public global::Anthropic.BetaBashTool20241022CacheControlDiscriminatorType? Type23 { get; set; } + public global::Anthropic.BetaCacheControlEphemeral? Type23 { get; set; } /// /// /// - public global::Anthropic.BetaBashTool20241022Type? Type24 { get; set; } + public global::Anthropic.BetaCacheControlEphemeralType? Type24 { get; set; } /// /// /// - public global::Anthropic.BetaBashTool20241022Name? Type25 { get; set; } + public global::Anthropic.BetaBashTool20241022CacheControlDiscriminator? Type25 { get; set; } /// /// /// - public global::Anthropic.BetaCanceledResult? Type26 { get; set; } + public global::Anthropic.BetaBashTool20241022CacheControlDiscriminatorType? Type26 { get; set; } /// /// /// - public global::Anthropic.BetaCanceledResultType? Type27 { get; set; } + public global::Anthropic.BetaBashTool20241022Type? Type27 { get; set; } /// /// /// - public global::Anthropic.BetaComputerUseTool20241022? Type28 { get; set; } + public global::Anthropic.BetaBashTool20241022Name? Type28 { get; set; } /// /// /// - public global::Anthropic.BetaComputerUseTool20241022CacheControlDiscriminator? Type29 { get; set; } + public global::Anthropic.BetaBillingError? Type29 { get; set; } /// /// /// - public global::Anthropic.BetaComputerUseTool20241022CacheControlDiscriminatorType? Type30 { get; set; } + public global::Anthropic.BetaBillingErrorType? Type30 { get; set; } /// /// /// - public global::Anthropic.BetaComputerUseTool20241022Type? Type31 { get; set; } + public global::Anthropic.BetaCanceledResult? Type31 { get; set; } /// /// /// - public global::Anthropic.BetaComputerUseTool20241022Name? Type32 { get; set; } + public global::Anthropic.BetaCanceledResultType? Type32 { get; set; } /// /// /// - public int? Type33 { get; set; } + public global::Anthropic.BetaComputerUseTool20241022? Type33 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockDeltaEvent? Type34 { get; set; } + public global::Anthropic.BetaComputerUseTool20241022CacheControlDiscriminator? Type34 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockDeltaEventType? Type35 { get; set; } + public global::Anthropic.BetaComputerUseTool20241022CacheControlDiscriminatorType? Type35 { get; set; } /// /// /// - public global::Anthropic.Delta? Type36 { get; set; } + public global::Anthropic.BetaComputerUseTool20241022Type? Type36 { get; set; } /// /// /// - public global::Anthropic.BetaTextContentBlockDelta? Type37 { get; set; } + public global::Anthropic.BetaComputerUseTool20241022Name? Type37 { get; set; } /// /// /// - public global::Anthropic.BetaTextContentBlockDeltaType? Type38 { get; set; } + public int? Type38 { get; set; } /// /// /// - public global::Anthropic.BetaInputJsonContentBlockDelta? Type39 { get; set; } + public global::Anthropic.BetaContentBlockDeltaEvent? Type39 { get; set; } /// /// /// - public global::Anthropic.BetaInputJsonContentBlockDeltaType? Type40 { get; set; } + public global::Anthropic.BetaContentBlockDeltaEventType? Type40 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminator? Type41 { get; set; } + public global::Anthropic.AnyOf? Type41 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockDeltaEventDeltaDiscriminatorType? Type42 { get; set; } + public global::Anthropic.BetaTextContentBlockDelta? Type42 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockStartEvent? Type43 { get; set; } + public global::Anthropic.BetaTextContentBlockDeltaType? Type43 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockStartEventType? Type44 { get; set; } + public global::Anthropic.BetaInputJsonContentBlockDelta? Type44 { get; set; } /// /// /// - public global::Anthropic.ContentBlock? Type45 { get; set; } + public global::Anthropic.BetaInputJsonContentBlockDeltaType? Type45 { get; set; } /// /// /// - public global::Anthropic.BetaResponseTextBlock? Type46 { get; set; } + public global::Anthropic.BetaContentBlockStartEvent? Type46 { get; set; } /// /// /// - public global::Anthropic.BetaResponseTextBlockType? Type47 { get; set; } + public global::Anthropic.BetaContentBlockStartEventType? Type47 { get; set; } /// /// /// - public global::Anthropic.BetaResponseToolUseBlock? Type48 { get; set; } + public global::Anthropic.ContentBlock? Type48 { get; set; } /// /// /// - public global::Anthropic.BetaResponseToolUseBlockType? Type49 { get; set; } + public global::Anthropic.BetaResponseTextBlock? Type49 { get; set; } /// /// /// - public object? Type50 { get; set; } + public global::Anthropic.BetaResponseTextBlockType? Type50 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockStartEventContentBlockDiscriminator? Type51 { get; set; } + public global::Anthropic.BetaResponseToolUseBlock? Type51 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockStartEventContentBlockDiscriminatorType? Type52 { get; set; } + public global::Anthropic.BetaResponseToolUseBlockType? Type52 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockStopEvent? Type53 { get; set; } + public object? Type53 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockStopEventType? Type54 { get; set; } + public global::Anthropic.BetaContentBlockStartEventContentBlockDiscriminator? Type54 { get; set; } /// /// /// - public global::Anthropic.BetaCountMessageTokensParams? Type55 { get; set; } + public global::Anthropic.BetaContentBlockStartEventContentBlockDiscriminatorType? Type55 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoice? Type56 { get; set; } + public global::Anthropic.BetaContentBlockStopEvent? Type56 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoiceAuto? Type57 { get; set; } + public global::Anthropic.BetaContentBlockStopEventType? Type57 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoiceAutoType? Type58 { get; set; } + public global::Anthropic.BetaCountMessageTokensParams? Type58 { get; set; } /// /// /// - public bool? Type59 { get; set; } + public global::Anthropic.BetaToolChoice? Type59 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoiceAny? Type60 { get; set; } + public global::Anthropic.BetaToolChoiceAuto? Type60 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoiceAnyType? Type61 { get; set; } + public global::Anthropic.BetaToolChoiceAutoType? Type61 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoiceTool? Type62 { get; set; } + public bool? Type62 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoiceToolType? Type63 { get; set; } + public global::Anthropic.BetaToolChoiceAny? Type63 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoiceDiscriminator? Type64 { get; set; } + public global::Anthropic.BetaToolChoiceAnyType? Type64 { get; set; } /// /// /// - public global::Anthropic.BetaToolChoiceDiscriminatorType? Type65 { get; set; } + public global::Anthropic.BetaToolChoiceTool? Type65 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type66 { get; set; } + public global::Anthropic.BetaToolChoiceToolType? Type66 { get; set; } /// /// /// - public global::Anthropic.ToolsItem? Type67 { get; set; } + public global::Anthropic.BetaToolChoiceDiscriminator? Type67 { get; set; } /// /// /// - public global::Anthropic.BetaTool? Type68 { get; set; } + public global::Anthropic.BetaToolChoiceDiscriminatorType? Type68 { get; set; } /// /// /// - public global::Anthropic.BetaToolType? Type69 { get; set; } + public global::System.Collections.Generic.IList? Type69 { get; set; } /// /// /// - public global::Anthropic.BetaToolCacheControlDiscriminator? Type70 { get; set; } + public global::Anthropic.ToolsItem? Type70 { get; set; } /// /// /// - public global::Anthropic.BetaToolCacheControlDiscriminatorType? Type71 { get; set; } + public global::Anthropic.BetaTool? Type71 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022? Type72 { get; set; } + public global::Anthropic.BetaToolType? Type72 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022CacheControlDiscriminator? Type73 { get; set; } + public global::Anthropic.BetaToolCacheControlDiscriminator? Type73 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022CacheControlDiscriminatorType? Type74 { get; set; } + public global::Anthropic.BetaToolCacheControlDiscriminatorType? Type74 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022Type? Type75 { get; set; } + public global::Anthropic.BetaTextEditor20241022? Type75 { get; set; } /// /// /// - public global::Anthropic.BetaTextEditor20241022Name? Type76 { get; set; } + public global::Anthropic.BetaTextEditor20241022CacheControlDiscriminator? Type76 { get; set; } /// /// /// - public global::Anthropic.BetaCountMessageTokensParamsToolDiscriminator? Type77 { get; set; } + public global::Anthropic.BetaTextEditor20241022CacheControlDiscriminatorType? Type77 { get; set; } /// /// /// - public global::Anthropic.BetaCountMessageTokensParamsToolDiscriminatorType? Type78 { get; set; } + public global::Anthropic.BetaTextEditor20241022Type? Type78 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type79 { get; set; } + public global::Anthropic.BetaTextEditor20241022Name? Type79 { get; set; } /// /// /// - public global::Anthropic.BetaInputMessage? Type80 { get; set; } + public global::Anthropic.BetaCountMessageTokensParamsToolDiscriminator? Type80 { get; set; } /// /// /// - public global::Anthropic.BetaInputMessageRole? Type81 { get; set; } + public global::Anthropic.BetaCountMessageTokensParamsToolDiscriminatorType? Type81 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type82 { get; set; } + public global::System.Collections.Generic.IList? Type82 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type83 { get; set; } + public global::Anthropic.BetaInputMessage? Type83 { get; set; } /// /// /// - public global::Anthropic.BetaInputContentBlock? Type84 { get; set; } + public global::Anthropic.BetaInputMessageRole? Type84 { get; set; } /// /// /// - public global::Anthropic.BetaRequestTextBlock? Type85 { get; set; } + public global::Anthropic.AnyOf>? Type85 { get; set; } /// /// /// - public global::Anthropic.BetaRequestTextBlockCacheControlDiscriminator? Type86 { get; set; } + public global::System.Collections.Generic.IList? Type86 { get; set; } /// /// /// - public global::Anthropic.BetaRequestTextBlockCacheControlDiscriminatorType? Type87 { get; set; } + public global::Anthropic.BetaInputContentBlock? Type87 { get; set; } /// /// /// - public global::Anthropic.BetaRequestTextBlockType? Type88 { get; set; } + public global::Anthropic.BetaRequestTextBlock? Type88 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlock? Type89 { get; set; } + public global::Anthropic.BetaRequestTextBlockCacheControlDiscriminator? Type89 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockCacheControlDiscriminator? Type90 { get; set; } + public global::Anthropic.BetaRequestTextBlockCacheControlDiscriminatorType? Type90 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockCacheControlDiscriminatorType? Type91 { get; set; } + public global::Anthropic.BetaRequestTextBlockType? Type91 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockType? Type92 { get; set; } + public global::Anthropic.BetaRequestImageBlock? Type92 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockSourceDiscriminator? Type93 { get; set; } + public global::Anthropic.BetaRequestImageBlockCacheControlDiscriminator? Type93 { get; set; } /// /// /// - public global::Anthropic.BetaRequestImageBlockSourceDiscriminatorType? Type94 { get; set; } + public global::Anthropic.BetaRequestImageBlockCacheControlDiscriminatorType? Type94 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolUseBlock? Type95 { get; set; } + public global::Anthropic.BetaRequestImageBlockType? Type95 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolUseBlockCacheControlDiscriminator? Type96 { get; set; } + public global::Anthropic.BetaRequestToolUseBlock? Type96 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolUseBlockCacheControlDiscriminatorType? Type97 { get; set; } + public global::Anthropic.BetaRequestToolUseBlockCacheControlDiscriminator? Type97 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolUseBlockType? Type98 { get; set; } + public global::Anthropic.BetaRequestToolUseBlockCacheControlDiscriminatorType? Type98 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlock? Type99 { get; set; } + public global::Anthropic.BetaRequestToolUseBlockType? Type99 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockCacheControlDiscriminator? Type100 { get; set; } + public global::Anthropic.BetaRequestToolResultBlock? Type100 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockCacheControlDiscriminatorType? Type101 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockCacheControlDiscriminator? Type101 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockType? Type102 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockCacheControlDiscriminatorType? Type102 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type103 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockType? Type103 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type104 { get; set; } + public global::Anthropic.AnyOf>? Type104 { get; set; } /// /// /// - public global::Anthropic.ContentVariant2Item? Type105 { get; set; } + public global::System.Collections.Generic.IList? Type105 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockContentVariant2ItemDiscriminator? Type106 { get; set; } + public global::Anthropic.ContentVariant2Item? Type106 { get; set; } /// /// /// - public global::Anthropic.BetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? Type107 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockContentVariant2ItemDiscriminator? Type107 { get; set; } /// /// /// - public global::Anthropic.BetaRequestPDFBlock? Type108 { get; set; } + public global::Anthropic.BetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? Type108 { get; set; } /// /// /// - public global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminator? Type109 { get; set; } + public global::Anthropic.BetaRequestDocumentBlock? Type109 { get; set; } /// /// /// - public global::Anthropic.BetaRequestPDFBlockCacheControlDiscriminatorType? Type110 { get; set; } + public global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminator? Type110 { get; set; } /// /// /// - public global::Anthropic.BetaRequestPDFBlockType? Type111 { get; set; } + public global::Anthropic.BetaRequestDocumentBlockCacheControlDiscriminatorType? Type111 { get; set; } /// /// /// - public global::Anthropic.BetaInputContentBlockDiscriminator? Type112 { get; set; } + public global::Anthropic.BetaRequestDocumentBlockType? Type112 { get; set; } /// /// /// - public global::Anthropic.BetaInputContentBlockDiscriminatorType? Type113 { get; set; } + public global::Anthropic.BetaRequestDocumentBlockSourceDiscriminator? Type113 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type114 { get; set; } + public global::Anthropic.BetaRequestDocumentBlockSourceDiscriminatorType? Type114 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type115 { get; set; } + public global::Anthropic.BetaInputContentBlockDiscriminator? Type115 { get; set; } /// /// /// - public global::Anthropic.Model? Type116 { get; set; } + public global::Anthropic.BetaInputContentBlockDiscriminatorType? Type116 { get; set; } /// /// /// - public global::Anthropic.ModelEnum? Type117 { get; set; } + public global::Anthropic.AnyOf>? Type117 { get; set; } /// /// /// - public global::Anthropic.BetaCountMessageTokensResponse? Type118 { get; set; } + public global::System.Collections.Generic.IList? Type118 { get; set; } /// /// /// - public global::Anthropic.BetaCreateMessageBatchParams? Type119 { get; set; } + public global::Anthropic.Model? Type119 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type120 { get; set; } + public global::Anthropic.ModelEnum? Type120 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatchIndividualRequestParams? Type121 { get; set; } + public global::Anthropic.BetaCountMessageTokensResponse? Type121 { get; set; } /// /// /// - public global::Anthropic.BetaCreateMessageParams? Type122 { get; set; } + public global::Anthropic.BetaCreateMessageBatchParams? Type122 { get; set; } /// /// /// - public global::Anthropic.BetaMetadata? Type123 { get; set; } + public global::System.Collections.Generic.IList? Type123 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type124 { get; set; } + public global::Anthropic.BetaMessageBatchIndividualRequestParams? Type124 { get; set; } /// /// /// - public double? Type125 { get; set; } + public global::Anthropic.BetaCreateMessageParams? Type125 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type126 { get; set; } + public global::Anthropic.BetaMetadata? Type126 { get; set; } /// /// /// - public global::Anthropic.ToolsItem2? Type127 { get; set; } + public global::System.Collections.Generic.IList? Type127 { get; set; } /// /// /// - public global::Anthropic.BetaCreateMessageParamsToolDiscriminator? Type128 { get; set; } + public double? Type128 { get; set; } /// /// /// - public global::Anthropic.BetaCreateMessageParamsToolDiscriminatorType? Type129 { get; set; } + public global::System.Collections.Generic.IList? Type129 { get; set; } /// /// /// - public global::Anthropic.BetaErrorResponse? Type130 { get; set; } + public global::Anthropic.ToolsItem2? Type130 { get; set; } /// /// /// - public global::Anthropic.BetaErrorResponseType? Type131 { get; set; } + public global::Anthropic.BetaCreateMessageParamsToolDiscriminator? Type131 { get; set; } /// /// /// - public global::Anthropic.Error? Type132 { get; set; } + public global::Anthropic.BetaCreateMessageParamsToolDiscriminatorType? Type132 { get; set; } /// /// /// - public global::Anthropic.BetaInvalidRequestError? Type133 { get; set; } + public global::Anthropic.BetaErrorResponse? Type133 { get; set; } /// /// /// - public global::Anthropic.BetaInvalidRequestErrorType? Type134 { get; set; } + public global::Anthropic.BetaErrorResponseType? Type134 { get; set; } /// /// /// - public global::Anthropic.BetaPermissionError? Type135 { get; set; } + public global::Anthropic.Error? Type135 { get; set; } /// /// /// - public global::Anthropic.BetaPermissionErrorType? Type136 { get; set; } + public global::Anthropic.BetaInvalidRequestError? Type136 { get; set; } /// /// /// - public global::Anthropic.BetaNotFoundError? Type137 { get; set; } + public global::Anthropic.BetaInvalidRequestErrorType? Type137 { get; set; } /// /// /// - public global::Anthropic.BetaNotFoundErrorType? Type138 { get; set; } + public global::Anthropic.BetaPermissionError? Type138 { get; set; } /// /// /// - public global::Anthropic.BetaRateLimitError? Type139 { get; set; } + public global::Anthropic.BetaPermissionErrorType? Type139 { get; set; } /// /// /// - public global::Anthropic.BetaRateLimitErrorType? Type140 { get; set; } + public global::Anthropic.BetaNotFoundError? Type140 { get; set; } /// /// /// - public global::Anthropic.BetaOverloadedError? Type141 { get; set; } + public global::Anthropic.BetaNotFoundErrorType? Type141 { get; set; } /// /// /// - public global::Anthropic.BetaOverloadedErrorType? Type142 { get; set; } + public global::Anthropic.BetaRateLimitError? Type142 { get; set; } /// /// /// - public global::Anthropic.BetaErrorResponseErrorDiscriminator? Type143 { get; set; } + public global::Anthropic.BetaRateLimitErrorType? Type143 { get; set; } /// /// /// - public global::Anthropic.BetaErrorResponseErrorDiscriminatorType? Type144 { get; set; } + public global::Anthropic.BetaGatewayTimeoutError? Type144 { get; set; } /// /// /// - public global::Anthropic.BetaErroredResult? Type145 { get; set; } + public global::Anthropic.BetaGatewayTimeoutErrorType? Type145 { get; set; } /// /// /// - public global::Anthropic.BetaErroredResultType? Type146 { get; set; } + public global::Anthropic.BetaOverloadedError? Type146 { get; set; } /// /// /// - public global::Anthropic.BetaExpiredResult? Type147 { get; set; } + public global::Anthropic.BetaOverloadedErrorType? Type147 { get; set; } /// /// /// - public global::Anthropic.BetaExpiredResultType? Type148 { get; set; } + public global::Anthropic.BetaErrorResponseErrorDiscriminator? Type148 { get; set; } /// /// /// - public global::Anthropic.BetaInputSchema? Type149 { get; set; } + public global::Anthropic.BetaErrorResponseErrorDiscriminatorType? Type149 { get; set; } /// /// /// - public global::Anthropic.BetaInputSchemaType? Type150 { get; set; } + public global::Anthropic.BetaErroredResult? Type150 { get; set; } /// /// /// - public global::Anthropic.BetaListResponseMessageBatch? Type151 { get; set; } + public global::Anthropic.BetaErroredResultType? Type151 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type152 { get; set; } + public global::Anthropic.BetaExpiredResult? Type152 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatch? Type153 { get; set; } + public global::Anthropic.BetaExpiredResultType? Type153 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatchType? Type154 { get; set; } + public global::Anthropic.BetaInputSchema? Type154 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatchProcessingStatus? Type155 { get; set; } + public global::Anthropic.BetaInputSchemaType? Type155 { get; set; } /// /// /// - public global::Anthropic.BetaRequestCounts? Type156 { get; set; } + public global::Anthropic.BetaListResponseMessageBatch? Type156 { get; set; } /// /// /// - public global::System.DateTime? Type157 { get; set; } + public global::System.Collections.Generic.IList? Type157 { get; set; } /// /// /// - public global::Anthropic.BetaMessage? Type158 { get; set; } + public global::Anthropic.BetaMessageBatch? Type158 { get; set; } /// /// /// - public global::Anthropic.BetaMessageType? Type159 { get; set; } + public global::Anthropic.BetaMessageBatchType? Type159 { get; set; } /// /// /// - public global::Anthropic.BetaMessageRole? Type160 { get; set; } + public global::Anthropic.BetaMessageBatchProcessingStatus? Type160 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type161 { get; set; } + public global::Anthropic.BetaRequestCounts? Type161 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlock? Type162 { get; set; } + public global::System.DateTime? Type162 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockDiscriminator? Type163 { get; set; } + public global::Anthropic.BetaListResponseModelResponse? Type163 { get; set; } /// /// /// - public global::Anthropic.BetaContentBlockDiscriminatorType? Type164 { get; set; } + public global::System.Collections.Generic.IList? Type164 { get; set; } /// /// /// - public global::Anthropic.BetaMessageStopReason? Type165 { get; set; } + public global::Anthropic.BetaModelResponse? Type165 { get; set; } /// /// /// - public global::Anthropic.BetaUsage? Type166 { get; set; } + public global::Anthropic.BetaModelResponseType? Type166 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatchIndividualResponse? Type167 { get; set; } + public global::Anthropic.BetaMessage? Type167 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatchResult? Type168 { get; set; } + public global::Anthropic.BetaMessageType? Type168 { get; set; } /// /// /// - public global::Anthropic.BetaSucceededResult? Type169 { get; set; } + public global::Anthropic.BetaMessageRole? Type169 { get; set; } /// /// /// - public global::Anthropic.BetaSucceededResultType? Type170 { get; set; } + public global::System.Collections.Generic.IList? Type170 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatchResultDiscriminator? Type171 { get; set; } + public global::Anthropic.BetaContentBlock? Type171 { get; set; } /// /// /// - public global::Anthropic.BetaMessageBatchResultDiscriminatorType? Type172 { get; set; } + public global::Anthropic.BetaContentBlockDiscriminator? Type172 { get; set; } /// /// /// - public global::Anthropic.BetaMessageDelta? Type173 { get; set; } + public global::Anthropic.BetaContentBlockDiscriminatorType? Type173 { get; set; } /// /// /// - public global::Anthropic.BetaMessageDeltaStopReason? Type174 { get; set; } + public global::Anthropic.BetaMessageStopReason? Type174 { get; set; } /// /// /// - public global::Anthropic.BetaMessageDeltaEvent? Type175 { get; set; } + public global::Anthropic.BetaUsage? Type175 { get; set; } /// /// /// - public global::Anthropic.BetaMessageDeltaEventType? Type176 { get; set; } + public global::Anthropic.BetaMessageBatchIndividualResponse? Type176 { get; set; } /// /// /// - public global::Anthropic.BetaMessageDeltaUsage? Type177 { get; set; } + public global::Anthropic.Result? Type177 { get; set; } /// /// /// - public global::Anthropic.BetaMessageStartEvent? Type178 { get; set; } + public global::Anthropic.BetaSucceededResult? Type178 { get; set; } /// /// /// - public global::Anthropic.BetaMessageStartEventType? Type179 { get; set; } + public global::Anthropic.BetaSucceededResultType? Type179 { get; set; } /// /// /// - public global::Anthropic.BetaMessageStopEvent? Type180 { get; set; } + public global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminator? Type180 { get; set; } /// /// /// - public global::Anthropic.BetaMessageStopEventType? Type181 { get; set; } + public global::Anthropic.BetaMessageBatchIndividualResponseResultDiscriminatorType? Type181 { get; set; } /// /// /// - public global::Anthropic.BetaMessageStreamEvent? Type182 { get; set; } + public global::Anthropic.BetaMessageDelta? Type182 { get; set; } /// /// /// - public global::Anthropic.BetaMessageStreamEventDiscriminator? Type183 { get; set; } + public global::Anthropic.BetaMessageDeltaStopReason? Type183 { get; set; } /// /// /// - public global::Anthropic.BetaMessageStreamEventDiscriminatorType? Type184 { get; set; } + public global::Anthropic.BetaMessageDeltaEvent? Type184 { get; set; } /// /// /// - public global::Anthropic.CacheControlEphemeral? Type185 { get; set; } + public global::Anthropic.BetaMessageDeltaEventType? Type185 { get; set; } /// /// /// - public global::Anthropic.CacheControlEphemeralType? Type186 { get; set; } + public global::Anthropic.BetaMessageDeltaUsage? Type186 { get; set; } /// /// /// - public global::Anthropic.CompletionRequest? Type187 { get; set; } + public global::Anthropic.BetaMessageStartEvent? Type187 { get; set; } /// /// /// - public global::Anthropic.Metadata? Type188 { get; set; } + public global::Anthropic.BetaMessageStartEventType? Type188 { get; set; } /// /// /// - public global::Anthropic.CompletionResponse? Type189 { get; set; } + public global::Anthropic.BetaMessageStopEvent? Type189 { get; set; } /// /// /// - public global::Anthropic.CompletionResponseType? Type190 { get; set; } + public global::Anthropic.BetaMessageStopEventType? Type190 { get; set; } /// /// /// - public global::Anthropic.ContentBlockDeltaEvent? Type191 { get; set; } + public global::Anthropic.BetaMessageStreamEvent? Type191 { get; set; } /// /// /// - public global::Anthropic.ContentBlockDeltaEventType? Type192 { get; set; } + public global::Anthropic.BetaMessageStreamEventDiscriminator? Type192 { get; set; } /// /// /// - public global::Anthropic.Delta2? Type193 { get; set; } + public global::Anthropic.BetaMessageStreamEventDiscriminatorType? Type193 { get; set; } /// /// /// - public global::Anthropic.TextContentBlockDelta? Type194 { get; set; } + public global::Anthropic.BillingError? Type194 { get; set; } /// /// /// - public global::Anthropic.TextContentBlockDeltaType? Type195 { get; set; } + public global::Anthropic.BillingErrorType? Type195 { get; set; } /// /// /// - public global::Anthropic.InputJsonContentBlockDelta? Type196 { get; set; } + public global::Anthropic.CacheControlEphemeral? Type196 { get; set; } /// /// /// - public global::Anthropic.InputJsonContentBlockDeltaType? Type197 { get; set; } + public global::Anthropic.CacheControlEphemeralType? Type197 { get; set; } /// /// /// - public global::Anthropic.ContentBlockDeltaEventDeltaDiscriminator? Type198 { get; set; } + public global::Anthropic.CanceledResult? Type198 { get; set; } /// /// /// - public global::Anthropic.ContentBlockDeltaEventDeltaDiscriminatorType? Type199 { get; set; } + public global::Anthropic.CanceledResultType? Type199 { get; set; } /// /// /// - public global::Anthropic.ContentBlockStartEvent? Type200 { get; set; } + public global::Anthropic.CompletionRequest? Type200 { get; set; } /// /// /// - public global::Anthropic.ContentBlockStartEventType? Type201 { get; set; } + public global::Anthropic.Metadata? Type201 { get; set; } /// /// /// - public global::Anthropic.ContentBlock2? Type202 { get; set; } + public global::Anthropic.CompletionResponse? Type202 { get; set; } /// /// /// - public global::Anthropic.ResponseTextBlock? Type203 { get; set; } + public global::Anthropic.CompletionResponseType? Type203 { get; set; } /// /// /// - public global::Anthropic.ResponseTextBlockType? Type204 { get; set; } + public global::Anthropic.ContentBlockDeltaEvent? Type204 { get; set; } /// /// /// - public global::Anthropic.ResponseToolUseBlock? Type205 { get; set; } + public global::Anthropic.ContentBlockDeltaEventType? Type205 { get; set; } /// /// /// - public global::Anthropic.ResponseToolUseBlockType? Type206 { get; set; } + public global::Anthropic.AnyOf? Type206 { get; set; } /// /// /// - public global::Anthropic.ContentBlockStartEventContentBlockDiscriminator? Type207 { get; set; } + public global::Anthropic.TextContentBlockDelta? Type207 { get; set; } /// /// /// - public global::Anthropic.ContentBlockStartEventContentBlockDiscriminatorType? Type208 { get; set; } + public global::Anthropic.TextContentBlockDeltaType? Type208 { get; set; } /// /// /// - public global::Anthropic.ContentBlockStopEvent? Type209 { get; set; } + public global::Anthropic.InputJsonContentBlockDelta? Type209 { get; set; } /// /// /// - public global::Anthropic.ContentBlockStopEventType? Type210 { get; set; } + public global::Anthropic.InputJsonContentBlockDeltaType? Type210 { get; set; } /// /// /// - public global::Anthropic.CreateMessageParams? Type211 { get; set; } + public global::Anthropic.ContentBlockStartEvent? Type211 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type212 { get; set; } + public global::Anthropic.ContentBlockStartEventType? Type212 { get; set; } /// /// /// - public global::Anthropic.InputMessage? Type213 { get; set; } + public global::Anthropic.ContentBlock2? Type213 { get; set; } /// /// /// - public global::Anthropic.InputMessageRole? Type214 { get; set; } + public global::Anthropic.ResponseTextBlock? Type214 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type215 { get; set; } + public global::Anthropic.ResponseTextBlockType? Type215 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type216 { get; set; } + public global::Anthropic.ResponseToolUseBlock? Type216 { get; set; } /// /// /// - public global::Anthropic.ContentVariant2Item2? Type217 { get; set; } + public global::Anthropic.ResponseToolUseBlockType? Type217 { get; set; } /// /// /// - public global::Anthropic.RequestTextBlock? Type218 { get; set; } + public global::Anthropic.ContentBlockStartEventContentBlockDiscriminator? Type218 { get; set; } /// /// /// - public global::Anthropic.RequestTextBlockType? Type219 { get; set; } + public global::Anthropic.ContentBlockStartEventContentBlockDiscriminatorType? Type219 { get; set; } /// /// /// - public global::Anthropic.RequestImageBlock? Type220 { get; set; } + public global::Anthropic.ContentBlockStopEvent? Type220 { get; set; } /// /// /// - public global::Anthropic.RequestImageBlockType? Type221 { get; set; } + public global::Anthropic.ContentBlockStopEventType? Type221 { get; set; } /// /// /// - public global::Anthropic.RequestImageBlockSourceDiscriminator? Type222 { get; set; } + public global::Anthropic.CountMessageTokensParams? Type222 { get; set; } /// /// /// - public global::Anthropic.RequestImageBlockSourceDiscriminatorType? Type223 { get; set; } + public global::Anthropic.ToolChoice? Type223 { get; set; } /// /// /// - public global::Anthropic.RequestToolUseBlock? Type224 { get; set; } + public global::Anthropic.ToolChoiceAuto? Type224 { get; set; } /// /// /// - public global::Anthropic.RequestToolUseBlockType? Type225 { get; set; } + public global::Anthropic.ToolChoiceAutoType? Type225 { get; set; } /// /// /// - public global::Anthropic.RequestToolResultBlock? Type226 { get; set; } + public global::Anthropic.ToolChoiceAny? Type226 { get; set; } /// /// /// - public global::Anthropic.RequestToolResultBlockType? Type227 { get; set; } + public global::Anthropic.ToolChoiceAnyType? Type227 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type228 { get; set; } + public global::Anthropic.ToolChoiceTool? Type228 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type229 { get; set; } + public global::Anthropic.ToolChoiceToolType? Type229 { get; set; } /// /// /// - public global::Anthropic.ContentVariant2Item5? Type230 { get; set; } + public global::Anthropic.ToolChoiceDiscriminator? Type230 { get; set; } /// /// /// - public global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminator? Type231 { get; set; } + public global::Anthropic.ToolChoiceDiscriminatorType? Type231 { get; set; } /// /// /// - public global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType? Type232 { get; set; } + public global::System.Collections.Generic.IList? Type232 { get; set; } /// /// /// - public global::Anthropic.InputMessageContentVariant2ItemDiscriminator? Type233 { get; set; } + public global::Anthropic.Tool? Type233 { get; set; } /// /// /// - public global::Anthropic.InputMessageContentVariant2ItemDiscriminatorType? Type234 { get; set; } + public global::Anthropic.ToolCacheControlDiscriminator? Type234 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type235 { get; set; } + public global::Anthropic.ToolCacheControlDiscriminatorType? Type235 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type236 { get; set; } + public global::System.Collections.Generic.IList? Type236 { get; set; } /// /// /// - public global::Anthropic.ToolChoice? Type237 { get; set; } + public global::Anthropic.InputMessage? Type237 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceAuto? Type238 { get; set; } + public global::Anthropic.InputMessageRole? Type238 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceAutoType? Type239 { get; set; } + public global::Anthropic.AnyOf>? Type239 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceAny? Type240 { get; set; } + public global::System.Collections.Generic.IList? Type240 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceAnyType? Type241 { get; set; } + public global::Anthropic.InputContentBlock? Type241 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceTool? Type242 { get; set; } + public global::Anthropic.RequestTextBlock? Type242 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceToolType? Type243 { get; set; } + public global::Anthropic.RequestTextBlockCacheControlDiscriminator? Type243 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceDiscriminator? Type244 { get; set; } + public global::Anthropic.RequestTextBlockCacheControlDiscriminatorType? Type244 { get; set; } /// /// /// - public global::Anthropic.ToolChoiceDiscriminatorType? Type245 { get; set; } + public global::Anthropic.RequestTextBlockType? Type245 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type246 { get; set; } + public global::Anthropic.RequestImageBlock? Type246 { get; set; } /// /// /// - public global::Anthropic.Tool? Type247 { get; set; } + public global::Anthropic.RequestImageBlockCacheControlDiscriminator? Type247 { get; set; } /// /// /// - public global::Anthropic.ErrorResponse? Type248 { get; set; } + public global::Anthropic.RequestImageBlockCacheControlDiscriminatorType? Type248 { get; set; } /// /// /// - public global::Anthropic.ErrorResponseType? Type249 { get; set; } + public global::Anthropic.RequestImageBlockType? Type249 { get; set; } /// /// /// - public global::Anthropic.Error2? Type250 { get; set; } + public global::Anthropic.RequestToolUseBlock? Type250 { get; set; } /// /// /// - public global::Anthropic.InvalidRequestError? Type251 { get; set; } + public global::Anthropic.RequestToolUseBlockCacheControlDiscriminator? Type251 { get; set; } /// /// /// - public global::Anthropic.InvalidRequestErrorType? Type252 { get; set; } + public global::Anthropic.RequestToolUseBlockCacheControlDiscriminatorType? Type252 { get; set; } /// /// /// - public global::Anthropic.PermissionError? Type253 { get; set; } + public global::Anthropic.RequestToolUseBlockType? Type253 { get; set; } /// /// /// - public global::Anthropic.PermissionErrorType? Type254 { get; set; } + public global::Anthropic.RequestToolResultBlock? Type254 { get; set; } /// /// /// - public global::Anthropic.NotFoundError? Type255 { get; set; } + public global::Anthropic.RequestToolResultBlockCacheControlDiscriminator? Type255 { get; set; } /// /// /// - public global::Anthropic.NotFoundErrorType? Type256 { get; set; } + public global::Anthropic.RequestToolResultBlockCacheControlDiscriminatorType? Type256 { get; set; } /// /// /// - public global::Anthropic.RateLimitError? Type257 { get; set; } + public global::Anthropic.RequestToolResultBlockType? Type257 { get; set; } /// /// /// - public global::Anthropic.RateLimitErrorType? Type258 { get; set; } + public global::Anthropic.AnyOf>? Type258 { get; set; } /// /// /// - public global::Anthropic.OverloadedError? Type259 { get; set; } + public global::System.Collections.Generic.IList? Type259 { get; set; } /// /// /// - public global::Anthropic.OverloadedErrorType? Type260 { get; set; } + public global::Anthropic.ContentVariant2Item2? Type260 { get; set; } /// /// /// - public global::Anthropic.ErrorResponseErrorDiscriminator? Type261 { get; set; } + public global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminator? Type261 { get; set; } /// /// /// - public global::Anthropic.ErrorResponseErrorDiscriminatorType? Type262 { get; set; } + public global::Anthropic.RequestToolResultBlockContentVariant2ItemDiscriminatorType? Type262 { get; set; } /// /// /// - public global::Anthropic.InputSchema? Type263 { get; set; } + public global::Anthropic.RequestDocumentBlock? Type263 { get; set; } /// /// /// - public global::Anthropic.InputSchemaType? Type264 { get; set; } + public global::Anthropic.RequestDocumentBlockCacheControlDiscriminator? Type264 { get; set; } /// /// /// - public global::Anthropic.Message? Type265 { get; set; } + public global::Anthropic.RequestDocumentBlockCacheControlDiscriminatorType? Type265 { get; set; } /// /// /// - public global::Anthropic.MessageType? Type266 { get; set; } + public global::Anthropic.RequestDocumentBlockType? Type266 { get; set; } /// /// /// - public global::Anthropic.MessageRole? Type267 { get; set; } + public global::Anthropic.RequestDocumentBlockSourceDiscriminator? Type267 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type268 { get; set; } + public global::Anthropic.RequestDocumentBlockSourceDiscriminatorType? Type268 { get; set; } /// /// /// - public global::Anthropic.ContentBlock3? Type269 { get; set; } + public global::Anthropic.InputContentBlockDiscriminator? Type269 { get; set; } /// /// /// - public global::Anthropic.ContentBlockDiscriminator? Type270 { get; set; } + public global::Anthropic.InputContentBlockDiscriminatorType? Type270 { get; set; } /// /// /// - public global::Anthropic.ContentBlockDiscriminatorType? Type271 { get; set; } + public global::Anthropic.AnyOf>? Type271 { get; set; } /// /// /// - public global::Anthropic.MessageStopReason? Type272 { get; set; } + public global::System.Collections.Generic.IList? Type272 { get; set; } /// /// /// - public global::Anthropic.Usage? Type273 { get; set; } + public global::Anthropic.CountMessageTokensResponse? Type273 { get; set; } /// /// /// - public global::Anthropic.MessageDelta? Type274 { get; set; } + public global::Anthropic.CreateMessageBatchParams? Type274 { get; set; } /// /// /// - public global::Anthropic.MessageDeltaStopReason? Type275 { get; set; } + public global::System.Collections.Generic.IList? Type275 { get; set; } /// /// /// - public global::Anthropic.MessageDeltaEvent? Type276 { get; set; } + public global::Anthropic.MessageBatchIndividualRequestParams? Type276 { get; set; } /// /// /// - public global::Anthropic.MessageDeltaEventType? Type277 { get; set; } + public global::Anthropic.CreateMessageParams? Type277 { get; set; } /// /// /// - public global::Anthropic.MessageDeltaUsage? Type278 { get; set; } + public global::Anthropic.ErrorResponse? Type278 { get; set; } /// /// /// - public global::Anthropic.MessageStartEvent? Type279 { get; set; } + public global::Anthropic.ErrorResponseType? Type279 { get; set; } /// /// /// - public global::Anthropic.MessageStartEventType? Type280 { get; set; } + public global::Anthropic.Error2? Type280 { get; set; } /// /// /// - public global::Anthropic.MessageStopEvent? Type281 { get; set; } + public global::Anthropic.InvalidRequestError? Type281 { get; set; } /// /// /// - public global::Anthropic.MessageStopEventType? Type282 { get; set; } + public global::Anthropic.InvalidRequestErrorType? Type282 { get; set; } /// /// /// - public global::Anthropic.MessageStreamEvent? Type283 { get; set; } + public global::Anthropic.PermissionError? Type283 { get; set; } /// /// /// - public global::Anthropic.Ping? Type284 { get; set; } + public global::Anthropic.PermissionErrorType? Type284 { get; set; } /// /// /// - public global::Anthropic.PingType? Type285 { get; set; } + public global::Anthropic.NotFoundError? Type285 { get; set; } /// /// /// - public global::Anthropic.MessageStreamEventDiscriminator? Type286 { get; set; } + public global::Anthropic.NotFoundErrorType? Type286 { get; set; } /// /// /// - public global::Anthropic.MessageStreamEventDiscriminatorType? Type287 { get; set; } + public global::Anthropic.RateLimitError? Type287 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaCreateMessageParams? Type288 { get; set; } + public global::Anthropic.RateLimitErrorType? Type288 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type289 { get; set; } + public global::Anthropic.GatewayTimeoutError? Type289 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaInputMessage? Type290 { get; set; } + public global::Anthropic.GatewayTimeoutErrorType? Type290 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaInputMessageRole? Type291 { get; set; } + public global::Anthropic.OverloadedError? Type291 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type292 { get; set; } + public global::Anthropic.OverloadedErrorType? Type292 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type293 { get; set; } + public global::Anthropic.ErrorResponseErrorDiscriminator? Type293 { get; set; } /// /// /// - public global::Anthropic.ContentVariant2Item3? Type294 { get; set; } + public global::Anthropic.ErrorResponseErrorDiscriminatorType? Type294 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestTextBlock? Type295 { get; set; } + public global::Anthropic.ErroredResult? Type295 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminator? Type296 { get; set; } + public global::Anthropic.ErroredResultType? Type296 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestTextBlockCacheControlDiscriminatorType? Type297 { get; set; } + public global::Anthropic.ExpiredResult? Type297 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestTextBlockType? Type298 { get; set; } + public global::Anthropic.ExpiredResultType? Type298 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestImageBlock? Type299 { get; set; } + public global::Anthropic.InputSchema? Type299 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminator? Type300 { get; set; } + public global::Anthropic.InputSchemaType? Type300 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestImageBlockCacheControlDiscriminatorType? Type301 { get; set; } + public global::Anthropic.ListResponseMessageBatch? Type301 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestImageBlockType? Type302 { get; set; } + public global::System.Collections.Generic.IList? Type302 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminator? Type303 { get; set; } + public global::Anthropic.MessageBatch? Type303 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestImageBlockSourceDiscriminatorType? Type304 { get; set; } + public global::Anthropic.MessageBatchType? Type304 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolUseBlock? Type305 { get; set; } + public global::Anthropic.MessageBatchProcessingStatus? Type305 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminator? Type306 { get; set; } + public global::Anthropic.RequestCounts? Type306 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolUseBlockCacheControlDiscriminatorType? Type307 { get; set; } + public global::Anthropic.ListResponseModelResponse? Type307 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolUseBlockType? Type308 { get; set; } + public global::System.Collections.Generic.IList? Type308 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolResultBlock? Type309 { get; set; } + public global::Anthropic.ModelResponse? Type309 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminator? Type310 { get; set; } + public global::Anthropic.ModelResponseType? Type310 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolResultBlockCacheControlDiscriminatorType? Type311 { get; set; } + public global::Anthropic.Message? Type311 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolResultBlockType? Type312 { get; set; } + public global::Anthropic.MessageType? Type312 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type313 { get; set; } + public global::Anthropic.MessageRole? Type313 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type314 { get; set; } + public global::System.Collections.Generic.IList? Type314 { get; set; } /// /// /// - public global::Anthropic.ContentVariant2Item4? Type315 { get; set; } + public global::Anthropic.ContentBlock3? Type315 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminator? Type316 { get; set; } + public global::Anthropic.ContentBlockDiscriminator? Type316 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaRequestToolResultBlockContentVariant2ItemDiscriminatorType? Type317 { get; set; } + public global::Anthropic.ContentBlockDiscriminatorType? Type317 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminator? Type318 { get; set; } + public global::Anthropic.MessageStopReason? Type318 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaInputMessageContentVariant2ItemDiscriminatorType? Type319 { get; set; } + public global::Anthropic.Usage? Type319 { get; set; } /// /// /// - public global::Anthropic.AnyOf>? Type320 { get; set; } + public global::Anthropic.MessageBatchIndividualResponse? Type320 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type321 { get; set; } + public global::Anthropic.Result2? Type321 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type322 { get; set; } + public global::Anthropic.SucceededResult? Type322 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaTool? Type323 { get; set; } + public global::Anthropic.SucceededResultType? Type323 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaToolCacheControlDiscriminator? Type324 { get; set; } + public global::Anthropic.MessageBatchIndividualResponseResultDiscriminator? Type324 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaToolCacheControlDiscriminatorType? Type325 { get; set; } + public global::Anthropic.MessageBatchIndividualResponseResultDiscriminatorType? Type325 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessage? Type326 { get; set; } + public global::Anthropic.MessageDelta? Type326 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessageType? Type327 { get; set; } + public global::Anthropic.MessageDeltaStopReason? Type327 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessageRole? Type328 { get; set; } + public global::Anthropic.MessageDeltaEvent? Type328 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessageStopReason? Type329 { get; set; } + public global::Anthropic.MessageDeltaEventType? Type329 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaUsage? Type330 { get; set; } + public global::Anthropic.MessageDeltaUsage? Type330 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessageStartEvent? Type331 { get; set; } + public global::Anthropic.MessageStartEvent? Type331 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessageStartEventType? Type332 { get; set; } + public global::Anthropic.MessageStartEventType? Type332 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessageStreamEvent? Type333 { get; set; } + public global::Anthropic.MessageStopEvent? Type333 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminator? Type334 { get; set; } + public global::Anthropic.MessageStopEventType? Type334 { get; set; } /// /// /// - public global::Anthropic.PromptCachingBetaMessageStreamEventDiscriminatorType? Type335 { get; set; } + public global::Anthropic.MessageStreamEvent? Type335 { get; set; } /// /// /// - public global::Anthropic.CreateMessageParamsWithoutStream? Type336 { get; set; } + public global::Anthropic.Ping? Type336 { get; set; } /// /// /// - public global::Anthropic.AnthropicBeta? Type337 { get; set; } + public global::Anthropic.PingType? Type337 { get; set; } /// /// /// - public global::Anthropic.AnthropicBetaEnum? Type338 { get; set; } + public global::Anthropic.MessageStreamEventDiscriminator? Type338 { get; set; } + /// + /// + /// + public global::Anthropic.MessageStreamEventDiscriminatorType? Type339 { get; set; } + /// + /// + /// + public global::Anthropic.CreateMessageParamsWithoutStream? Type340 { get; set; } + /// + /// + /// + public global::Anthropic.AnthropicBeta? Type341 { get; set; } + /// + /// + /// + public global::Anthropic.AnthropicBetaEnum? Type342 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Anthropic/Metadata/Metadata.Chat.cs b/src/libs/Anthropic/Metadata/Metadata.Chat.cs index 544460f..41b8f08 100644 --- a/src/libs/Anthropic/Metadata/Metadata.Chat.cs +++ b/src/libs/Anthropic/Metadata/Metadata.Chat.cs @@ -13,13 +13,6 @@ public static ChatModelMetadata GetChatModelMetadata( { return model switch { - ModelEnum.ClaudeInstant12 => new ChatModelMetadata - { - PricePerInputTokenInUsd = 0.80 * UsdPerMillionTokens, - PricePerOutputTokenInUsd = 2.40 * UsdPerMillionTokens, - ContextLength = 100_000, - }, - ModelEnum.Claude20 => new ChatModelMetadata { PricePerInputTokenInUsd = 8.00 * UsdPerMillionTokens, @@ -39,8 +32,7 @@ public static ChatModelMetadata GetChatModelMetadata( ContextLength = 200_000, OutputLength = 4_096, }, - ModelEnum.Claude3Haiku20240307 or - ModelEnum.Claude3Haiku20241022 => new ChatModelMetadata + ModelEnum.Claude3Haiku20240307 => new ChatModelMetadata { PricePerInputTokenInUsd = 0.25 * UsdPerMillionTokens, PricePerOutputTokenInUsd = 1.25 * UsdPerMillionTokens, @@ -69,7 +61,8 @@ ModelEnum.Claude35Sonnet20240620 or OutputLength = 4_096, }, - ModelEnum.Claude35HaikuLatest => new ChatModelMetadata + ModelEnum.Claude35HaikuLatest or + ModelEnum.Claude35Haiku20241022 => new ChatModelMetadata { PricePerInputTokenInUsd = 0.80 * UsdPerMillionTokens, PricePerOutputTokenInUsd = 4.00 * UsdPerMillionTokens, diff --git a/src/libs/Anthropic/openapi.yaml b/src/libs/Anthropic/openapi.yaml index 6483675..d282f04 100644 --- a/src/libs/Anthropic/openapi.yaml +++ b/src/libs/Anthropic/openapi.yaml @@ -73,30 +73,77 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /v1/messages?beta=true: - post: - tags: - - Messages - summary: Create a Message - description: "Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.\n\nThe Messages API can be used for either single queries or stateless multi-turn conversations." - operationId: beta_messages_post + /v1/models: + get: + summary: List Models + description: "List available models.\n\nThe Models API response can be used to determine which models are available for use in the API. More recently released models are listed first." + operationId: models_list parameters: - - name: anthropic-beta + - name: before_id + in: query + description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.' + schema: + title: Before Id + type: string + description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.' + - name: after_id + in: query + description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.' + schema: + title: After Id + type: string + description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.' + - name: limit + in: query + description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `1000`." + schema: + title: Limit + maximum: 1000 + minimum: 1 + type: integer + description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `1000`." + default: 20 + - name: anthropic-version in: header - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." + description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." schema: - title: Anthropic-Beta + title: Anthropic-Version type: string - items: - type: string - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - x-stainless-override-schema: - x-stainless-param: betas - x-stainless-extend-default: true - type: array - description: Optional header to specify the beta version(s) you want to use. - items: - $ref: '#/components/schemas/AnthropicBeta' + description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." + - name: x-api-key + in: header + description: "Your unique API key for authentication. \n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." + schema: + title: X-Api-Key + type: string + description: "Your unique API key for authentication. \n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse_ModelResponse_' + 4XX: + description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '/v1/models/{model_id}': + get: + summary: Get a Model + description: "Get a specific model.\n\nThe Models API response can be used to determine information about a specific model or resolve a model alias to a model ID." + operationId: models_get + parameters: + - name: model_id + in: path + description: Model identifier or alias. + required: true + schema: + title: Model Id + type: string + description: Model identifier or alias. - name: anthropic-version in: header description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." @@ -104,49 +151,34 @@ paths: title: Anthropic-Version type: string description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BetaCreateMessageParams' - required: true + - name: x-api-key + in: header + description: "Your unique API key for authentication. \n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." + schema: + title: X-Api-Key + type: string + description: "Your unique API key for authentication. \n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." responses: '200': - description: Message object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/BetaMessage' + $ref: '#/components/schemas/ModelResponse' 4XX: description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." content: application/json: schema: - $ref: '#/components/schemas/BetaErrorResponse' - /v1/messages/batches?beta=true: + $ref: '#/components/schemas/ErrorResponse' + /v1/messages/batches: post: tags: - Message Batches summary: Create a Message Batch description: "Send a batch of Message creation requests.\n\nThe Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete." - operationId: beta_message_batches_post + operationId: message_batches_post parameters: - - name: anthropic-beta - in: header - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - schema: - title: Anthropic-Beta - type: string - items: - type: string - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - x-stainless-override-schema: - x-stainless-param: betas - x-stainless-extend-default: true - type: array - description: Optional header to specify the beta version(s) you want to use. - items: - $ref: '#/components/schemas/AnthropicBeta' - name: anthropic-version in: header description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." @@ -158,7 +190,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BetaCreateMessageBatchParams' + $ref: '#/components/schemas/CreateMessageBatchParams' required: true responses: '200': @@ -166,19 +198,19 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BetaMessageBatch' + $ref: '#/components/schemas/MessageBatch' 4XX: description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." content: application/json: schema: - $ref: '#/components/schemas/BetaErrorResponse' + $ref: '#/components/schemas/ErrorResponse' get: tags: - Message Batches summary: List Message Batches description: List all Message Batches within a Workspace. Most recently created batches are returned first. - operationId: beta_message_batches_list + operationId: message_batches_list parameters: - name: before_id in: query @@ -196,30 +228,14 @@ paths: description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.' - name: limit in: query - description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `100`." + description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `1000`." schema: title: Limit - maximum: 100 + maximum: 1000 minimum: 1 type: integer - description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `100`." + description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `1000`." default: 20 - - name: anthropic-beta - in: header - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - schema: - title: Anthropic-Beta - type: string - items: - type: string - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - x-stainless-override-schema: - x-stainless-param: betas - x-stainless-extend-default: true - type: array - description: Optional header to specify the beta version(s) you want to use. - items: - $ref: '#/components/schemas/AnthropicBeta' - name: anthropic-version in: header description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." @@ -240,20 +256,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BetaListResponse_MessageBatch_' + $ref: '#/components/schemas/ListResponse_MessageBatch_' 4XX: description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." content: application/json: schema: - $ref: '#/components/schemas/BetaErrorResponse' - '/v1/messages/batches/{message_batch_id}?beta=true': + $ref: '#/components/schemas/ErrorResponse' + '/v1/messages/batches/{message_batch_id}': get: tags: - Message Batches summary: Retrieve a Message Batch description: 'This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.' - operationId: beta_message_batches_retrieve + operationId: message_batches_retrieve parameters: - name: message_batch_id in: path @@ -263,22 +279,6 @@ paths: title: Message Batch Id type: string description: ID of the Message Batch. - - name: anthropic-beta - in: header - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - schema: - title: Anthropic-Beta - type: string - items: - type: string - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - x-stainless-override-schema: - x-stainless-param: betas - x-stainless-extend-default: true - type: array - description: Optional header to specify the beta version(s) you want to use. - items: - $ref: '#/components/schemas/AnthropicBeta' - name: anthropic-version in: header description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." @@ -299,20 +299,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BetaMessageBatch' + $ref: '#/components/schemas/MessageBatch' 4XX: description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." content: application/json: schema: - $ref: '#/components/schemas/BetaErrorResponse' - '/v1/messages/batches/{message_batch_id}/cancel?beta=true': + $ref: '#/components/schemas/ErrorResponse' + '/v1/messages/batches/{message_batch_id}/cancel': post: tags: - Message Batches summary: Cancel a Message Batch description: "Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.\n\nThe number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible." - operationId: beta_message_batches_cancel + operationId: message_batches_cancel parameters: - name: message_batch_id in: path @@ -322,22 +322,6 @@ paths: title: Message Batch Id type: string description: ID of the Message Batch. - - name: anthropic-beta - in: header - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - schema: - title: Anthropic-Beta - type: string - items: - type: string - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - x-stainless-override-schema: - x-stainless-param: betas - x-stainless-extend-default: true - type: array - description: Optional header to specify the beta version(s) you want to use. - items: - $ref: '#/components/schemas/AnthropicBeta' - name: anthropic-version in: header description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." @@ -351,20 +335,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BetaMessageBatch' + $ref: '#/components/schemas/MessageBatch' 4XX: description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." content: application/json: schema: - $ref: '#/components/schemas/BetaErrorResponse' - '/v1/messages/batches/{message_batch_id}/results?beta=true': + $ref: '#/components/schemas/ErrorResponse' + '/v1/messages/batches/{message_batch_id}/results': get: tags: - Message Batches summary: Retrieve Message Batch results description: "Streams the results of a Message Batch as a `.jsonl` file.\n\nEach line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests." - operationId: beta_message_batches_results + operationId: message_batches_results parameters: - name: message_batch_id in: path @@ -374,22 +358,6 @@ paths: title: Message Batch Id type: string description: ID of the Message Batch. - - name: anthropic-beta - in: header - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - schema: - title: Anthropic-Beta - type: string - items: - type: string - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - x-stainless-override-schema: - x-stainless-param: betas - x-stainless-extend-default: true - type: array - description: Optional header to specify the beta version(s) you want to use. - items: - $ref: '#/components/schemas/AnthropicBeta' - name: anthropic-version in: header description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." @@ -413,37 +381,21 @@ paths: type: string format: binary x-line-schema: - $ref: '#/components/schemas/BetaMessageBatchIndividualResponse' + $ref: '#/components/schemas/MessageBatchIndividualResponse' 4XX: description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." content: application/json: schema: - $ref: '#/components/schemas/BetaErrorResponse' - /v1/messages/count_tokens?beta=true: + $ref: '#/components/schemas/ErrorResponse' + /v1/messages/count_tokens: post: tags: - Messages summary: Count tokens in a Message description: "Count the number of tokens in a Message.\n\nThe Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it." - operationId: beta_messages_count_tokens_post + operationId: messages_count_tokens_post parameters: - - name: anthropic-beta - in: header - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - schema: - title: Anthropic-Beta - type: string - items: - type: string - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - x-stainless-override-schema: - x-stainless-param: betas - x-stainless-extend-default: true - type: array - description: Optional header to specify the beta version(s) you want to use. - items: - $ref: '#/components/schemas/AnthropicBeta' - name: anthropic-version in: header description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." @@ -455,7 +407,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BetaCountMessageTokensParams' + $ref: '#/components/schemas/CountMessageTokensParams' required: true responses: '200': @@ -463,20 +415,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BetaCountMessageTokensResponse' + $ref: '#/components/schemas/CountMessageTokensResponse' 4XX: description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." content: application/json: schema: - $ref: '#/components/schemas/BetaErrorResponse' - /v1/messages?beta=prompt_caching: + $ref: '#/components/schemas/ErrorResponse' + /v1/messages?beta=true: post: tags: - Messages summary: Create a Message description: "Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.\n\nThe Messages API can be used for either single queries or stateless multi-turn conversations." - operationId: prompt_caching_beta_messages_post + operationId: beta_messages_post parameters: - name: anthropic-beta in: header @@ -505,7 +457,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PromptCachingBetaCreateMessageParams' + $ref: '#/components/schemas/BetaCreateMessageParams' required: true responses: '200': @@ -513,40 +465,138 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PromptCachingBetaMessage' + $ref: '#/components/schemas/BetaMessage' 4XX: description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' - /v1/messages/batches: - post: - tags: - - Message Batches - summary: Create a Message Batch - description: "Send a batch of Message creation requests.\n\nThe Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete." - operationId: beta_message_batches_post + $ref: '#/components/schemas/BetaErrorResponse' + /v1/models?beta=true: + get: + summary: List Models + description: "List available models.\n\nThe Models API response can be used to determine which models are available for use in the API. More recently released models are listed first." + operationId: beta_models_list parameters: - - name: anthropic-beta - in: header - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." + - name: before_id + in: query + description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.' schema: - title: Anthropic-Beta + title: Before Id type: string - items: - type: string - description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." - x-stainless-override-schema: - x-stainless-param: betas - x-stainless-extend-default: true - type: array - description: Optional header to specify the beta version(s) you want to use. - items: - $ref: '#/components/schemas/AnthropicBeta' - - name: anthropic-version - in: header - description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." + description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.' + - name: after_id + in: query + description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.' + schema: + title: After Id + type: string + description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.' + - name: limit + in: query + description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `1000`." + schema: + title: Limit + maximum: 1000 + minimum: 1 + type: integer + description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `1000`." + default: 20 + - name: anthropic-version + in: header + description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." + schema: + title: Anthropic-Version + type: string + description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." + - name: x-api-key + in: header + description: "Your unique API key for authentication. \n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." + schema: + title: X-Api-Key + type: string + description: "Your unique API key for authentication. \n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/BetaListResponse_ModelResponse_' + 4XX: + description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." + content: + application/json: + schema: + $ref: '#/components/schemas/BetaErrorResponse' + '/v1/models/{model_id}?beta=true': + get: + summary: Get a Model + description: "Get a specific model.\n\nThe Models API response can be used to determine information about a specific model or resolve a model alias to a model ID." + operationId: beta_models_get + parameters: + - name: model_id + in: path + description: Model identifier or alias. + required: true + schema: + title: Model Id + type: string + description: Model identifier or alias. + - name: anthropic-version + in: header + description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." + schema: + title: Anthropic-Version + type: string + description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." + - name: x-api-key + in: header + description: "Your unique API key for authentication. \n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." + schema: + title: X-Api-Key + type: string + description: "Your unique API key for authentication. \n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/BetaModelResponse' + 4XX: + description: "Error response.\n\nSee our [errors documentation](https://docs.anthropic.com/en/api/errors) for more details." + content: + application/json: + schema: + $ref: '#/components/schemas/BetaErrorResponse' + /v1/messages/batches?beta=true: + post: + tags: + - Message Batches + summary: Create a Message Batch + description: "Send a batch of Message creation requests.\n\nThe Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete." + operationId: beta_message_batches_post + parameters: + - name: anthropic-beta + in: header + description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." + schema: + title: Anthropic-Beta + type: string + items: + type: string + description: "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." + x-stainless-override-schema: + x-stainless-param: betas + x-stainless-extend-default: true + type: array + description: Optional header to specify the beta version(s) you want to use. + items: + $ref: '#/components/schemas/AnthropicBeta' + - name: anthropic-version + in: header + description: "The version of the Anthropic API you want to use.\n\nRead more about versioning and our version history [here](https://docs.anthropic.com/en/api/versioning)." schema: title: Anthropic-Version type: string @@ -593,13 +643,13 @@ paths: description: 'ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.' - name: limit in: query - description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `100`." + description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `1000`." schema: title: Limit - maximum: 100 + maximum: 1000 minimum: 1 type: integer - description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `100`." + description: "Number of items to return per page.\n\nDefaults to `20`. Ranges from `1` to `1000`." default: 20 - name: anthropic-beta in: header @@ -644,7 +694,7 @@ paths: application/json: schema: $ref: '#/components/schemas/BetaErrorResponse' - '/v1/messages/batches/{message_batch_id}': + '/v1/messages/batches/{message_batch_id}?beta=true': get: tags: - Message Batches @@ -703,7 +753,7 @@ paths: application/json: schema: $ref: '#/components/schemas/BetaErrorResponse' - '/v1/messages/batches/{message_batch_id}/cancel': + '/v1/messages/batches/{message_batch_id}/cancel?beta=true': post: tags: - Message Batches @@ -755,7 +805,7 @@ paths: application/json: schema: $ref: '#/components/schemas/BetaErrorResponse' - '/v1/messages/batches/{message_batch_id}/results': + '/v1/messages/batches/{message_batch_id}/results?beta=true': get: tags: - Message Batches @@ -817,7 +867,7 @@ paths: application/json: schema: $ref: '#/components/schemas/BetaErrorResponse' - /v1/messages/count_tokens: + /v1/messages/count_tokens?beta=true: post: tags: - Messages @@ -929,6 +979,29 @@ components: type: string format: byte additionalProperties: false + Base64PDFSource: + title: Base64PDFSource + required: + - type + - media_type + - data + type: object + properties: + type: + title: Type + enum: + - base64 + type: string + media_type: + title: Media Type + enum: + - application/pdf + type: string + data: + title: Data + type: string + format: byte + additionalProperties: false BetaAPIError: title: APIError required: @@ -1041,6 +1114,23 @@ 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." additionalProperties: false + BetaBillingError: + title: BillingError + required: + - type + - message + type: object + properties: + type: + title: Type + enum: + - billing_error + type: string + default: billing_error + message: + title: Message + type: string + default: Billing error BetaCacheControlEphemeral: title: CacheControlEphemeral required: @@ -1131,14 +1221,9 @@ components: type: integer delta: title: Delta - oneOf: + anyOf: - $ref: '#/components/schemas/BetaTextContentBlockDelta' - $ref: '#/components/schemas/BetaInputJsonContentBlockDelta' - discriminator: - propertyName: type - mapping: - input_json_delta: '#/components/schemas/BetaInputJsonContentBlockDelta' - text_delta: '#/components/schemas/BetaTextContentBlockDelta' BetaContentBlockStartEvent: title: ContentBlockStartEvent required: @@ -1308,6 +1393,7 @@ components: - type: string x-stainless-skip: - go + - cli - type: array items: $ref: '#/components/schemas/BetaRequestTextBlock' @@ -1386,9 +1472,11 @@ components: oneOf: - $ref: '#/components/schemas/BetaInvalidRequestError' - $ref: '#/components/schemas/BetaAuthenticationError' + - $ref: '#/components/schemas/BetaBillingError' - $ref: '#/components/schemas/BetaPermissionError' - $ref: '#/components/schemas/BetaNotFoundError' - $ref: '#/components/schemas/BetaRateLimitError' + - $ref: '#/components/schemas/BetaGatewayTimeoutError' - $ref: '#/components/schemas/BetaAPIError' - $ref: '#/components/schemas/BetaOverloadedError' discriminator: @@ -1396,11 +1484,13 @@ components: mapping: api_error: '#/components/schemas/BetaAPIError' authentication_error: '#/components/schemas/BetaAuthenticationError' + billing_error: '#/components/schemas/BetaBillingError' invalid_request_error: '#/components/schemas/BetaInvalidRequestError' not_found_error: '#/components/schemas/BetaNotFoundError' overloaded_error: '#/components/schemas/BetaOverloadedError' permission_error: '#/components/schemas/BetaPermissionError' rate_limit_error: '#/components/schemas/BetaRateLimitError' + timeout_error: '#/components/schemas/BetaGatewayTimeoutError' BetaErroredResult: title: ErroredResult required: @@ -1428,6 +1518,23 @@ components: - expired type: string default: expired + BetaGatewayTimeoutError: + title: GatewayTimeoutError + required: + - type + - message + type: object + properties: + type: + title: Type + enum: + - timeout_error + type: string + default: timeout_error + message: + title: Message + type: string + default: Request timeout BetaInputJsonContentBlockDelta: title: InputJsonContentBlockDelta required: @@ -1463,6 +1570,7 @@ components: - type: string x-stainless-skip: - go + - cli - type: array items: $ref: '#/components/schemas/BetaInputContentBlock' @@ -1525,13 +1633,39 @@ components: type: string description: First ID in the `data` list. Can be used as the `before_id` for the previous page. nullable: true - example: msgbatch_013Zva2CMHLNnXjNJJKqJ2EF last_id: title: Last Id type: string description: Last ID in the `data` list. Can be used as the `after_id` for the next page. nullable: true - example: msgbatch_01HkcTjaV5uDC8jWR4ZsDV8d + BetaListResponse_ModelResponse_: + title: 'ListResponse[ModelResponse]' + required: + - data + - has_more + - first_id + - last_id + type: object + properties: + data: + title: Data + type: array + items: + $ref: '#/components/schemas/BetaModelResponse' + has_more: + title: Has More + type: boolean + description: Indicates if there are more results in the requested page direction. + first_id: + title: First Id + type: string + description: First ID in the `data` list. Can be used as the `before_id` for the previous page. + nullable: true + last_id: + title: Last Id + type: string + description: Last ID in the `data` list. Can be used as the `after_id` for the next page. + nullable: true BetaMessage: title: Message required: @@ -1724,7 +1858,20 @@ components: description: "Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.\n\nMust be unique for each request within the Message Batch." example: my-custom-id-1 result: - $ref: '#/components/schemas/BetaMessageBatchResult' + title: Result + oneOf: + - $ref: '#/components/schemas/BetaSucceededResult' + - $ref: '#/components/schemas/BetaErroredResult' + - $ref: '#/components/schemas/BetaCanceledResult' + - $ref: '#/components/schemas/BetaExpiredResult' + description: "Processing result for this request.\n\nContains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration." + discriminator: + propertyName: type + mapping: + canceled: '#/components/schemas/BetaCanceledResult' + errored: '#/components/schemas/BetaErroredResult' + expired: '#/components/schemas/BetaExpiredResult' + succeeded: '#/components/schemas/BetaSucceededResult' BetaMessageDelta: title: MessageDelta required: @@ -1837,6 +1984,38 @@ components: nullable: true example: 13803d75-b4b5-4c3e-b2a2-6f21399b021b additionalProperties: false + BetaModelResponse: + title: ModelResponse + required: + - type + - id + - display_name + - created_at + type: object + properties: + type: + title: Type + enum: + - model + type: string + description: "Object type.\n\nFor Models, this is always `\"model\"`." + default: model + id: + title: Id + type: string + description: Unique model identifier. + example: claude-3-5-sonnet-20241022 + display_name: + title: Display Name + type: string + description: A human-readable name for the model. + example: Claude 3.5 Sonnet (New) + created_at: + title: Created At + type: string + description: RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown. + format: date-time + example: '2024-10-22T00:00:00.0000000+00:00' BetaNotFoundError: title: NotFoundError required: @@ -1945,8 +2124,8 @@ components: description: "Number of requests in the Message Batch that have expired.\n\nThis is zero until processing of the entire Message Batch has ended." default: 0 example: 10 - BetaRequestImageBlock: - title: RequestImageBlock + BetaRequestDocumentBlock: + title: RequestDocumentBlock required: - type - source @@ -1965,19 +2144,19 @@ components: type: title: Type enum: - - image + - document type: string source: title: Source oneOf: - - $ref: '#/components/schemas/BetaBase64ImageSource' + - $ref: '#/components/schemas/BetaBase64PDFSource' discriminator: propertyName: type mapping: - base64: '#/components/schemas/BetaBase64ImageSource' + base64: '#/components/schemas/BetaBase64PDFSource' additionalProperties: false - BetaRequestPDFBlock: - title: RequestPDFBlock + BetaRequestImageBlock: + title: RequestImageBlock required: - type - source @@ -1996,10 +2175,12 @@ components: type: title: Type enum: - - document + - image type: string source: - $ref: '#/components/schemas/BetaBase64PDFSource' + title: Source + allOf: + - $ref: '#/components/schemas/BetaBase64ImageSource' additionalProperties: false BetaRequestTextBlock: title: RequestTextBlock @@ -2063,6 +2244,7 @@ components: - type: string x-stainless-skip: - go + - cli - type: array items: title: Block @@ -2337,11 +2519,13 @@ components: properties: input_tokens: title: Input Tokens + minimum: 0 type: integer description: The number of input tokens which were used. example: 2095 cache_creation_input_tokens: title: Cache Creation Input Tokens + minimum: 0 type: integer description: The number of input tokens used to create the cache entry. default: @@ -2349,6 +2533,7 @@ components: example: 2051 cache_read_input_tokens: title: Cache Read Input Tokens + minimum: 0 type: integer description: The number of input tokens read from the cache. default: @@ -2356,9 +2541,27 @@ components: example: 2051 output_tokens: title: Output Tokens + minimum: 0 type: integer description: The number of output tokens which were used. example: 503 + BillingError: + title: BillingError + required: + - type + - message + type: object + properties: + type: + title: Type + enum: + - billing_error + type: string + default: billing_error + message: + title: Message + type: string + default: Billing error CacheControlEphemeral: title: CacheControlEphemeral required: @@ -2371,6 +2574,18 @@ components: - ephemeral type: string additionalProperties: false + CanceledResult: + title: CanceledResult + required: + - type + type: object + properties: + type: + title: Type + enum: + - canceled + type: string + default: canceled CompletionRequest: title: CompletionRequest required: @@ -2491,14 +2706,9 @@ components: type: integer delta: title: Delta - oneOf: + anyOf: - $ref: '#/components/schemas/TextContentBlockDelta' - $ref: '#/components/schemas/InputJsonContentBlockDelta' - discriminator: - propertyName: type - mapping: - input_json_delta: '#/components/schemas/InputJsonContentBlockDelta' - text_delta: '#/components/schemas/TextContentBlockDelta' x-stainless-naming: go: model_name: ContentBlockDeltaEvent @@ -2551,12 +2761,92 @@ components: x-stainless-naming: go: model_name: ContentBlockStopEvent - CreateMessageParams: - title: CreateMessageParams + CountMessageTokensParams: + title: CountMessageTokensParams required: - - model - messages - - max_tokens + - model + type: object + properties: + tool_choice: + $ref: '#/components/schemas/ToolChoice' + tools: + title: Tools + type: array + items: + $ref: '#/components/schemas/Tool' + description: "Definitions of tools that the model may use.\n\nIf you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.\n\nEach tool definition includes:\n\n* `name`: Name of the tool.\n* `description`: Optional, but strongly-recommended description of the tool.\n* `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input` shape that the model will produce in `tool_use` output content blocks.\n\nFor example, if you defined `tools` as:\n\n```json\n[\n {\n \"name\": \"get_stock_price\",\n \"description\": \"Get the current stock price for a given ticker symbol.\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ticker\": {\n \"type\": \"string\",\n \"description\": \"The stock ticker symbol, e.g. AAPL for Apple Inc.\"\n }\n },\n \"required\": [\"ticker\"]\n }\n }\n]\n```\n\nAnd then asked the model \"What's the S&P 500 at today?\", the model might produce `tool_use` content blocks in the response like this:\n\n```json\n[\n {\n \"type\": \"tool_use\",\n \"id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n \"name\": \"get_stock_price\",\n \"input\": { \"ticker\": \"^GSPC\" }\n }\n]\n```\n\nYou might then run your `get_stock_price` tool with `{\"ticker\": \"^GSPC\"}` as an input, and return the following back to the model in a subsequent `user` message:\n\n```json\n[\n {\n \"type\": \"tool_result\",\n \"tool_use_id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n \"content\": \"259.75 USD\"\n }\n]\n```\n\nTools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.\n\nSee our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details." + example: + description: Get the current weather in a given location + input_schema: + properties: + location: + description: 'The city and state, e.g. San Francisco, CA' + type: string + unit: + description: 'Unit for the output - one of (celsius, fahrenheit)' + type: string + required: + - location + type: object + name: get_weather + messages: + title: Messages + type: array + items: + $ref: '#/components/schemas/InputMessage' + description: "Input messages.\n\nOur models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello, Claude\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"Hello there.\"},\n {\"role\": \"assistant\", \"content\": \"Hi, I'm Claude. How can I help you?\"},\n {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from Claude:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello, Claude\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello, Claude\"}]}\n```\n\nStarting with Claude 3 models, you can also send image content blocks:\n\n```json\n{\"role\": \"user\", \"content\": [\n {\n \"type\": \"image\",\n \"source\": {\n \"type\": \"base64\",\n \"media_type\": \"image/jpeg\",\n \"data\": \"/9j/4AAQSkZJRg...\",\n }\n },\n {\"type\": \"text\", \"text\": \"What is in this image?\"}\n]}\n```\n\nWe currently support the `base64` source type for images, and the `image/jpeg`, `image/png`, `image/gif`, and `image/webp` media types.\n\nSee [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for more input examples.\n\nNote that if you want to include a [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `\"system\"` role for input messages in the Messages API." + system: + title: System + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/RequestTextBlock' + description: "System prompt.\n\nA system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts)." + example: + - text: Today's date is 2024-06-01. + type: text + model: + $ref: '#/components/schemas/Model' + additionalProperties: false + example: + messages: + - content: 'Hello, world' + role: user + model: claude-3-5-sonnet-20241022 + CountMessageTokensResponse: + title: CountMessageTokensResponse + required: + - input_tokens + type: object + properties: + input_tokens: + title: Input Tokens + type: integer + description: 'The total number of tokens across the provided list of messages, system prompt, and tools.' + example: 2095 + example: + input_tokens: 2095 + CreateMessageBatchParams: + title: CreateMessageBatchParams + required: + - requests + type: object + properties: + requests: + title: Requests + type: array + items: + $ref: '#/components/schemas/MessageBatchIndividualRequestParams' + description: List of requests for prompt completion. Each is an individual request to create a Message. + additionalProperties: false + CreateMessageParams: + title: CreateMessageParams + required: + - model + - messages + - max_tokens type: object properties: model: @@ -2593,6 +2883,7 @@ components: - type: string x-stainless-skip: - go + - cli - type: array items: $ref: '#/components/schemas/RequestTextBlock' @@ -2667,9 +2958,11 @@ components: oneOf: - $ref: '#/components/schemas/InvalidRequestError' - $ref: '#/components/schemas/AuthenticationError' + - $ref: '#/components/schemas/BillingError' - $ref: '#/components/schemas/PermissionError' - $ref: '#/components/schemas/NotFoundError' - $ref: '#/components/schemas/RateLimitError' + - $ref: '#/components/schemas/GatewayTimeoutError' - $ref: '#/components/schemas/APIError' - $ref: '#/components/schemas/OverloadedError' discriminator: @@ -2677,11 +2970,57 @@ components: mapping: api_error: '#/components/schemas/APIError' authentication_error: '#/components/schemas/AuthenticationError' + billing_error: '#/components/schemas/BillingError' invalid_request_error: '#/components/schemas/InvalidRequestError' not_found_error: '#/components/schemas/NotFoundError' overloaded_error: '#/components/schemas/OverloadedError' permission_error: '#/components/schemas/PermissionError' rate_limit_error: '#/components/schemas/RateLimitError' + timeout_error: '#/components/schemas/GatewayTimeoutError' + ErroredResult: + title: ErroredResult + required: + - type + - error + type: object + properties: + type: + title: Type + enum: + - errored + type: string + default: errored + error: + $ref: '#/components/schemas/ErrorResponse' + ExpiredResult: + title: ExpiredResult + required: + - type + type: object + properties: + type: + title: Type + enum: + - expired + type: string + default: expired + GatewayTimeoutError: + title: GatewayTimeoutError + required: + - type + - message + type: object + properties: + type: + title: Type + enum: + - timeout_error + type: string + default: timeout_error + message: + title: Message + type: string + default: Request timeout InputJsonContentBlockDelta: title: InputJsonContentBlockDelta required: @@ -2717,25 +3056,10 @@ components: - type: string x-stainless-skip: - go + - cli - type: array items: - title: Block - oneOf: - - $ref: '#/components/schemas/RequestTextBlock' - - $ref: '#/components/schemas/RequestImageBlock' - - $ref: '#/components/schemas/RequestToolUseBlock' - - $ref: '#/components/schemas/RequestToolResultBlock' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/RequestImageBlock' - text: '#/components/schemas/RequestTextBlock' - tool_result: '#/components/schemas/RequestToolResultBlock' - tool_use: '#/components/schemas/RequestToolUseBlock' - x-stainless-python-extend-union: - - ContentBlock - x-stainless-python-extend-union-imports: - - from .content_block import ContentBlock + $ref: '#/components/schemas/InputContentBlock' example: - type: text text: What is a quaternion? @@ -2772,6 +3096,62 @@ components: title: Message type: string default: Invalid request + ListResponse_MessageBatch_: + title: 'ListResponse[MessageBatch]' + required: + - data + - has_more + - first_id + - last_id + type: object + properties: + data: + title: Data + type: array + items: + $ref: '#/components/schemas/MessageBatch' + has_more: + title: Has More + type: boolean + description: Indicates if there are more results in the requested page direction. + first_id: + title: First Id + type: string + description: First ID in the `data` list. Can be used as the `before_id` for the previous page. + nullable: true + last_id: + title: Last Id + type: string + description: Last ID in the `data` list. Can be used as the `after_id` for the next page. + nullable: true + ListResponse_ModelResponse_: + title: 'ListResponse[ModelResponse]' + required: + - data + - has_more + - first_id + - last_id + type: object + properties: + data: + title: Data + type: array + items: + $ref: '#/components/schemas/ModelResponse' + has_more: + title: Has More + type: boolean + description: Indicates if there are more results in the requested page direction. + first_id: + title: First Id + type: string + description: First ID in the `data` list. Can be used as the `before_id` for the previous page. + nullable: true + last_id: + title: Last Id + type: string + description: Last ID in the `data` list. Can be used as the `after_id` for the next page. + nullable: true Message: title: Message required: @@ -2853,81 +3233,206 @@ components: output_tokens: 503 x-stainless-python-custom-imports: - from .content_block import ContentBlock as ContentBlock - MessageDelta: - title: MessageDelta - required: - - stop_reason - - stop_sequence - type: object - properties: - stop_reason: - title: Stop Reason - enum: - - end_turn - - max_tokens - - stop_sequence - - tool_use - type: string - default: - nullable: true - stop_sequence: - title: Stop Sequence - type: string - default: - nullable: true - MessageDeltaEvent: - title: MessageDeltaEvent + MessageBatch: + title: MessageBatch required: + - id - type - - delta - - usage + - processing_status + - request_counts + - ended_at + - created_at + - expires_at + - archived_at + - cancel_initiated_at + - results_url type: object properties: - type: - title: Type - enum: - - message_delta + id: + title: Id type: string - default: message_delta - delta: - $ref: '#/components/schemas/MessageDelta' - usage: - allOf: - - $ref: '#/components/schemas/MessageDeltaUsage' - description: "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude." - example: - output_tokens: 503 - x-stainless-naming: - go: - model_name: MessageDeltaEvent - MessageDeltaUsage: - title: MessageDeltaUsage - required: - - output_tokens - type: object - properties: - output_tokens: - title: Output Tokens - type: integer - description: The cumulative number of output tokens which were used. - example: 503 - MessageStartEvent: - title: MessageStartEvent - required: - - type - - message - type: object - properties: + description: "Unique object identifier.\n\nThe format and length of IDs may change over time." + example: msgbatch_013Zva2CMHLNnXjNJJKqJ2EF type: title: Type enum: - - message_start + - message_batch type: string - default: message_start - message: - $ref: '#/components/schemas/Message' - x-stainless-naming: - go: + description: "Object type.\n\nFor Message Batches, this is always `\"message_batch\"`." + default: message_batch + processing_status: + title: Processing Status + enum: + - in_progress + - canceling + - ended + type: string + description: Processing status of the Message Batch. + request_counts: + allOf: + - $ref: '#/components/schemas/RequestCounts' + description: "Tallies requests within the Message Batch, categorized by their status.\n\nRequests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch." + ended_at: + title: Ended At + type: string + description: "RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.\n\nProcessing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired." + format: date-time + nullable: true + example: '2024-08-20T18:37:24.1004350+00:00' + created_at: + title: Created At + type: string + description: RFC 3339 datetime string representing the time at which the Message Batch was created. + format: date-time + example: '2024-08-20T18:37:24.1004350+00:00' + expires_at: + title: Expires At + type: string + description: 'RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.' + format: date-time + example: '2024-08-20T18:37:24.1004350+00:00' + archived_at: + title: Archived At + type: string + description: RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable. + format: date-time + nullable: true + example: '2024-08-20T18:37:24.1004350+00:00' + cancel_initiated_at: + title: Cancel Initiated At + type: string + description: RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated. + format: date-time + nullable: true + example: '2024-08-20T18:37:24.1004350+00:00' + results_url: + title: Results Url + type: string + description: "URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.\n\nResults in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests." + nullable: true + example: https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results + MessageBatchIndividualRequestParams: + title: MessageBatchIndividualRequestParams + required: + - custom_id + - params + type: object + properties: + custom_id: + title: Custom Id + maxLength: 64 + minLength: 1 + pattern: '^[a-zA-Z0-9_-]{1,64}$' + type: string + description: "Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.\n\nMust be unique for each request within the Message Batch." + example: my-custom-id-1 + params: + allOf: + - $ref: '#/components/schemas/CreateMessageParams' + description: "Messages API creation parameters for the individual request. \n\nSee the [Messages API reference](/en/api/messages) for full documentation on available parameters." + additionalProperties: false + MessageBatchIndividualResponse: + title: MessageBatchIndividualResponse + required: + - custom_id + - result + type: object + properties: + custom_id: + title: Custom Id + type: string + description: "Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.\n\nMust be unique for each request within the Message Batch." + example: my-custom-id-1 + result: + title: Result + oneOf: + - $ref: '#/components/schemas/SucceededResult' + - $ref: '#/components/schemas/ErroredResult' + - $ref: '#/components/schemas/CanceledResult' + - $ref: '#/components/schemas/ExpiredResult' + description: "Processing result for this request.\n\nContains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration." + discriminator: + propertyName: type + mapping: + canceled: '#/components/schemas/CanceledResult' + errored: '#/components/schemas/ErroredResult' + expired: '#/components/schemas/ExpiredResult' + succeeded: '#/components/schemas/SucceededResult' + MessageDelta: + title: MessageDelta + required: + - stop_reason + - stop_sequence + type: object + properties: + stop_reason: + title: Stop Reason + enum: + - end_turn + - max_tokens + - stop_sequence + - tool_use + type: string + default: + nullable: true + stop_sequence: + title: Stop Sequence + type: string + default: + nullable: true + MessageDeltaEvent: + title: MessageDeltaEvent + required: + - type + - delta + - usage + type: object + properties: + type: + title: Type + enum: + - message_delta + type: string + default: message_delta + delta: + $ref: '#/components/schemas/MessageDelta' + usage: + allOf: + - $ref: '#/components/schemas/MessageDeltaUsage' + description: "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude." + example: + output_tokens: 503 + x-stainless-naming: + go: + model_name: MessageDeltaEvent + MessageDeltaUsage: + title: MessageDeltaUsage + required: + - output_tokens + type: object + properties: + output_tokens: + title: Output Tokens + type: integer + description: The cumulative number of output tokens which were used. + example: 503 + MessageStartEvent: + title: MessageStartEvent + required: + - type + - message + type: object + properties: + type: + title: Type + enum: + - message_start + type: string + default: message_start + message: + $ref: '#/components/schemas/Message' + x-stainless-naming: + go: model_name: MessageStartEvent MessageStopEvent: title: MessageStopEvent @@ -2978,6 +3483,38 @@ components: nullable: true example: 13803d75-b4b5-4c3e-b2a2-6f21399b021b additionalProperties: false + ModelResponse: + title: ModelResponse + required: + - type + - id + - display_name + - created_at + type: object + properties: + type: + title: Type + enum: + - model + type: string + description: "Object type.\n\nFor Models, this is always `\"model\"`." + default: model + id: + title: Id + type: string + description: Unique model identifier. + example: claude-3-5-sonnet-20241022 + display_name: + title: Display Name + type: string + description: A human-readable name for the model. + example: Claude 3.5 Sonnet (New) + created_at: + title: Created At + type: string + description: RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown. + format: date-time + example: '2024-10-22T00:00:00.0000000+00:00' NotFoundError: title: NotFoundError required: @@ -3029,225 +3566,8 @@ components: title: Message type: string default: Permission denied - PromptCachingBetaCreateMessageParams: - title: CreateMessageParams - required: - - model - - messages - - max_tokens - type: object - properties: - model: - $ref: '#/components/schemas/Model' - messages: - title: Messages - type: array - items: - $ref: '#/components/schemas/PromptCachingBetaInputMessage' - description: "Input messages.\n\nOur models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello, Claude\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"Hello there.\"},\n {\"role\": \"assistant\", \"content\": \"Hi, I'm Claude. How can I help you?\"},\n {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from Claude:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello, Claude\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello, Claude\"}]}\n```\n\nStarting with Claude 3 models, you can also send image content blocks:\n\n```json\n{\"role\": \"user\", \"content\": [\n {\n \"type\": \"image\",\n \"source\": {\n \"type\": \"base64\",\n \"media_type\": \"image/jpeg\",\n \"data\": \"/9j/4AAQSkZJRg...\",\n }\n },\n {\"type\": \"text\", \"text\": \"What is in this image?\"}\n]}\n```\n\nWe currently support the `base64` source type for images, and the `image/jpeg`, `image/png`, `image/gif`, and `image/webp` media types.\n\nSee [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for more input examples.\n\nNote that if you want to include a [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `\"system\"` role for input messages in the Messages API." - max_tokens: - title: Max Tokens - minimum: 1 - type: integer - description: "The maximum number of tokens to generate before stopping.\n\nNote that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.\n\nDifferent models have different maximum values for this parameter. See [models](https://docs.anthropic.com/en/docs/models-overview) for details." - example: 1024 - metadata: - allOf: - - $ref: '#/components/schemas/Metadata' - description: An object describing metadata about the request. - stop_sequences: - title: Stop Sequences - type: array - items: - type: string - description: "Custom text sequences that will cause the model to stop generating.\n\nOur models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `\"end_turn\"`.\n\nIf you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `\"stop_sequence\"` and the response `stop_sequence` value will contain the matched stop sequence." - stream: - title: Stream - type: boolean - description: "Whether to incrementally stream the response using server-sent events.\n\nSee [streaming](https://docs.anthropic.com/en/api/messages-streaming) for details." - system: - title: System - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/PromptCachingBetaRequestTextBlock' - description: "System prompt.\n\nA system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts)." - example: - - text: Today's date is 2024-06-01. - type: text - temperature: - title: Temperature - maximum: 1 - minimum: 0 - type: number - description: "Amount of randomness injected into the response.\n\nDefaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.\n\nNote that even with `temperature` of `0.0`, the results will not be fully deterministic." - example: 1 - tool_choice: - $ref: '#/components/schemas/ToolChoice' - tools: - title: Tools - type: array - items: - $ref: '#/components/schemas/PromptCachingBetaTool' - description: "Definitions of tools that the model may use.\n\nIf you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.\n\nEach tool definition includes:\n\n* `name`: Name of the tool.\n* `description`: Optional, but strongly-recommended description of the tool.\n* `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input` shape that the model will produce in `tool_use` output content blocks.\n\nFor example, if you defined `tools` as:\n\n```json\n[\n {\n \"name\": \"get_stock_price\",\n \"description\": \"Get the current stock price for a given ticker symbol.\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ticker\": {\n \"type\": \"string\",\n \"description\": \"The stock ticker symbol, e.g. AAPL for Apple Inc.\"\n }\n },\n \"required\": [\"ticker\"]\n }\n }\n]\n```\n\nAnd then asked the model \"What's the S&P 500 at today?\", the model might produce `tool_use` content blocks in the response like this:\n\n```json\n[\n {\n \"type\": \"tool_use\",\n \"id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n \"name\": \"get_stock_price\",\n \"input\": { \"ticker\": \"^GSPC\" }\n }\n]\n```\n\nYou might then run your `get_stock_price` tool with `{\"ticker\": \"^GSPC\"}` as an input, and return the following back to the model in a subsequent `user` message:\n\n```json\n[\n {\n \"type\": \"tool_result\",\n \"tool_use_id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n \"content\": \"259.75 USD\"\n }\n]\n```\n\nTools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.\n\nSee our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details." - example: - description: Get the current weather in a given location - input_schema: - properties: - location: - description: 'The city and state, e.g. San Francisco, CA' - type: string - unit: - description: 'Unit for the output - one of (celsius, fahrenheit)' - type: string - required: - - location - type: object - name: get_weather - top_k: - title: Top K - minimum: 0 - type: integer - description: "Only sample from the top K options for each subsequent token.\n\nUsed to remove \"long tail\" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).\n\nRecommended for advanced use cases only. You usually only need to use `temperature`." - example: 5 - top_p: - title: Top P - maximum: 1 - minimum: 0 - type: number - description: "Use nucleus sampling.\n\nIn nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.\n\nRecommended for advanced use cases only. You usually only need to use `temperature`." - example: 0.7 - additionalProperties: false - example: - max_tokens: 1024 - messages: - - content: 'Hello, world' - role: user - model: claude-3-5-sonnet-20241022 - PromptCachingBetaInputMessage: - title: InputMessage - required: - - role - - content - type: object - properties: - role: - title: Role - enum: - - user - - assistant - type: string - content: - title: Content - anyOf: - - type: string - x-stainless-skip: - - go - - type: array - items: - title: Block - oneOf: - - $ref: '#/components/schemas/PromptCachingBetaRequestTextBlock' - - $ref: '#/components/schemas/PromptCachingBetaRequestImageBlock' - - $ref: '#/components/schemas/PromptCachingBetaRequestToolUseBlock' - - $ref: '#/components/schemas/PromptCachingBetaRequestToolResultBlock' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/PromptCachingBetaRequestImageBlock' - text: '#/components/schemas/PromptCachingBetaRequestTextBlock' - tool_result: '#/components/schemas/PromptCachingBetaRequestToolResultBlock' - tool_use: '#/components/schemas/PromptCachingBetaRequestToolUseBlock' - x-stainless-python-extend-union: - - ContentBlock - x-stainless-python-extend-union-imports: - - from ...content_block import ContentBlock - example: - - type: text - text: What is a quaternion? - additionalProperties: false - PromptCachingBetaMessage: - title: Message - required: - - id - - type - - role - - content - - model - - stop_reason - - stop_sequence - - usage - type: object - properties: - id: - title: Id - type: string - description: "Unique object identifier.\n\nThe format and length of IDs may change over time." - example: msg_013Zva2CMHLNnXjNJJKqJ2EF - type: - title: Type - enum: - - message - type: string - description: "Object type.\n\nFor Messages, this is always `\"message\"`." - default: message - role: - title: Role - enum: - - assistant - type: string - description: "Conversational role of the generated message.\n\nThis will always be `\"assistant\"`." - default: assistant - content: - title: Content - type: array - items: - $ref: '#/components/schemas/ContentBlock' - description: "Content generated by the model.\n\nThis is an array of content blocks, each of which has a `type` that determines its shape.\n\nExample:\n\n```json\n[{\"type\": \"text\", \"text\": \"Hi, I'm Claude.\"}]\n```\n\nIf the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.\n\nFor example, if the input `messages` were:\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"}\n]\n```\n\nThen the response `content` might be:\n\n```json\n[{\"type\": \"text\", \"text\": \"B)\"}]\n```" - example: - - text: Hi! My name is Claude. - type: text - model: - $ref: '#/components/schemas/Model' - stop_reason: - title: Stop Reason - enum: - - end_turn - - max_tokens - - stop_sequence - - tool_use - type: string - description: "The reason that we stopped.\n\nThis may be one the following values:\n* `\"end_turn\"`: the model reached a natural stopping point\n* `\"max_tokens\"`: we exceeded the requested `max_tokens` or the model's maximum\n* `\"stop_sequence\"`: one of your provided custom `stop_sequences` was generated\n* `\"tool_use\"`: the model invoked one or more tools\n\nIn non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise." - nullable: true - stop_sequence: - title: Stop Sequence - type: string - description: "Which custom stop sequence was generated, if any.\n\nThis value will be a non-null string if one of your custom stop sequences was generated." - default: - nullable: true - usage: - allOf: - - $ref: '#/components/schemas/PromptCachingBetaUsage' - description: "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude." - example: - input_tokens: 2095 - output_tokens: 503 - example: - content: - - text: Hi! My name is Claude. - type: text - id: msg_013Zva2CMHLNnXjNJJKqJ2EF - model: claude-3-5-sonnet-20241022 - role: assistant - stop_reason: end_turn - stop_sequence: - type: message - usage: - input_tokens: 2095 - output_tokens: 503 - PromptCachingBetaMessageStartEvent: - title: MessageStartEvent + RateLimitError: + title: RateLimitError required: - type - message @@ -3256,92 +3576,58 @@ components: type: title: Type enum: - - message_start + - rate_limit_error type: string - default: message_start + default: rate_limit_error message: - $ref: '#/components/schemas/PromptCachingBetaMessage' - PromptCachingBetaMessageStreamEvent: - title: MessageStreamEvent - oneOf: - - $ref: '#/components/schemas/PromptCachingBetaMessageStartEvent' - - $ref: '#/components/schemas/MessageDeltaEvent' - - $ref: '#/components/schemas/MessageStopEvent' - - $ref: '#/components/schemas/ContentBlockStartEvent' - - $ref: '#/components/schemas/ContentBlockDeltaEvent' - - $ref: '#/components/schemas/ContentBlockStopEvent' - discriminator: - propertyName: type - mapping: - content_block_delta: '#/components/schemas/ContentBlockDeltaEvent' - content_block_start: '#/components/schemas/ContentBlockStartEvent' - content_block_stop: '#/components/schemas/ContentBlockStopEvent' - message_delta: '#/components/schemas/MessageDeltaEvent' - message_start: '#/components/schemas/PromptCachingBetaMessageStartEvent' - message_stop: '#/components/schemas/MessageStopEvent' - PromptCachingBetaRequestImageBlock: - title: RequestImageBlock - required: - - type - - source - type: object - properties: - cache_control: - title: Cache Control - type: 'null' - oneOf: - - $ref: '#/components/schemas/CacheControlEphemeral' - nullable: true - discriminator: - propertyName: type - mapping: - ephemeral: '#/components/schemas/CacheControlEphemeral' - type: - title: Type - enum: - - image + title: Message type: string - source: - title: Source - oneOf: - - $ref: '#/components/schemas/Base64ImageSource' - discriminator: - propertyName: type - mapping: - base64: '#/components/schemas/Base64ImageSource' - additionalProperties: false - PromptCachingBetaRequestTextBlock: - title: RequestTextBlock + default: Rate limited + RequestCounts: + title: RequestCounts required: - - type - - text + - processing + - succeeded + - errored + - canceled + - expired type: object properties: - cache_control: - title: Cache Control - type: 'null' - oneOf: - - $ref: '#/components/schemas/CacheControlEphemeral' - nullable: true - discriminator: - propertyName: type - mapping: - ephemeral: '#/components/schemas/CacheControlEphemeral' - type: - title: Type - enum: - - text - type: string - text: - title: Text - minLength: 1 - type: string - additionalProperties: false - PromptCachingBetaRequestToolResultBlock: - title: RequestToolResultBlock + processing: + title: Processing + type: integer + description: Number of requests in the Message Batch that are processing. + default: 0 + example: 100 + succeeded: + title: Succeeded + type: integer + description: "Number of requests in the Message Batch that have completed successfully.\n\nThis is zero until processing of the entire Message Batch has ended." + default: 0 + example: 50 + errored: + title: Errored + type: integer + description: "Number of requests in the Message Batch that encountered an error.\n\nThis is zero until processing of the entire Message Batch has ended." + default: 0 + example: 30 + canceled: + title: Canceled + type: integer + description: "Number of requests in the Message Batch that have been canceled.\n\nThis is zero until processing of the entire Message Batch has ended." + default: 0 + example: 10 + expired: + title: Expired + type: integer + description: "Number of requests in the Message Batch that have expired.\n\nThis is zero until processing of the entire Message Batch has ended." + default: 0 + example: 10 + RequestDocumentBlock: + title: RequestDocumentBlock required: - type - - tool_use_id + - source type: object properties: cache_control: @@ -3357,105 +3643,24 @@ components: type: title: Type enum: - - tool_result - type: string - tool_use_id: - title: Tool Use Id - pattern: '^[a-zA-Z0-9_-]+$' + - document type: string - is_error: - title: Is Error - type: boolean - content: - title: Content - anyOf: - - type: string - - type: array - items: - title: Block - oneOf: - - $ref: '#/components/schemas/PromptCachingBetaRequestTextBlock' - - $ref: '#/components/schemas/PromptCachingBetaRequestImageBlock' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/PromptCachingBetaRequestImageBlock' - text: '#/components/schemas/PromptCachingBetaRequestTextBlock' - x-stainless-naming: - python: - type_name: Content - additionalProperties: false - PromptCachingBetaRequestToolUseBlock: - title: RequestToolUseBlock - required: - - type - - id - - name - - input - type: object - properties: - cache_control: - title: Cache Control - type: 'null' + source: + title: Source oneOf: - - $ref: '#/components/schemas/CacheControlEphemeral' - nullable: true + - $ref: '#/components/schemas/Base64PDFSource' discriminator: propertyName: type mapping: - ephemeral: '#/components/schemas/CacheControlEphemeral' - type: - title: Type - enum: - - tool_use - type: string - id: - title: Id - pattern: '^[a-zA-Z0-9_-]+$' - type: string - name: - title: Name - maxLength: 64 - minLength: 1 - pattern: '^[a-zA-Z0-9_-]{1,64}$' - type: string - input: - title: Input - type: object + base64: '#/components/schemas/Base64PDFSource' additionalProperties: false - PromptCachingBetaTool: - title: Tool + RequestImageBlock: + title: RequestImageBlock required: - - name - - input_schema + - type + - source type: object properties: - description: - title: Description - type: string - description: "Description of what this tool does.\n\nTool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema." - example: Get the current weather in a given location - name: - title: Name - maxLength: 64 - minLength: 1 - pattern: '^[a-zA-Z0-9_-]{1,64}$' - 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: - 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: - location: - description: 'The city and state, e.g. San Francisco, CA' - type: string - unit: - description: 'Unit for the output - one of (celsius, fahrenheit)' - type: string - required: - - location - type: object cache_control: title: Cache Control type: 'null' @@ -3466,64 +3671,6 @@ components: propertyName: type mapping: ephemeral: '#/components/schemas/CacheControlEphemeral' - additionalProperties: false - PromptCachingBetaUsage: - title: Usage - required: - - input_tokens - - cache_creation_input_tokens - - cache_read_input_tokens - - output_tokens - type: object - properties: - input_tokens: - title: Input Tokens - type: integer - description: The number of input tokens which were used. - example: 2095 - cache_creation_input_tokens: - title: Cache Creation Input Tokens - type: integer - description: The number of input tokens used to create the cache entry. - default: - nullable: true - example: 2051 - cache_read_input_tokens: - title: Cache Read Input Tokens - type: integer - description: The number of input tokens read from the cache. - default: - nullable: true - example: 2051 - output_tokens: - title: Output Tokens - type: integer - description: The number of output tokens which were used. - example: 503 - RateLimitError: - title: RateLimitError - required: - - type - - message - type: object - properties: - type: - title: Type - enum: - - rate_limit_error - type: string - default: rate_limit_error - message: - title: Message - type: string - default: Rate limited - RequestImageBlock: - title: RequestImageBlock - required: - - type - - source - type: object - properties: type: title: Type enum: @@ -3531,12 +3678,8 @@ components: type: string source: title: Source - oneOf: + allOf: - $ref: '#/components/schemas/Base64ImageSource' - discriminator: - propertyName: type - mapping: - base64: '#/components/schemas/Base64ImageSource' additionalProperties: false RequestTextBlock: title: RequestTextBlock @@ -3545,6 +3688,16 @@ components: - text type: object properties: + cache_control: + title: Cache Control + type: 'null' + oneOf: + - $ref: '#/components/schemas/CacheControlEphemeral' + nullable: true + discriminator: + propertyName: type + mapping: + ephemeral: '#/components/schemas/CacheControlEphemeral' type: title: Type enum: @@ -3562,6 +3715,16 @@ components: - tool_use_id type: object properties: + cache_control: + title: Cache Control + type: 'null' + oneOf: + - $ref: '#/components/schemas/CacheControlEphemeral' + nullable: true + discriminator: + propertyName: type + mapping: + ephemeral: '#/components/schemas/CacheControlEphemeral' type: title: Type enum: @@ -3580,6 +3743,7 @@ components: - type: string x-stainless-skip: - go + - cli - type: array items: title: Block @@ -3604,6 +3768,16 @@ components: - input type: object properties: + cache_control: + title: Cache Control + type: 'null' + oneOf: + - $ref: '#/components/schemas/CacheControlEphemeral' + nullable: true + discriminator: + propertyName: type + mapping: + ephemeral: '#/components/schemas/CacheControlEphemeral' type: title: Type enum: @@ -3667,6 +3841,21 @@ components: input: title: Input type: object + SucceededResult: + title: SucceededResult + required: + - type + - message + type: object + properties: + type: + title: Type + enum: + - succeeded + type: string + default: succeeded + message: + $ref: '#/components/schemas/Message' TextContentBlockDelta: title: TextContentBlockDelta required: @@ -3716,6 +3905,18 @@ components: required: - location type: object + x-stainless-skip: + - cli + cache_control: + title: Cache Control + type: 'null' + oneOf: + - $ref: '#/components/schemas/CacheControlEphemeral' + nullable: true + discriminator: + propertyName: type + mapping: + ephemeral: '#/components/schemas/CacheControlEphemeral' additionalProperties: false ToolChoiceAny: title: ToolChoiceAny @@ -3777,34 +3978,39 @@ components: title: Usage required: - input_tokens + - cache_creation_input_tokens + - cache_read_input_tokens - output_tokens type: object properties: input_tokens: title: Input Tokens + minimum: 0 type: integer description: The number of input tokens which were used. example: 2095 + cache_creation_input_tokens: + title: Cache Creation Input Tokens + minimum: 0 + type: integer + description: The number of input tokens used to create the cache entry. + default: + nullable: true + example: 2051 + cache_read_input_tokens: + title: Cache Read Input Tokens + minimum: 0 + type: integer + description: The number of input tokens read from the cache. + default: + nullable: true + example: 2051 output_tokens: title: Output Tokens + minimum: 0 type: integer description: The number of output tokens which were used. example: 503 - BetaMessageBatchResult: - title: Result - oneOf: - - $ref: '#/components/schemas/BetaSucceededResult' - - $ref: '#/components/schemas/BetaErroredResult' - - $ref: '#/components/schemas/BetaCanceledResult' - - $ref: '#/components/schemas/BetaExpiredResult' - description: "Processing result for this request.\n\nContains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration." - discriminator: - propertyName: type - mapping: - canceled: '#/components/schemas/BetaCanceledResult' - errored: '#/components/schemas/BetaErroredResult' - expired: '#/components/schemas/BetaExpiredResult' - succeeded: '#/components/schemas/BetaSucceededResult' CreateMessageParamsWithoutStream: title: CreateMessageParams required: @@ -3900,8 +4106,7 @@ components: AnthropicBeta: anyOf: - type: string - - title: Preset - enum: + - enum: - message-batches-2024-09-24 - prompt-caching-2024-07-31 - computer-use-2024-10-22 @@ -3944,6 +4149,25 @@ components: mapping: text: '#/components/schemas/ResponseTextBlock' tool_use: '#/components/schemas/ResponseToolUseBlock' + InputContentBlock: + oneOf: + - $ref: '#/components/schemas/RequestTextBlock' + - $ref: '#/components/schemas/RequestImageBlock' + - $ref: '#/components/schemas/RequestToolUseBlock' + - $ref: '#/components/schemas/RequestToolResultBlock' + - $ref: '#/components/schemas/RequestDocumentBlock' + discriminator: + propertyName: type + mapping: + document: '#/components/schemas/RequestDocumentBlock' + image: '#/components/schemas/RequestImageBlock' + text: '#/components/schemas/RequestTextBlock' + tool_result: '#/components/schemas/RequestToolResultBlock' + tool_use: '#/components/schemas/RequestToolUseBlock' + x-stainless-python-extend-union: + - ContentBlock + x-stainless-python-extend-union-imports: + - from .content_block import ContentBlock BetaContentBlock: oneOf: - $ref: '#/components/schemas/BetaResponseTextBlock' @@ -3959,11 +4183,11 @@ components: - $ref: '#/components/schemas/BetaRequestImageBlock' - $ref: '#/components/schemas/BetaRequestToolUseBlock' - $ref: '#/components/schemas/BetaRequestToolResultBlock' - - $ref: '#/components/schemas/BetaRequestPDFBlock' + - $ref: '#/components/schemas/BetaRequestDocumentBlock' discriminator: propertyName: type mapping: - document: '#/components/schemas/BetaRequestPDFBlock' + document: '#/components/schemas/BetaRequestDocumentBlock' image: '#/components/schemas/BetaRequestImageBlock' text: '#/components/schemas/BetaRequestTextBlock' tool_result: '#/components/schemas/BetaRequestToolResultBlock' @@ -3973,10 +4197,9 @@ components: type: 'null' anyOf: - type: string - - title: Preset - enum: + - enum: - claude-3-5-haiku-latest - - claude-3-haiku-20241022 + - claude-3-5-haiku-20241022 - claude-3-5-sonnet-latest - claude-3-5-sonnet-20241022 - claude-3-5-sonnet-20240620 @@ -3986,7 +4209,6 @@ components: - claude-3-haiku-20240307 - claude-2.1 - claude-2.0 - - claude-instant-1.2 type: string x-enum-descriptions: - Fast and cost-effective model @@ -4000,7 +4222,6 @@ components: - Our previous fast and cost-effective - - - - x-stainless-nominal: false description: 'The model that will complete your prompt.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.' Ping: diff --git a/src/tests/Anthropic.IntegrationTests/Tests.Streaming.cs b/src/tests/Anthropic.IntegrationTests/Tests.Streaming.cs index 5dcf51f..0a9149a 100755 --- a/src/tests/Anthropic.IntegrationTests/Tests.Streaming.cs +++ b/src/tests/Anthropic.IntegrationTests/Tests.Streaming.cs @@ -17,9 +17,9 @@ public async Task Streaming() var deltas = new List(); await foreach (var response in enumerable) { - Console.Write(response.ContentBlockDelta?.Delta.TextDelta?.Text); + Console.Write(response.ContentBlockDelta?.Delta.Value1?.Text); - deltas.Add(response.ContentBlockDelta?.Delta.TextDelta?.Text ?? string.Empty); + deltas.Add(response.ContentBlockDelta?.Delta.Value1?.Text ?? string.Empty); } deltas.Should().NotBeEmpty().And.HaveCountGreaterThan(5);