From aad836d8d4f1ae06dc37c881b46f04111b77b05c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 1 Oct 2026 02:59:21 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .claude/skills/tryagi-openai/SKILL.md | 2 +- .claude/skills/tryagi-openai/commands.md | 1 - .../CreateImageEditRequestOptionSet.g.cs | 4 +- .../Commands/CreateImageRequestOptionSet.g.cs | 10 +- .../Commands/ImagesApiGroupCommand.g.cs | 1 - ...sCreateImageAsStreamCommandApiCommand.g.cs | 17 +- .../ImagesCreateImageCommandApiCommand.g.cs | 17 +- ...ateImageEditAsStreamCommandApiCommand.g.cs | 17 +- ...magesCreateImageEditCommandApiCommand.g.cs | 17 +- ...CreateImageVariationCommandApiCommand.g.cs | 168 -- .../Generated/autosdk.generated-examples.json | 8 +- ...yAGI.OpenAI.IImagesClient.CreateImage.g.cs | 33 +- ...nAI.IImagesClient.CreateImageAsStream.g.cs | 31 +- ....OpenAI.IImagesClient.CreateImageEdit.g.cs | 28 +- ...IImagesClient.CreateImageEditAsStream.g.cs | 26 +- ...AI.IImagesClient.CreateImageVariation.g.cs | 176 -- ...ryAGI.OpenAI.ImagesClient.CreateImage.g.cs | 39 +- ...enAI.ImagesClient.CreateImageAsStream.g.cs | 35 +- ...I.OpenAI.ImagesClient.CreateImageEdit.g.cs | 42 +- ....ImagesClient.CreateImageEditAsStream.g.cs | 38 +- ...nAI.ImagesClient.CreateImageVariation.g.cs | 2106 ----------------- .../tryAGI.OpenAI.JsonSerializerContext.g.cs | 32 + ...AGI.OpenAI.Models.BetaCompactResource.g.cs | 2 +- ...tryAGI.OpenAI.Models.BetaImageGenTool.g.cs | 4 +- ...MessageContentPartImageImageUrlDetail.g.cs | 6 + .../tryAGI.OpenAI.Models.CompactResource.g.cs | 2 +- ....OpenAI.Models.CreateImageEditRequest.g.cs | 50 +- ....CreateImageEditRequestResponseFormat.g.cs | 3 +- ...yAGI.OpenAI.Models.CreateImageRequest.g.cs | 52 +- ...OpenAI.Models.CreateImageRequestModel.g.cs | 6 + ...enAI.Models.CreateImageRequestQuality.g.cs | 2 - ...dels.CreateImageRequestResponseFormat.g.cs | 4 +- ...OpenAI.Models.CreateImageRequestStyle.g.cs | 2 +- ...AI.Models.CreateImageVariationRequest.g.cs | 14 +- ....OpenAI.Models.EditImageBodyJsonParam.g.cs | 16 +- .../tryAGI.OpenAI.Models.Image2.g.cs | 12 +- .../tryAGI.OpenAI.Models.ImageGenTool.g.cs | 4 +- src/libs/tryAGI.OpenAI/openapi.yaml | 439 +++- 38 files changed, 581 insertions(+), 2885 deletions(-) delete mode 100644 src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageVariationCommandApiCommand.g.cs delete mode 100644 src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageVariation.g.cs delete mode 100644 src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageVariation.g.cs diff --git a/.claude/skills/tryagi-openai/SKILL.md b/.claude/skills/tryagi-openai/SKILL.md index c322888bd..0e0a10291 100644 --- a/.claude/skills/tryagi-openai/SKILL.md +++ b/.claude/skills/tryagi-openai/SKILL.md @@ -43,7 +43,7 @@ dnx tryAGI.OpenAI.CLI --help | `group-organization-role-assignment` | 4 | | | `group-user` | 4 | | | `hosted-tool` | 2 | | -| `image` | 3 | Given a prompt and/or an input image, the model will generate a new image. | +| `image` | 2 | Given a prompt and/or an input image, the model will generate a new image. | | `invite` | 4 | | | `live` | 7 | | | `model` | 3 | List and describe the various models available in the API. | diff --git a/.claude/skills/tryagi-openai/commands.md b/.claude/skills/tryagi-openai/commands.md index f4bf84bf5..b091a4fe8 100644 --- a/.claude/skills/tryagi-openai/commands.md +++ b/.claude/skills/tryagi-openai/commands.md @@ -263,7 +263,6 @@ Given a prompt and/or an input image, the model will generate a new image. |---------|-------|-------------| | `create-image` | `POST /images/generations` | Create image | | `create-image-edit` | `POST /images/edits` | Create image edit | -| `create-image-variation` | `POST /images/variations` | Create image variation | ## `invite` diff --git a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/CreateImageEditRequestOptionSet.g.cs b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/CreateImageEditRequestOptionSet.g.cs index 86d2b2117..255c48e54 100644 --- a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/CreateImageEditRequestOptionSet.g.cs +++ b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/CreateImageEditRequestOptionSet.g.cs @@ -25,7 +25,7 @@ public static CreateImageEditRequestOptionSet Create(string? prefix = null) return new CreateImageEditRequestOptionSet( Prompt: new Option($"--{normalizedPrefix}prompt") { - Description = @"A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.", + Description = @"A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models.", Required = true, }, Maskname: new Option($"--{normalizedPrefix}maskname") @@ -52,7 +52,7 @@ set the output format to `png` or `webp`. }, ResponseFormat: new Option($"--{normalizedPrefix}response-format") { - Description = @"The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.", + Description = @"Legacy response format parameter for retired image models. Unsupported for GPT image models, which always return base64-encoded images.", }, OutputFormat: new Option($"--{normalizedPrefix}output-format") { diff --git a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/CreateImageRequestOptionSet.g.cs b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/CreateImageRequestOptionSet.g.cs index 2b735a236..f1531d34f 100644 --- a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/CreateImageRequestOptionSet.g.cs +++ b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/CreateImageRequestOptionSet.g.cs @@ -26,12 +26,12 @@ public static CreateImageRequestOptionSet Create(string? prefix = null) return new CreateImageRequestOptionSet( Prompt: new Option($"--{normalizedPrefix}prompt") { - Description = @"A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.", + Description = @"A text description of the desired image(s). The maximum length is 32000 characters.", Required = true, }, N: new Option($"--{normalizedPrefix}n") { - Description = @"The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.", + Description = @"The number of images to generate. Must be between 1 and 10.", }, Quality: new Option($"--{normalizedPrefix}quality") { @@ -42,13 +42,11 @@ public static CreateImageRequestOptionSet Create(string? prefix = null) - `high`, `medium` and `low` are supported for the GPT image models. - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support `xhigh` and `max`. -- `hd` and `standard` are supported for `dall-e-3`. -- `standard` is the only option for `dall-e-2`. ", }, ResponseFormat: new Option($"--{normalizedPrefix}response-format") { - Description = @"The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.", + Description = @"Legacy response format parameter for retired image models. Unsupported for GPT image models, which always return base64-encoded images.", }, OutputFormat: new Option($"--{normalizedPrefix}output-format") { @@ -86,7 +84,7 @@ set the output format to `png` or `webp`. }, Style: new Option($"--{normalizedPrefix}style") { - Description = @"The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.", + Description = @"Legacy style parameter for retired image models. Unsupported for GPT image models; describe the desired style in the prompt instead.", }, User: new Option($"--{normalizedPrefix}user") { diff --git a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesApiGroupCommand.g.cs b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesApiGroupCommand.g.cs index 7a0c292a4..6df80a691 100644 --- a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesApiGroupCommand.g.cs +++ b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesApiGroupCommand.g.cs @@ -15,7 +15,6 @@ public static Command Create() command.Subcommands.Add(ImagesCreateImageAsStreamCommandApiCommand.Create()); command.Subcommands.Add(ImagesCreateImageEditCommandApiCommand.Create()); command.Subcommands.Add(ImagesCreateImageEditAsStreamCommandApiCommand.Create()); - command.Subcommands.Add(ImagesCreateImageVariationCommandApiCommand.Create()); CustomizeCommand(ref command); return command; } diff --git a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageAsStreamCommandApiCommand.g.cs b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageAsStreamCommandApiCommand.g.cs index fa33f8289..3cd23ca0b 100644 --- a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageAsStreamCommandApiCommand.g.cs +++ b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageAsStreamCommandApiCommand.g.cs @@ -7,16 +7,17 @@ namespace tryAGI.OpenAI.Cli.GeneratedApi.Commands; internal static partial class ImagesCreateImageAsStreamCommandApiCommand { - private static Option?> Model { get; } = new( + private static Option> Model { get; } = new( name: @"--model") { - Description = @"The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.", + Description = @"The GPT image model to use for image generation. Specify a model explicitly. Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.", + Required = true, }; private static Option?> Size { get; } = new( name: @"--size") { - Description = @"The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.", + Description = @"The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.", }; private static readonly CreateImageRequestOptionSet CreateImageRequestOptionSetOptions = CreateImageRequestOptionSet.Create(); private static Option Input { get; } = new(@"--input") @@ -41,19 +42,17 @@ internal static partial class ImagesCreateImageAsStreamCommandApiCommand public static Command Create(string? commandName = null) { var command = new Command(commandName ?? @"create-image-as-stream", @"Create image -Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). +Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). "); command.Options.Add(Model); command.Options.Add(Size); command.Options.Add(CreateImageRequestOptionSetOptions.Prompt); command.Options.Add(CreateImageRequestOptionSetOptions.N); command.Options.Add(CreateImageRequestOptionSetOptions.Quality); - command.Options.Add(CreateImageRequestOptionSetOptions.ResponseFormat); command.Options.Add(CreateImageRequestOptionSetOptions.OutputFormat); command.Options.Add(CreateImageRequestOptionSetOptions.OutputCompression); command.Options.Add(CreateImageRequestOptionSetOptions.PartialImages); command.Options.Add(CreateImageRequestOptionSetOptions.Moderation); command.Options.Add(CreateImageRequestOptionSetOptions.Background); - command.Options.Add(CreateImageRequestOptionSetOptions.Style); command.Options.Add(CreateImageRequestOptionSetOptions.User); command.Options.Add(Input); command.Options.Add(RequestJson); @@ -80,17 +79,15 @@ await CliRuntime.RunAsync(async () => RequestFile, global::tryAGI.OpenAI.SourceGenerationContext.Default, cancellationToken).ConfigureAwait(false); - var model = CliRuntime.WasSpecified(parseResult, Model) ? parseResult.GetValue(Model) : (__requestBase is { } __ModelBaseValue ? __ModelBaseValue.Model : default); + var model = parseResult.GetRequiredValue(Model); var size = CliRuntime.WasSpecified(parseResult, Size) ? parseResult.GetValue(Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); var prompt = parseResult.GetRequiredValue(CreateImageRequestOptionSetOptions.Prompt); var n = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.N) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); var quality = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.Quality) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.Quality) : (__requestBase is { } __QualityBaseValue ? __QualityBaseValue.Quality : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.ResponseFormat) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); var outputFormat = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.OutputFormat) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.OutputFormat) : (__requestBase is { } __OutputFormatBaseValue ? __OutputFormatBaseValue.OutputFormat : default); var outputCompression = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.OutputCompression) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.OutputCompression) : (__requestBase is { } __OutputCompressionBaseValue ? __OutputCompressionBaseValue.OutputCompression : default); var partialImages = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.PartialImages) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.PartialImages) : (__requestBase is { } __PartialImagesBaseValue ? __PartialImagesBaseValue.PartialImages : default); var moderation = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.Moderation) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.Moderation) : (__requestBase is { } __ModerationBaseValue ? __ModerationBaseValue.Moderation : default); var background = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.Background) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.Background) : (__requestBase is { } __BackgroundBaseValue ? __BackgroundBaseValue.Background : default); - var style = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.Style) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.Style) : (__requestBase is { } __StyleBaseValue ? __StyleBaseValue.Style : default); var user = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.User) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); @@ -101,13 +98,11 @@ await CliRuntime.RunAsync(async () => prompt: prompt, n: n, quality: quality, - responseFormat: responseFormat, outputFormat: outputFormat, outputCompression: outputCompression, partialImages: partialImages, moderation: moderation, background: background, - style: style, user: user, cancellationToken: cancellationToken); diff --git a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageCommandApiCommand.g.cs b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageCommandApiCommand.g.cs index 12a538aea..e90a6467c 100644 --- a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageCommandApiCommand.g.cs +++ b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageCommandApiCommand.g.cs @@ -7,16 +7,17 @@ namespace tryAGI.OpenAI.Cli.GeneratedApi.Commands; internal static partial class ImagesCreateImageCommandApiCommand { - private static Option?> Model { get; } = new( + private static Option> Model { get; } = new( name: @"--model") { - Description = @"The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.", + Description = @"The GPT image model to use for image generation. Specify a model explicitly. Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.", + Required = true, }; private static Option?> Size { get; } = new( name: @"--size") { - Description = @"The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.", + Description = @"The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.", }; private static readonly CreateImageRequestOptionSet CreateImageRequestOptionSetOptions = CreateImageRequestOptionSet.Create(); private static Option Input { get; } = new(@"--input") @@ -61,19 +62,17 @@ private static string FormatResponse(ParseResult parseResult, global::tryAGI.Ope public static Command Create(string? commandName = null) { var command = new Command(commandName ?? @"create-image", @"Create image -Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). +Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). "); command.Options.Add(Model); command.Options.Add(Size); command.Options.Add(CreateImageRequestOptionSetOptions.Prompt); command.Options.Add(CreateImageRequestOptionSetOptions.N); command.Options.Add(CreateImageRequestOptionSetOptions.Quality); - command.Options.Add(CreateImageRequestOptionSetOptions.ResponseFormat); command.Options.Add(CreateImageRequestOptionSetOptions.OutputFormat); command.Options.Add(CreateImageRequestOptionSetOptions.OutputCompression); command.Options.Add(CreateImageRequestOptionSetOptions.PartialImages); command.Options.Add(CreateImageRequestOptionSetOptions.Moderation); command.Options.Add(CreateImageRequestOptionSetOptions.Background); - command.Options.Add(CreateImageRequestOptionSetOptions.Style); command.Options.Add(CreateImageRequestOptionSetOptions.User); command.Options.Add(Input); command.Options.Add(RequestJson); @@ -100,17 +99,15 @@ await CliRuntime.RunAsync(async () => RequestFile, global::tryAGI.OpenAI.SourceGenerationContext.Default, cancellationToken).ConfigureAwait(false); - var model = CliRuntime.WasSpecified(parseResult, Model) ? parseResult.GetValue(Model) : (__requestBase is { } __ModelBaseValue ? __ModelBaseValue.Model : default); + var model = parseResult.GetRequiredValue(Model); var size = CliRuntime.WasSpecified(parseResult, Size) ? parseResult.GetValue(Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); var prompt = parseResult.GetRequiredValue(CreateImageRequestOptionSetOptions.Prompt); var n = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.N) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); var quality = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.Quality) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.Quality) : (__requestBase is { } __QualityBaseValue ? __QualityBaseValue.Quality : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.ResponseFormat) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); var outputFormat = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.OutputFormat) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.OutputFormat) : (__requestBase is { } __OutputFormatBaseValue ? __OutputFormatBaseValue.OutputFormat : default); var outputCompression = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.OutputCompression) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.OutputCompression) : (__requestBase is { } __OutputCompressionBaseValue ? __OutputCompressionBaseValue.OutputCompression : default); var partialImages = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.PartialImages) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.PartialImages) : (__requestBase is { } __PartialImagesBaseValue ? __PartialImagesBaseValue.PartialImages : default); var moderation = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.Moderation) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.Moderation) : (__requestBase is { } __ModerationBaseValue ? __ModerationBaseValue.Moderation : default); var background = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.Background) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.Background) : (__requestBase is { } __BackgroundBaseValue ? __BackgroundBaseValue.Background : default); - var style = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.Style) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.Style) : (__requestBase is { } __StyleBaseValue ? __StyleBaseValue.Style : default); var user = CliRuntime.WasSpecified(parseResult, CreateImageRequestOptionSetOptions.User) ? parseResult.GetValue(CreateImageRequestOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); @@ -121,13 +118,11 @@ await CliRuntime.RunAsync(async () => prompt: prompt, n: n, quality: quality, - responseFormat: responseFormat, outputFormat: outputFormat, outputCompression: outputCompression, partialImages: partialImages, moderation: moderation, background: background, - style: style, user: user, cancellationToken: cancellationToken).ConfigureAwait(false); diff --git a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageEditAsStreamCommandApiCommand.g.cs b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageEditAsStreamCommandApiCommand.g.cs index 9cddbc0b9..c4baa14b2 100644 --- a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageEditAsStreamCommandApiCommand.g.cs +++ b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageEditAsStreamCommandApiCommand.g.cs @@ -18,9 +18,6 @@ For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest` follows the same input constraints as GPT image models. - -For `dall-e-2`, you can only provide one image, and it should be a square `png` -file less than 4MB. ", Required = true, }; @@ -31,16 +28,17 @@ file less than 4MB. Description = @"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.", }; - private static Option?> Model { get; } = new( + private static Option> Model { get; } = new( name: @"--model") { - Description = @"The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`.", + Description = @"The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).", + Required = true, }; private static Option?> Size { get; } = new( name: @"--size") { - Description = @"The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.", + Description = @"The size of the generated images. Defaults to `auto`. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.", }; private static Option InputFidelity { get; } = new( @@ -71,7 +69,7 @@ file less than 4MB. public static Command Create(string? commandName = null) { var command = new Command(commandName ?? @"create-image-edit-as-stream", @"Create image edit -Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`."); +Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models."); command.Options.Add(Image); command.Options.Add(Mask); command.Options.Add(Model); @@ -80,7 +78,6 @@ public static Command Create(string? commandName = null) command.Options.Add(CreateImageEditRequestOptionSetOptions.Maskname); command.Options.Add(CreateImageEditRequestOptionSetOptions.Background); command.Options.Add(CreateImageEditRequestOptionSetOptions.N); - command.Options.Add(CreateImageEditRequestOptionSetOptions.ResponseFormat); command.Options.Add(CreateImageEditRequestOptionSetOptions.OutputFormat); command.Options.Add(CreateImageEditRequestOptionSetOptions.OutputCompression); command.Options.Add(CreateImageEditRequestOptionSetOptions.User); @@ -113,13 +110,12 @@ await CliRuntime.RunAsync(async () => cancellationToken).ConfigureAwait(false); var image = parseResult.GetRequiredValue(Image); var mask = CliRuntime.WasSpecified(parseResult, Mask) ? parseResult.GetValue(Mask) : (__requestBase is { } __MaskBaseValue ? __MaskBaseValue.Mask : default); - var model = CliRuntime.WasSpecified(parseResult, Model) ? parseResult.GetValue(Model) : (__requestBase is { } __ModelBaseValue ? __ModelBaseValue.Model : default); + var model = parseResult.GetRequiredValue(Model); var size = CliRuntime.WasSpecified(parseResult, Size) ? parseResult.GetValue(Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); var inputFidelity = CliRuntime.WasSpecified(parseResult, InputFidelity) ? parseResult.GetValue(InputFidelity) : (__requestBase is { } __InputFidelityBaseValue ? __InputFidelityBaseValue.InputFidelity : default); var prompt = parseResult.GetRequiredValue(CreateImageEditRequestOptionSetOptions.Prompt); var maskname = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.Maskname) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.Maskname) : (__requestBase is { } __MasknameBaseValue ? __MasknameBaseValue.Maskname : default); var background = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.Background) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.Background) : (__requestBase is { } __BackgroundBaseValue ? __BackgroundBaseValue.Background : default); var n = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.N) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.ResponseFormat) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); var outputFormat = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.OutputFormat) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.OutputFormat) : (__requestBase is { } __OutputFormatBaseValue ? __OutputFormatBaseValue.OutputFormat : default); var outputCompression = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.OutputCompression) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.OutputCompression) : (__requestBase is { } __OutputCompressionBaseValue ? __OutputCompressionBaseValue.OutputCompression : default); var user = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.User) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); @@ -138,7 +134,6 @@ await CliRuntime.RunAsync(async () => maskname: maskname, background: background, n: n, - responseFormat: responseFormat, outputFormat: outputFormat, outputCompression: outputCompression, user: user, diff --git a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageEditCommandApiCommand.g.cs b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageEditCommandApiCommand.g.cs index 5378988b0..aeff4c2d3 100644 --- a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageEditCommandApiCommand.g.cs +++ b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageEditCommandApiCommand.g.cs @@ -18,9 +18,6 @@ For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest` follows the same input constraints as GPT image models. - -For `dall-e-2`, you can only provide one image, and it should be a square `png` -file less than 4MB. ", Required = true, }; @@ -31,16 +28,17 @@ file less than 4MB. Description = @"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.", }; - private static Option?> Model { get; } = new( + private static Option> Model { get; } = new( name: @"--model") { - Description = @"The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`.", + Description = @"The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).", + Required = true, }; private static Option?> Size { get; } = new( name: @"--size") { - Description = @"The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.", + Description = @"The size of the generated images. Defaults to `auto`. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.", }; private static Option InputFidelity { get; } = new( @@ -91,7 +89,7 @@ private static string FormatResponse(ParseResult parseResult, global::tryAGI.Ope public static Command Create(string? commandName = null) { var command = new Command(commandName ?? @"create-image-edit", @"Create image edit -Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`."); +Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models."); command.Options.Add(Image); command.Options.Add(Mask); command.Options.Add(Model); @@ -100,7 +98,6 @@ public static Command Create(string? commandName = null) command.Options.Add(CreateImageEditRequestOptionSetOptions.Maskname); command.Options.Add(CreateImageEditRequestOptionSetOptions.Background); command.Options.Add(CreateImageEditRequestOptionSetOptions.N); - command.Options.Add(CreateImageEditRequestOptionSetOptions.ResponseFormat); command.Options.Add(CreateImageEditRequestOptionSetOptions.OutputFormat); command.Options.Add(CreateImageEditRequestOptionSetOptions.OutputCompression); command.Options.Add(CreateImageEditRequestOptionSetOptions.User); @@ -133,13 +130,12 @@ await CliRuntime.RunAsync(async () => cancellationToken).ConfigureAwait(false); var image = parseResult.GetRequiredValue(Image); var mask = CliRuntime.WasSpecified(parseResult, Mask) ? parseResult.GetValue(Mask) : (__requestBase is { } __MaskBaseValue ? __MaskBaseValue.Mask : default); - var model = CliRuntime.WasSpecified(parseResult, Model) ? parseResult.GetValue(Model) : (__requestBase is { } __ModelBaseValue ? __ModelBaseValue.Model : default); + var model = parseResult.GetRequiredValue(Model); var size = CliRuntime.WasSpecified(parseResult, Size) ? parseResult.GetValue(Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); var inputFidelity = CliRuntime.WasSpecified(parseResult, InputFidelity) ? parseResult.GetValue(InputFidelity) : (__requestBase is { } __InputFidelityBaseValue ? __InputFidelityBaseValue.InputFidelity : default); var prompt = parseResult.GetRequiredValue(CreateImageEditRequestOptionSetOptions.Prompt); var maskname = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.Maskname) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.Maskname) : (__requestBase is { } __MasknameBaseValue ? __MasknameBaseValue.Maskname : default); var background = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.Background) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.Background) : (__requestBase is { } __BackgroundBaseValue ? __BackgroundBaseValue.Background : default); var n = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.N) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.ResponseFormat) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); var outputFormat = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.OutputFormat) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.OutputFormat) : (__requestBase is { } __OutputFormatBaseValue ? __OutputFormatBaseValue.OutputFormat : default); var outputCompression = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.OutputCompression) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.OutputCompression) : (__requestBase is { } __OutputCompressionBaseValue ? __OutputCompressionBaseValue.OutputCompression : default); var user = CliRuntime.WasSpecified(parseResult, CreateImageEditRequestOptionSetOptions.User) ? parseResult.GetValue(CreateImageEditRequestOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); @@ -158,7 +154,6 @@ await CliRuntime.RunAsync(async () => maskname: maskname, background: background, n: n, - responseFormat: responseFormat, outputFormat: outputFormat, outputCompression: outputCompression, user: user, diff --git a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageVariationCommandApiCommand.g.cs b/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageVariationCommandApiCommand.g.cs deleted file mode 100644 index 956ff2a98..000000000 --- a/src/libs/tryAGI.OpenAI.CLI/GeneratedApi/Commands/ImagesCreateImageVariationCommandApiCommand.g.cs +++ /dev/null @@ -1,168 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace tryAGI.OpenAI.Cli.GeneratedApi.Commands; - -internal static partial class ImagesCreateImageVariationCommandApiCommand -{ - private static Option Image { get; } = new( - name: @"--image") - { - Description = @"The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.", - Required = true, - }; - - private static Option Imagename { get; } = new( - name: @"--imagename") - { - Description = @"The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.", - Required = true, - }; - - private static Option?> Model { get; } = new( - name: @"--model") - { - Description = @"The model to use for image generation. Only `dall-e-2` is supported at this time.", - }; - - private static Option N { get; } = new( - name: @"--n") - { - Description = @"The number of images to generate. Must be between 1 and 10.", - }; - - private static Option ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.", - }; - - private static Option Size { get; } = new( - name: @"--size") - { - Description = @"The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.", - }; - - private static Option User { get; } = new( - name: @"--user") - { - Description = @"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). -", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::tryAGI.OpenAI.ImagesResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::tryAGI.OpenAI.ImagesResponse value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - static partial void CustomizeCommand(ref Command command); - - public static Command Create(string? commandName = null) - { - var command = new Command(commandName ?? @"create-image-variation", @"Create image variation -Creates a variation of a given image. This endpoint only supports `dall-e-2`."); - command.Options.Add(Image); - command.Options.Add(Imagename); - command.Options.Add(Model); - command.Options.Add(N); - command.Options.Add(ResponseFormat); - command.Options.Add(Size); - command.Options.Add(User); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::tryAGI.OpenAI.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var image = parseResult.GetRequiredValue(Image); - var imagename = parseResult.GetRequiredValue(Imagename); - var model = CliRuntime.WasSpecified(parseResult, Model) ? parseResult.GetValue(Model) : (__requestBase is { } __ModelBaseValue ? __ModelBaseValue.Model : default); - var n = CliRuntime.WasSpecified(parseResult, N) ? parseResult.GetValue(N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var size = CliRuntime.WasSpecified(parseResult, Size) ? parseResult.GetValue(Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); - var user = CliRuntime.WasSpecified(parseResult, User) ? parseResult.GetValue(User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.Images.CreateImageVariationAsync( - image: image, - imagename: imagename, - model: model, - n: n, - responseFormat: responseFormat, - size: size, - user: user, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::tryAGI.OpenAI.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::tryAGI.OpenAI.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - CustomizeCommand(ref command); - return command; - } -} \ No newline at end of file diff --git a/src/libs/tryAGI.OpenAI/Generated/autosdk.generated-examples.json b/src/libs/tryAGI.OpenAI/Generated/autosdk.generated-examples.json index 15855cfe3..ec3e816a4 100644 --- a/src/libs/tryAGI.OpenAI/Generated/autosdk.generated-examples.json +++ b/src/libs/tryAGI.OpenAI/Generated/autosdk.generated-examples.json @@ -103,9 +103,9 @@ "Order": 10, "Title": "Create image", "Slug": "createimage", - "Description": "Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision).", + "Description": "Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision).", "Language": "http", - "Code": "### Create image\n# @name createImage\nPOST {{host}}/images/generations\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, text/event-stream\n\n{\n \u0022prompt\u0022: \u0022A cute baby sea otter\u0022,\n \u0022model\u0022: \u0022gpt-image-2.5-flare\u0022,\n \u0022n\u0022: 1,\n \u0022quality\u0022: \u0022medium\u0022,\n \u0022response_format\u0022: \u0022url\u0022,\n \u0022output_format\u0022: \u0022png\u0022,\n \u0022output_compression\u0022: 100,\n \u0022stream\u0022: false,\n \u0022partial_images\u0022: 1,\n \u0022size\u0022: \u00221024x1024\u0022,\n \u0022moderation\u0022: \u0022low\u0022,\n \u0022background\u0022: \u0022transparent\u0022,\n \u0022style\u0022: \u0022vivid\u0022,\n \u0022user\u0022: \u0022user-1234\u0022\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json, text/event-stream\n# 400\n# Description: Invalid image request, including invalid DALL-E parameters or input.\n# Content-Type: application/json\n# 403\n# Description: The project does not have access to the requested model.\n# Content-Type: application/json\n# 410\n# Description: The requested DALL-E image endpoint is unavailable because it has been retired.\n# Content-Type: application/json\n# 429\n# Description: The request was rejected because a rate limit was exceeded. A slow_down error means traffic increased too quickly; reduce your request rate, then increase it gradually.\n# Content-Type: application/json\n# 500\n# Description: The image could not be generated or processed.\n# Content-Type: application/json\n# 503\n# Description: The service is temporarily unavailable. A server_is_overloaded error means the requested model is temporarily overloaded; retry after a brief delay.\n# Content-Type: application/json", + "Code": "### Create image\n# @name createImage\nPOST {{host}}/images/generations\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, text/event-stream\n\n{\n \u0022prompt\u0022: \u0022A cute baby sea otter\u0022,\n \u0022model\u0022: \u0022gpt-image-2.5-flare\u0022,\n \u0022n\u0022: 1,\n \u0022quality\u0022: \u0022medium\u0022,\n \u0022response_format\u0022: \u0022url\u0022,\n \u0022output_format\u0022: \u0022png\u0022,\n \u0022output_compression\u0022: 100,\n \u0022stream\u0022: false,\n \u0022partial_images\u0022: 1,\n \u0022size\u0022: \u00221024x1024\u0022,\n \u0022moderation\u0022: \u0022low\u0022,\n \u0022background\u0022: \u0022transparent\u0022,\n \u0022style\u0022: \u0022vivid\u0022,\n \u0022user\u0022: \u0022user-1234\u0022\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json, text/event-stream\n# 400\n# Description: Invalid image request, including invalid parameters or input.\n# Content-Type: application/json\n# 403\n# Description: The project does not have access to the requested model.\n# Content-Type: application/json\n# 410\n# Description: The requested DALL-E image endpoint is unavailable because it has been retired.\n# Content-Type: application/json\n# 429\n# Description: The request was rejected because a rate limit was exceeded. A slow_down error means traffic increased too quickly; reduce your request rate, then increase it gradually.\n# Content-Type: application/json\n# 500\n# Description: The image could not be generated or processed.\n# Content-Type: application/json\n# 503\n# Description: The service is temporarily unavailable. A server_is_overloaded error means the requested model is temporarily overloaded; retry after a brief delay.\n# Content-Type: application/json", "Format": "http", "OperationId": "createImage", "Setup": null @@ -114,9 +114,9 @@ "Order": 11, "Title": "Create image edit", "Slug": "createimageedit", - "Description": "Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and \u0060dall-e-2\u0060.", + "Description": "Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models.", "Language": "http", - "Code": "### Create image edit\n# @name createImageEdit\nPOST {{host}}/images/edits\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json, text/event-stream\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA cute baby sea otter wearing a beret\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022background\u0022\n\ntransparent\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022model\u0022\n\ngpt-image-1.5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022n\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022size\u0022\n\n1024x1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022response_format\u0022\n\nurl\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022output_format\u0022\n\npng\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022output_compression\u0022\n\n100\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022user\u0022\n\nuser-1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022input_fidelity\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022stream\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022partial_images\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nhigh\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json, text/event-stream\n# 400\n# Description: Invalid image request, including invalid DALL-E parameters or input.\n# Content-Type: application/json\n# 403\n# Description: The project does not have access to the requested model.\n# Content-Type: application/json\n# 410\n# Description: The requested DALL-E image endpoint is unavailable because it has been retired.\n# Content-Type: application/json\n# 429\n# Description: The request was rejected because a rate limit was exceeded. A slow_down error means traffic increased too quickly; reduce your request rate, then increase it gradually.\n# Content-Type: application/json\n# 500\n# Description: The image could not be generated or processed.\n# Content-Type: application/json\n# 503\n# Description: The service is temporarily unavailable. A server_is_overloaded error means the requested model is temporarily overloaded; retry after a brief delay.\n# Content-Type: application/json", + "Code": "### Create image edit\n# @name createImageEdit\nPOST {{host}}/images/edits\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json, text/event-stream\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA cute baby sea otter wearing a beret\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022background\u0022\n\ntransparent\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022model\u0022\n\ngpt-image-1.5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022n\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022size\u0022\n\n1024x1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022response_format\u0022\n\nurl\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022output_format\u0022\n\npng\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022output_compression\u0022\n\n100\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022user\u0022\n\nuser-1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022input_fidelity\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022stream\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022partial_images\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nhigh\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json, text/event-stream\n# 400\n# Description: Invalid image request, including invalid parameters or input.\n# Content-Type: application/json\n# 403\n# Description: The project does not have access to the requested model.\n# Content-Type: application/json\n# 410\n# Description: The requested DALL-E image endpoint is unavailable because it has been retired.\n# Content-Type: application/json\n# 429\n# Description: The request was rejected because a rate limit was exceeded. A slow_down error means traffic increased too quickly; reduce your request rate, then increase it gradually.\n# Content-Type: application/json\n# 500\n# Description: The image could not be generated or processed.\n# Content-Type: application/json\n# 503\n# Description: The service is temporarily unavailable. A server_is_overloaded error means the requested model is temporarily overloaded; retry after a brief delay.\n# Content-Type: application/json", "Format": "http", "OperationId": "createImageEdit", "Setup": null diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImage.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImage.g.cs index 3d480d6c0..eca8efdf5 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImage.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImage.g.cs @@ -1,12 +1,14 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace tryAGI.OpenAI { public partial interface IImagesClient { /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -19,7 +21,7 @@ public partial interface IImagesClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -32,19 +34,18 @@ public partial interface IImagesClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// - /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ /// A text description of the desired image(s). The maximum length is 32000 characters.
/// Example: A cute baby sea otter /// /// - /// The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
- /// Default Value: dall-e-2
+ /// The GPT image model to use for image generation. Specify a model explicitly. Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
/// Example: gpt-image-2.5-flare /// /// - /// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
+ /// The number of images to generate. Must be between 1 and 10.
/// Default Value: 1
/// Example: 1 /// @@ -55,16 +56,9 @@ public partial interface IImagesClient /// - `high`, `medium` and `low` are supported for the GPT image models.
/// - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
/// snapshots, also support `xhigh` and `max`.
- /// - `hd` and `standard` are supported for `dall-e-3`.
- /// - `standard` is the only option for `dall-e-2`.
/// Default Value: auto
/// Example: medium /// - /// - /// The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.
- /// Default Value: url
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
/// Default Value: png
@@ -77,7 +71,7 @@ public partial interface IImagesClient /// /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto
/// Example: 1024x1024 /// @@ -99,11 +93,6 @@ public partial interface IImagesClient /// Default Value: auto
/// Example: transparent /// - /// - /// The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
- /// Default Value: vivid
- /// Example: vivid - /// /// /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
/// Example: user-1234 @@ -113,17 +102,15 @@ public partial interface IImagesClient /// global::System.Threading.Tasks.Task CreateImageAsync( string prompt, - global::tryAGI.OpenAI.AnyOf? model = default, + global::tryAGI.OpenAI.AnyOf model, int? n = default, global::tryAGI.OpenAI.CreateImageRequestQuality? quality = default, - global::tryAGI.OpenAI.CreateImageRequestResponseFormat? responseFormat = default, global::tryAGI.OpenAI.CreateImageRequestOutputFormat? outputFormat = default, int? outputCompression = default, int? partialImages = default, global::tryAGI.OpenAI.AnyOf? size = default, global::tryAGI.OpenAI.CreateImageRequestModeration? moderation = default, global::tryAGI.OpenAI.CreateImageRequestBackground? background = default, - global::tryAGI.OpenAI.CreateImageRequestStyle? style = default, string? user = default, global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageAsStream.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageAsStream.g.cs index ab51741d4..d5f04f309 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageAsStream.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageAsStream.g.cs @@ -1,12 +1,14 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace tryAGI.OpenAI { public partial interface IImagesClient { /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -19,19 +21,18 @@ public partial interface IImagesClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// - /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ /// A text description of the desired image(s). The maximum length is 32000 characters.
/// Example: A cute baby sea otter /// /// - /// The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
- /// Default Value: dall-e-2
+ /// The GPT image model to use for image generation. Specify a model explicitly. Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
/// Example: gpt-image-2.5-flare /// /// - /// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
+ /// The number of images to generate. Must be between 1 and 10.
/// Default Value: 1
/// Example: 1 /// @@ -42,16 +43,9 @@ public partial interface IImagesClient /// - `high`, `medium` and `low` are supported for the GPT image models.
/// - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
/// snapshots, also support `xhigh` and `max`.
- /// - `hd` and `standard` are supported for `dall-e-3`.
- /// - `standard` is the only option for `dall-e-2`.
/// Default Value: auto
/// Example: medium /// - /// - /// The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.
- /// Default Value: url
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
/// Default Value: png
@@ -64,7 +58,7 @@ public partial interface IImagesClient /// /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto
/// Example: 1024x1024 /// @@ -86,11 +80,6 @@ public partial interface IImagesClient /// Default Value: auto
/// Example: transparent /// - /// - /// The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
- /// Default Value: vivid
- /// Example: vivid - /// /// /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
/// Example: user-1234 @@ -100,17 +89,15 @@ public partial interface IImagesClient /// global::System.Collections.Generic.IAsyncEnumerable CreateImageAsStreamAsync( string prompt, - global::tryAGI.OpenAI.AnyOf? model = default, + global::tryAGI.OpenAI.AnyOf model, int? n = default, global::tryAGI.OpenAI.CreateImageRequestQuality? quality = default, - global::tryAGI.OpenAI.CreateImageRequestResponseFormat? responseFormat = default, global::tryAGI.OpenAI.CreateImageRequestOutputFormat? outputFormat = default, int? outputCompression = default, int? partialImages = default, global::tryAGI.OpenAI.AnyOf? size = default, global::tryAGI.OpenAI.CreateImageRequestModeration? moderation = default, global::tryAGI.OpenAI.CreateImageRequestBackground? background = default, - global::tryAGI.OpenAI.CreateImageRequestStyle? style = default, string? user = default, global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEdit.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEdit.g.cs index 208e835b0..508e93903 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEdit.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEdit.g.cs @@ -1,12 +1,14 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace tryAGI.OpenAI { public partial interface IImagesClient { /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -19,7 +21,7 @@ public partial interface IImagesClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -32,7 +34,7 @@ public partial interface IImagesClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// The image(s) to edit. Must be a supported image file or an array of images.
@@ -41,12 +43,10 @@ public partial interface IImagesClient /// `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
/// `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg`
/// file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest`
- /// follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square `png`
- /// file less than 4MB. + /// follows the same input constraints as GPT image models. /// /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
+ /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models.
/// Example: A cute baby sea otter wearing a beret /// /// @@ -69,8 +69,7 @@ public partial interface IImagesClient /// Example: transparent /// /// - /// The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
+ /// The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).
/// Example: gpt-image-1.5 /// /// @@ -79,14 +78,10 @@ public partial interface IImagesClient /// Example: 1 /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
+ /// The size of the generated images. Defaults to `auto`. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
+ /// Default Value: auto
/// Example: 1024x1024 /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is
/// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
@@ -118,13 +113,12 @@ public partial interface IImagesClient global::System.Threading.Tasks.Task CreateImageEditAsync( global::tryAGI.OpenAI.AnyOf> image, string prompt, + global::tryAGI.OpenAI.AnyOf model, byte[]? mask = default, string? maskname = default, global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, int? n = default, global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, int? outputCompression = default, string? user = default, diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEditAsStream.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEditAsStream.g.cs index 83291a88b..687e41d70 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEditAsStream.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEditAsStream.g.cs @@ -1,12 +1,14 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace tryAGI.OpenAI { public partial interface IImagesClient { /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -19,7 +21,7 @@ public partial interface IImagesClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// The image(s) to edit. Must be a supported image file or an array of images.
@@ -28,12 +30,10 @@ public partial interface IImagesClient /// `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
/// `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg`
/// file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest`
- /// follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square `png`
- /// file less than 4MB. + /// follows the same input constraints as GPT image models. /// /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
+ /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models.
/// Example: A cute baby sea otter wearing a beret /// /// @@ -56,8 +56,7 @@ public partial interface IImagesClient /// Example: transparent /// /// - /// The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
+ /// The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).
/// Example: gpt-image-1.5 /// /// @@ -66,14 +65,10 @@ public partial interface IImagesClient /// Example: 1 /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
+ /// The size of the generated images. Defaults to `auto`. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
+ /// Default Value: auto
/// Example: 1024x1024 /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is
/// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
@@ -105,13 +100,12 @@ public partial interface IImagesClient global::System.Collections.Generic.IAsyncEnumerable CreateImageEditAsStreamAsync( global::tryAGI.OpenAI.AnyOf> image, string prompt, + global::tryAGI.OpenAI.AnyOf model, byte[]? mask = default, string? maskname = default, global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, int? n = default, global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, int? outputCompression = default, string? user = default, diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageVariation.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageVariation.g.cs deleted file mode 100644 index 97e6cef6a..000000000 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageVariation.g.cs +++ /dev/null @@ -1,176 +0,0 @@ -#nullable enable - -namespace tryAGI.OpenAI -{ - public partial interface IImagesClient - { - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateImageVariationAsync( - - global::tryAGI.OpenAI.CreateImageVariationRequest request, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> CreateImageVariationAsResponseAsync( - - global::tryAGI.OpenAI.CreateImageVariationRequest request, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The model to use for image generation. Only `dall-e-2` is supported at this time.
- /// Default Value: dall-e-2
- /// Example: dall-e-2 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.
- /// Default Value: url
- /// Example: url - /// - /// - /// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
- /// Example: user-1234 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateImageVariationAsync( - byte[] image, - string imagename, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageVariationRequestSize? size = default, - string? user = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The model to use for image generation. Only `dall-e-2` is supported at this time.
- /// Default Value: dall-e-2
- /// Example: dall-e-2 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.
- /// Default Value: url
- /// Example: url - /// - /// - /// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
- /// Example: user-1234 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateImageVariationAsync( - global::System.IO.Stream image, - string imagename, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageVariationRequestSize? size = default, - string? user = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The model to use for image generation. Only `dall-e-2` is supported at this time.
- /// Default Value: dall-e-2
- /// Example: dall-e-2 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.
- /// Default Value: url
- /// Example: url - /// - /// - /// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
- /// Example: user-1234 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> CreateImageVariationAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageVariationRequestSize? size = default, - string? user = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImage.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImage.g.cs index e337ac2fe..ed574fc7a 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImage.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImage.g.cs @@ -1,6 +1,8 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace tryAGI.OpenAI { public partial class ImagesClient @@ -43,7 +45,7 @@ partial void ProcessCreateImageResponseContent( /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -66,7 +68,7 @@ partial void ProcessCreateImageResponseContent( } /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -86,7 +88,6 @@ partial void ProcessCreateImageResponseContent( Model = request.Model, N = request.N, Quality = request.Quality, - ResponseFormat = request.ResponseFormat, OutputFormat = request.OutputFormat, OutputCompression = request.OutputCompression, Stream = false, @@ -94,7 +95,6 @@ partial void ProcessCreateImageResponseContent( Size = request.Size, Moderation = request.Moderation, Background = request.Background, - Style = request.Style, User = request.User, }; PrepareArguments( @@ -358,7 +358,7 @@ partial void ProcessCreateImageResponseContent( retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid image request, including invalid DALL-E parameters or input. + // Invalid image request, including invalid parameters or input. if ((int)__response.StatusCode == 400) { string? __content_400 = null; @@ -678,19 +678,18 @@ partial void ProcessCreateImageResponseContent( } /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// - /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ /// A text description of the desired image(s). The maximum length is 32000 characters.
/// Example: A cute baby sea otter /// /// - /// The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
- /// Default Value: dall-e-2
+ /// The GPT image model to use for image generation. Specify a model explicitly. Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
/// Example: gpt-image-2.5-flare /// /// - /// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
+ /// The number of images to generate. Must be between 1 and 10.
/// Default Value: 1
/// Example: 1 /// @@ -701,16 +700,9 @@ partial void ProcessCreateImageResponseContent( /// - `high`, `medium` and `low` are supported for the GPT image models.
/// - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
/// snapshots, also support `xhigh` and `max`.
- /// - `hd` and `standard` are supported for `dall-e-3`.
- /// - `standard` is the only option for `dall-e-2`.
/// Default Value: auto
/// Example: medium /// - /// - /// The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.
- /// Default Value: url
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
/// Default Value: png
@@ -723,7 +715,7 @@ partial void ProcessCreateImageResponseContent( /// /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto
/// Example: 1024x1024 /// @@ -745,11 +737,6 @@ partial void ProcessCreateImageResponseContent( /// Default Value: auto
/// Example: transparent /// - /// - /// The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
- /// Default Value: vivid
- /// Example: vivid - /// /// /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
/// Example: user-1234 @@ -759,17 +746,15 @@ partial void ProcessCreateImageResponseContent( /// public async global::System.Threading.Tasks.Task CreateImageAsync( string prompt, - global::tryAGI.OpenAI.AnyOf? model = default, + global::tryAGI.OpenAI.AnyOf model, int? n = default, global::tryAGI.OpenAI.CreateImageRequestQuality? quality = default, - global::tryAGI.OpenAI.CreateImageRequestResponseFormat? responseFormat = default, global::tryAGI.OpenAI.CreateImageRequestOutputFormat? outputFormat = default, int? outputCompression = default, int? partialImages = default, global::tryAGI.OpenAI.AnyOf? size = default, global::tryAGI.OpenAI.CreateImageRequestModeration? moderation = default, global::tryAGI.OpenAI.CreateImageRequestBackground? background = default, - global::tryAGI.OpenAI.CreateImageRequestStyle? style = default, string? user = default, global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -780,7 +765,6 @@ partial void ProcessCreateImageResponseContent( Model = model, N = n, Quality = quality, - ResponseFormat = responseFormat, OutputFormat = outputFormat, OutputCompression = outputCompression, Stream = false, @@ -788,7 +772,6 @@ partial void ProcessCreateImageResponseContent( Size = size, Moderation = moderation, Background = background, - Style = style, User = user, }; diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageAsStream.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageAsStream.g.cs index 18e1ddcd4..8a92687db 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageAsStream.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageAsStream.g.cs @@ -1,6 +1,8 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace tryAGI.OpenAI { public partial class ImagesClient @@ -38,7 +40,7 @@ partial void ProcessCreateImageAsStreamResponse( /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -58,7 +60,6 @@ partial void ProcessCreateImageAsStreamResponse( Model = request.Model, N = request.N, Quality = request.Quality, - ResponseFormat = request.ResponseFormat, OutputFormat = request.OutputFormat, OutputCompression = request.OutputCompression, Stream = true, @@ -66,7 +67,6 @@ partial void ProcessCreateImageAsStreamResponse( Size = request.Size, Moderation = request.Moderation, Background = request.Background, - Style = request.Style, User = request.User, }; PrepareArguments( @@ -399,19 +399,18 @@ partial void ProcessCreateImageAsStreamResponse( } /// /// Create image
- /// Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). + /// Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ///
/// - /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ /// A text description of the desired image(s). The maximum length is 32000 characters.
/// Example: A cute baby sea otter /// /// - /// The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
- /// Default Value: dall-e-2
+ /// The GPT image model to use for image generation. Specify a model explicitly. Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
/// Example: gpt-image-2.5-flare /// /// - /// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
+ /// The number of images to generate. Must be between 1 and 10.
/// Default Value: 1
/// Example: 1 /// @@ -422,16 +421,9 @@ partial void ProcessCreateImageAsStreamResponse( /// - `high`, `medium` and `low` are supported for the GPT image models.
/// - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
/// snapshots, also support `xhigh` and `max`.
- /// - `hd` and `standard` are supported for `dall-e-3`.
- /// - `standard` is the only option for `dall-e-2`.
/// Default Value: auto
/// Example: medium /// - /// - /// The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.
- /// Default Value: url
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
/// Default Value: png
@@ -444,7 +436,7 @@ partial void ProcessCreateImageAsStreamResponse( /// /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto
/// Example: 1024x1024 /// @@ -466,11 +458,6 @@ partial void ProcessCreateImageAsStreamResponse( /// Default Value: auto
/// Example: transparent /// - /// - /// The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
- /// Default Value: vivid
- /// Example: vivid - /// /// /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
/// Example: user-1234 @@ -480,17 +467,15 @@ partial void ProcessCreateImageAsStreamResponse( /// public async global::System.Collections.Generic.IAsyncEnumerable CreateImageAsStreamAsync( string prompt, - global::tryAGI.OpenAI.AnyOf? model = default, + global::tryAGI.OpenAI.AnyOf model, int? n = default, global::tryAGI.OpenAI.CreateImageRequestQuality? quality = default, - global::tryAGI.OpenAI.CreateImageRequestResponseFormat? responseFormat = default, global::tryAGI.OpenAI.CreateImageRequestOutputFormat? outputFormat = default, int? outputCompression = default, int? partialImages = default, global::tryAGI.OpenAI.AnyOf? size = default, global::tryAGI.OpenAI.CreateImageRequestModeration? moderation = default, global::tryAGI.OpenAI.CreateImageRequestBackground? background = default, - global::tryAGI.OpenAI.CreateImageRequestStyle? style = default, string? user = default, global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) @@ -501,7 +486,6 @@ partial void ProcessCreateImageAsStreamResponse( Model = model, N = n, Quality = quality, - ResponseFormat = responseFormat, OutputFormat = outputFormat, OutputCompression = outputCompression, Stream = true, @@ -509,7 +493,6 @@ partial void ProcessCreateImageAsStreamResponse( Size = size, Moderation = moderation, Background = background, - Style = style, User = user, }; diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEdit.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEdit.g.cs index 6bfb8e000..82cba8da2 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEdit.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEdit.g.cs @@ -1,6 +1,8 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace tryAGI.OpenAI { public partial class ImagesClient @@ -43,7 +45,7 @@ partial void ProcessCreateImageEditResponseContent( /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -66,7 +68,7 @@ partial void ProcessCreateImageEditResponseContent( } /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -90,7 +92,6 @@ partial void ProcessCreateImageEditResponseContent( Model = request.Model, N = request.N, Size = request.Size, - ResponseFormat = request.ResponseFormat, OutputFormat = request.OutputFormat, OutputCompression = request.OutputCompression, User = request.User, @@ -309,14 +310,10 @@ request.Maskname is null name: "\"background\""); } - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), - name: "\"model\""); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), + name: "\"model\""); - } if (request.N != default) { @@ -590,7 +587,7 @@ request.Maskname is null retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid image request, including invalid DALL-E parameters or input. + // Invalid image request, including invalid parameters or input. if ((int)__response.StatusCode == 400) { string? __content_400 = null; @@ -910,7 +907,7 @@ request.Maskname is null } /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// The image(s) to edit. Must be a supported image file or an array of images.
@@ -919,12 +916,10 @@ request.Maskname is null /// `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
/// `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg`
/// file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest`
- /// follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square `png`
- /// file less than 4MB. + /// follows the same input constraints as GPT image models. /// /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
+ /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models.
/// Example: A cute baby sea otter wearing a beret /// /// @@ -947,8 +942,7 @@ request.Maskname is null /// Example: transparent /// /// - /// The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
+ /// The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).
/// Example: gpt-image-1.5 /// /// @@ -957,14 +951,10 @@ request.Maskname is null /// Example: 1 /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
+ /// The size of the generated images. Defaults to `auto`. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
+ /// Default Value: auto
/// Example: 1024x1024 /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is
/// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
@@ -996,13 +986,12 @@ request.Maskname is null public async global::System.Threading.Tasks.Task CreateImageEditAsync( global::tryAGI.OpenAI.AnyOf> image, string prompt, + global::tryAGI.OpenAI.AnyOf model, byte[]? mask = default, string? maskname = default, global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, int? n = default, global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, int? outputCompression = default, string? user = default, @@ -1022,7 +1011,6 @@ request.Maskname is null Model = model, N = n, Size = size, - ResponseFormat = responseFormat, OutputFormat = outputFormat, OutputCompression = outputCompression, User = user, diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEditAsStream.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEditAsStream.g.cs index aac684441..e3d16ba7c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEditAsStream.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEditAsStream.g.cs @@ -1,6 +1,8 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace tryAGI.OpenAI { public partial class ImagesClient @@ -38,7 +40,7 @@ partial void ProcessCreateImageEditAsStreamResponse( /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -62,7 +64,6 @@ partial void ProcessCreateImageEditAsStreamResponse( Model = request.Model, N = request.N, Size = request.Size, - ResponseFormat = request.ResponseFormat, OutputFormat = request.OutputFormat, OutputCompression = request.OutputCompression, User = request.User, @@ -281,14 +282,10 @@ request.Maskname is null name: "\"background\""); } - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), - name: "\"model\""); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), + name: "\"model\""); - } if (request.N != default) { @@ -631,7 +628,7 @@ request.Maskname is null } /// /// Create image edit
- /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. ///
/// /// The image(s) to edit. Must be a supported image file or an array of images.
@@ -640,12 +637,10 @@ request.Maskname is null /// `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
/// `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg`
/// file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest`
- /// follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square `png`
- /// file less than 4MB. + /// follows the same input constraints as GPT image models. /// /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
+ /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models.
/// Example: A cute baby sea otter wearing a beret /// /// @@ -668,8 +663,7 @@ request.Maskname is null /// Example: transparent /// /// - /// The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
+ /// The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).
/// Example: gpt-image-1.5 /// /// @@ -678,14 +672,10 @@ request.Maskname is null /// Example: 1 /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
+ /// The size of the generated images. Defaults to `auto`. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
+ /// Default Value: auto
/// Example: 1024x1024 /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is
/// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
@@ -717,13 +707,12 @@ request.Maskname is null public async global::System.Collections.Generic.IAsyncEnumerable CreateImageEditAsStreamAsync( global::tryAGI.OpenAI.AnyOf> image, string prompt, + global::tryAGI.OpenAI.AnyOf model, byte[]? mask = default, string? maskname = default, global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, int? n = default, global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, int? outputCompression = default, string? user = default, @@ -743,7 +732,6 @@ request.Maskname is null Model = model, N = n, Size = size, - ResponseFormat = responseFormat, OutputFormat = outputFormat, OutputCompression = outputCompression, User = user, diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageVariation.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageVariation.g.cs deleted file mode 100644 index 50d14c838..000000000 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageVariation.g.cs +++ /dev/null @@ -1,2106 +0,0 @@ - -#nullable enable - -namespace tryAGI.OpenAI -{ - public partial class ImagesClient - { - - - private static readonly global::tryAGI.OpenAI.EndPointSecurityRequirement s_CreateImageVariationSecurityRequirement0 = - new global::tryAGI.OpenAI.EndPointSecurityRequirement - { - Authorizations = new global::tryAGI.OpenAI.EndPointAuthorizationRequirement[] - { new global::tryAGI.OpenAI.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "ApiKeyAuth", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::tryAGI.OpenAI.EndPointSecurityRequirement[] s_CreateImageVariationSecurityRequirements = - new global::tryAGI.OpenAI.EndPointSecurityRequirement[] - { s_CreateImageVariationSecurityRequirement0, - }; - partial void PrepareCreateImageVariationArguments( - global::System.Net.Http.HttpClient httpClient, - global::tryAGI.OpenAI.CreateImageVariationRequest request); - partial void PrepareCreateImageVariationRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::tryAGI.OpenAI.CreateImageVariationRequest request); - partial void ProcessCreateImageVariationResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateImageVariationResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateImageVariationAsync( - - global::tryAGI.OpenAI.CreateImageVariationRequest request, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await CreateImageVariationAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> CreateImageVariationAsResponseAsync( - - global::tryAGI.OpenAI.CreateImageVariationRequest request, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateImageVariationArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::tryAGI.OpenAI.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateImageVariationSecurityRequirements, - operationName: "CreateImageVariationAsync"); - - using var __timeoutCancellationTokenSource = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::tryAGI.OpenAI.PathBuilder( - path: "/images/variations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - 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" || - __authorization.Type == "OpenIdConnect") - { - __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); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), - name: "\"model\""); - - } - if (request.N != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.N, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"n\""); - - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_format\""); - - } - if (request.Size != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Size).HasValue ? (request.Size).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"size\""); - - } - if (request.User != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.User ?? string.Empty), - name: "\"user\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateImageVariationRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateImageVariationResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // Invalid image or request, or the request cannot be processed for this account. - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseObject: __value_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The project does not have access to the requested model. - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_403 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseObject: __value_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image variations endpoint is no longer available. - if ((int)__response.StatusCode == 410) - { - string? __content_410 = null; - global::System.Exception? __exception_410 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_410 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_410 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_410, JsonSerializerContext); - } - else - { - __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_410 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_410, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_410 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_410, - responseBody: __content_410, - responseObject: __value_410, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image rate limit was exceeded. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image variation could not be generated or processed. - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_500, JsonSerializerContext); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_500 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_500, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseObject: __value_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateImageVariationResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::tryAGI.OpenAI.ImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::tryAGI.OpenAI.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::tryAGI.OpenAI.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::tryAGI.OpenAI.ImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::tryAGI.OpenAI.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::tryAGI.OpenAI.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The model to use for image generation. Only `dall-e-2` is supported at this time.
- /// Default Value: dall-e-2
- /// Example: dall-e-2 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.
- /// Default Value: url
- /// Example: url - /// - /// - /// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
- /// Example: user-1234 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateImageVariationAsync( - byte[] image, - string imagename, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageVariationRequestSize? size = default, - string? user = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::tryAGI.OpenAI.CreateImageVariationRequest - { - Image = image, - Imagename = imagename, - Model = model, - N = n, - ResponseFormat = responseFormat, - Size = size, - User = user, - }; - - return await CreateImageVariationAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The model to use for image generation. Only `dall-e-2` is supported at this time.
- /// Default Value: dall-e-2
- /// Example: dall-e-2 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.
- /// Default Value: url
- /// Example: url - /// - /// - /// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
- /// Example: user-1234 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateImageVariationAsync( - global::System.IO.Stream image, - string imagename, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageVariationRequestSize? size = default, - string? user = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::tryAGI.OpenAI.CreateImageVariationRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Model = model, - N = n, - ResponseFormat = responseFormat, - Size = size, - User = user, - }; - PrepareArguments( - client: HttpClient); - PrepareCreateImageVariationArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::tryAGI.OpenAI.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateImageVariationSecurityRequirements, - operationName: "CreateImageVariationAsync"); - - using var __timeoutCancellationTokenSource = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::tryAGI.OpenAI.PathBuilder( - path: "/images/variations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - 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" || - __authorization.Type == "OpenIdConnect") - { - __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); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), - name: "\"model\""); - - } - if (request.N != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.N, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"n\""); - - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_format\""); - - } - if (request.Size != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Size).HasValue ? (request.Size).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"size\""); - - } - if (request.User != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.User ?? string.Empty), - name: "\"user\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateImageVariationRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateImageVariationResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // Invalid image or request, or the request cannot be processed for this account. - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseObject: __value_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The project does not have access to the requested model. - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_403 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseObject: __value_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image variations endpoint is no longer available. - if ((int)__response.StatusCode == 410) - { - string? __content_410 = null; - global::System.Exception? __exception_410 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_410 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_410 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_410, JsonSerializerContext); - } - else - { - __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_410 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_410, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_410 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_410, - responseBody: __content_410, - responseObject: __value_410, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image rate limit was exceeded. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image variation could not be generated or processed. - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_500, JsonSerializerContext); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_500 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_500, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseObject: __value_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateImageVariationResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::tryAGI.OpenAI.ImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::tryAGI.OpenAI.ImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Create image variation
- /// Creates a variation of a given image. This endpoint only supports `dall-e-2`. - ///
- /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - /// - /// - /// The model to use for image generation. Only `dall-e-2` is supported at this time.
- /// Default Value: dall-e-2
- /// Example: dall-e-2 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.
- /// Default Value: url
- /// Example: url - /// - /// - /// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
- /// Example: user-1234 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> CreateImageVariationAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageVariationRequestSize? size = default, - string? user = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::tryAGI.OpenAI.CreateImageVariationRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Model = model, - N = n, - ResponseFormat = responseFormat, - Size = size, - User = user, - }; - PrepareArguments( - client: HttpClient); - PrepareCreateImageVariationArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::tryAGI.OpenAI.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateImageVariationSecurityRequirements, - operationName: "CreateImageVariationAsync"); - - using var __timeoutCancellationTokenSource = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::tryAGI.OpenAI.PathBuilder( - path: "/images/variations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - 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" || - __authorization.Type == "OpenIdConnect") - { - __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); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), - name: "\"model\""); - - } - if (request.N != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.N, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"n\""); - - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_format\""); - - } - if (request.Size != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Size).HasValue ? (request.Size).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"size\""); - - } - if (request.User != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.User ?? string.Empty), - name: "\"user\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateImageVariationRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateImageVariationResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageVariation", - methodName: "CreateImageVariationAsync", - pathTemplate: "\"/images/variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // Invalid image or request, or the request cannot be processed for this account. - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseObject: __value_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The project does not have access to the requested model. - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_403 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseObject: __value_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image variations endpoint is no longer available. - if ((int)__response.StatusCode == 410) - { - string? __content_410 = null; - global::System.Exception? __exception_410 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_410 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_410 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_410, JsonSerializerContext); - } - else - { - __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_410 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_410, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_410 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_410, - responseBody: __content_410, - responseObject: __value_410, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image rate limit was exceeded. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The image variation could not be generated or processed. - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - global::tryAGI.OpenAI.ErrorResponse? __value_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_500, JsonSerializerContext); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_500 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_500, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseObject: __value_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateImageVariationResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::tryAGI.OpenAI.ImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::tryAGI.OpenAI.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::tryAGI.OpenAI.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::tryAGI.OpenAI.ImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::tryAGI.OpenAI.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::tryAGI.OpenAI.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::tryAGI.OpenAI.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContext.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContext.g.cs index 81e086373..f2955d3b6 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContext.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContext.g.cs @@ -757,7 +757,9 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestModel), TypeInfoPropertyName = "CreateImageEditRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.AnyOf), TypeInfoPropertyName = "AnyOfStringCreateImageEditRequestSize2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestSize), TypeInfoPropertyName = "CreateImageEditRequestSize2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat), TypeInfoPropertyName = "CreateImageEditRequestResponseFormat2")] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat), TypeInfoPropertyName = "CreateImageEditRequestOutputFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.InputFidelity), TypeInfoPropertyName = "InputFidelity2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestQuality), TypeInfoPropertyName = "CreateImageEditRequestQuality2")] @@ -765,18 +767,32 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.AnyOf), TypeInfoPropertyName = "AnyOfStringCreateImageRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestModel), TypeInfoPropertyName = "CreateImageRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestQuality), TypeInfoPropertyName = "CreateImageRequestQuality2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestResponseFormat), TypeInfoPropertyName = "CreateImageRequestResponseFormat2")] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestOutputFormat), TypeInfoPropertyName = "CreateImageRequestOutputFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.AnyOf), TypeInfoPropertyName = "AnyOfStringCreateImageRequestSize2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestSize), TypeInfoPropertyName = "CreateImageRequestSize2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestModeration), TypeInfoPropertyName = "CreateImageRequestModeration2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestBackground), TypeInfoPropertyName = "CreateImageRequestBackground2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestStyle), TypeInfoPropertyName = "CreateImageRequestStyle2")] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageVariationRequest))] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.AnyOf), TypeInfoPropertyName = "AnyOfStringCreateImageVariationRequestModel2")] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageVariationRequestModel), TypeInfoPropertyName = "CreateImageVariationRequestModel2")] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat), TypeInfoPropertyName = "CreateImageVariationRequestResponseFormat2")] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageVariationRequestSize), TypeInfoPropertyName = "CreateImageVariationRequestSize2")] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateMessageRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateMessageRequestRole), TypeInfoPropertyName = "CreateMessageRequestRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.OneOf>>), TypeInfoPropertyName = "OneOfStringIListOneOfMessageContentImageFileObjectMessageContentImageUrlObjectMessageRequestContentTextObject2")] @@ -6229,14 +6245,18 @@ internal sealed partial class SourceGenerationContextChunk10 : global::System.Te [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestModel?), TypeInfoPropertyName = "NullableCreateImageEditRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringCreateImageEditRequestSize2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestSize?), TypeInfoPropertyName = "NullableCreateImageEditRequestSize2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat?), TypeInfoPropertyName = "NullableCreateImageEditRequestResponseFormat2")] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat?), TypeInfoPropertyName = "NullableCreateImageEditRequestOutputFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.InputFidelity?), TypeInfoPropertyName = "NullableInputFidelity2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageEditRequestQuality?), TypeInfoPropertyName = "NullableCreateImageEditRequestQuality2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringCreateImageRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestModel?), TypeInfoPropertyName = "NullableCreateImageRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestQuality?), TypeInfoPropertyName = "NullableCreateImageRequestQuality2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestResponseFormat?), TypeInfoPropertyName = "NullableCreateImageRequestResponseFormat2")] + #pragma warning restore CS0618 internal sealed partial class SourceGenerationContextChunk11 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -6293,11 +6313,21 @@ internal sealed partial class SourceGenerationContextChunk11 : global::System.Te [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestSize?), TypeInfoPropertyName = "NullableCreateImageRequestSize2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestModeration?), TypeInfoPropertyName = "NullableCreateImageRequestModeration2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestBackground?), TypeInfoPropertyName = "NullableCreateImageRequestBackground2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageRequestStyle?), TypeInfoPropertyName = "NullableCreateImageRequestStyle2")] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringCreateImageVariationRequestModel2")] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageVariationRequestModel?), TypeInfoPropertyName = "NullableCreateImageVariationRequestModel2")] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat?), TypeInfoPropertyName = "NullableCreateImageVariationRequestResponseFormat2")] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateImageVariationRequestSize?), TypeInfoPropertyName = "NullableCreateImageVariationRequestSize2")] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CreateMessageRequestRole?), TypeInfoPropertyName = "NullableCreateMessageRequestRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.OneOf>>?), TypeInfoPropertyName = "NullableOneOfStringIListOneOfMessageContentImageFileObjectMessageContentImageUrlObjectMessageRequestContentTextObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.OneOf?), TypeInfoPropertyName = "NullableOneOfMessageContentImageFileObjectMessageContentImageUrlObjectMessageRequestContentTextObject2")] @@ -9663,7 +9693,9 @@ internal static void AddConverters(global::System.Text.Json.JsonSerializerOption options.Converters.Add(new global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter()); options.Converters.Add(new global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter()); options.Converters.Add(new global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter()); + #pragma warning disable CS0618 // Converter references a deprecated API model. options.Converters.Add(new global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter()); + #pragma warning restore CS0618 options.Converters.Add(new global::tryAGI.OpenAI.JsonConverters.OneOfJsonConverter>>()); options.Converters.Add(new global::tryAGI.OpenAI.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::tryAGI.OpenAI.JsonConverters.OneOfJsonConverter()); diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.BetaCompactResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.BetaCompactResource.g.cs index 4ecb33797..4905cf179 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.BetaCompactResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.BetaCompactResource.g.cs @@ -4,7 +4,7 @@ namespace tryAGI.OpenAI { /// - /// Example: {"id":"resp_001","object":"response.compaction","output":[{"type":"message","role":"user","content":[{"type":"input_text","text":"Summarize our launch checklist from last week."}]},{"type":"message","role":"user","content":[{"type":"input_text","text":"You are performing a CONTEXT CHECKPOINT COMPACTION..."}]},{"type":"compaction","id":"cmp_001","encrypted_content":"encrypted-summary"}],"created_at":1731459200,"usage":{"input_tokens":42897,"output_tokens":12000,"total_tokens":54912}} + /// Example: {"id":"resp_001","object":"response.compaction","output":[{"id":"msg_001","status":"completed","type":"message","role":"user","content":[{"type":"input_text","text":"Summarize our launch checklist from last week."}]},{"id":"msg_002","status":"completed","type":"message","role":"user","content":[{"type":"input_text","text":"You are performing a CONTEXT CHECKPOINT COMPACTION..."}]},{"type":"compaction","id":"cmp_001","encrypted_content":"encrypted-summary"}],"created_at":1731459200,"usage":{"input_tokens":42897,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens":12000,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":54897}} /// public sealed partial class BetaCompactResource { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.BetaImageGenTool.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.BetaImageGenTool.g.cs index 4bae72a90..f5d97d00e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.BetaImageGenTool.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.BetaImageGenTool.g.cs @@ -34,7 +34,7 @@ public sealed partial class BetaImageGenTool public global::tryAGI.OpenAI.BetaImageGenToolQuality? Quality { get; set; } /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto ///
[global::System.Text.Json.Serialization.JsonPropertyName("size")] @@ -127,7 +127,7 @@ public sealed partial class BetaImageGenTool /// Default Value: auto /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto /// /// diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestMessageContentPartImageImageUrlDetail.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestMessageContentPartImageImageUrlDetail.g.cs index 841b61433..58df13446 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestMessageContentPartImageImageUrlDetail.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestMessageContentPartImageImageUrlDetail.g.cs @@ -21,6 +21,10 @@ public enum ChatCompletionRequestMessageContentPartImageImageUrlDetail /// /// Low, + /// + /// + /// + Original, } /// @@ -38,6 +42,7 @@ public static string ToValueString(this ChatCompletionRequestMessageContentPartI ChatCompletionRequestMessageContentPartImageImageUrlDetail.Auto => "auto", ChatCompletionRequestMessageContentPartImageImageUrlDetail.High => "high", ChatCompletionRequestMessageContentPartImageImageUrlDetail.Low => "low", + ChatCompletionRequestMessageContentPartImageImageUrlDetail.Original => "original", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -51,6 +56,7 @@ public static string ToValueString(this ChatCompletionRequestMessageContentPartI "auto" => ChatCompletionRequestMessageContentPartImageImageUrlDetail.Auto, "high" => ChatCompletionRequestMessageContentPartImageImageUrlDetail.High, "low" => ChatCompletionRequestMessageContentPartImageImageUrlDetail.Low, + "original" => ChatCompletionRequestMessageContentPartImageImageUrlDetail.Original, _ => null, }; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CompactResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CompactResource.g.cs index f5bdd8745..6eb37cb4e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CompactResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CompactResource.g.cs @@ -4,7 +4,7 @@ namespace tryAGI.OpenAI { /// - /// Example: {"id":"resp_001","object":"response.compaction","output":[{"type":"message","role":"user","content":[{"type":"input_text","text":"Summarize our launch checklist from last week."}]},{"type":"message","role":"user","content":[{"type":"input_text","text":"You are performing a CONTEXT CHECKPOINT COMPACTION..."}]},{"type":"compaction","id":"cmp_001","encrypted_content":"encrypted-summary"}],"created_at":1731459200,"usage":{"input_tokens":42897,"output_tokens":12000,"total_tokens":54912}} + /// Example: {"id":"resp_001","object":"response.compaction","output":[{"id":"msg_001","status":"completed","type":"message","role":"user","content":[{"type":"input_text","text":"Summarize our launch checklist from last week."}]},{"id":"msg_002","status":"completed","type":"message","role":"user","content":[{"type":"input_text","text":"You are performing a CONTEXT CHECKPOINT COMPACTION..."}]},{"type":"compaction","id":"cmp_001","encrypted_content":"encrypted-summary"}],"created_at":1731459200,"usage":{"input_tokens":42897,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens":12000,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":54897}} /// public sealed partial class CompactResource { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageEditRequest.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageEditRequest.g.cs index 4a3626084..c44902010 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageEditRequest.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageEditRequest.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace tryAGI.OpenAI @@ -15,9 +17,7 @@ public sealed partial class CreateImageEditRequest /// `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
/// `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg`
/// file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest`
- /// follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square `png`
- /// file less than 4MB. + /// follows the same input constraints as GPT image models. ///
[global::System.Text.Json.Serialization.JsonPropertyName("image")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter>))] @@ -25,7 +25,7 @@ public sealed partial class CreateImageEditRequest public required global::tryAGI.OpenAI.AnyOf> Image { get; set; } /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
+ /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models.
/// Example: A cute baby sea otter wearing a beret ///
/// A cute baby sea otter wearing a beret @@ -64,14 +64,14 @@ public sealed partial class CreateImageEditRequest public global::tryAGI.OpenAI.CreateImageEditRequestBackground? Background { get; set; } /// - /// The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
+ /// The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).
/// Example: gpt-image-1.5 ///
/// gpt-image-1.5 [global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter))] - public global::tryAGI.OpenAI.AnyOf? Model { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required global::tryAGI.OpenAI.AnyOf Model { get; set; } /// /// The number of images to generate. Must be between 1 and 10.
@@ -83,8 +83,8 @@ public sealed partial class CreateImageEditRequest public int? N { get; set; } /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
+ /// The size of the generated images. Defaults to `auto`. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
+ /// Default Value: auto
/// Example: 1024x1024 ///
/// 1024x1024 @@ -93,12 +93,11 @@ public sealed partial class CreateImageEditRequest public global::tryAGI.OpenAI.AnyOf? Size { get; set; } /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url + /// Legacy response format parameter for retired image models. Unsupported for GPT image models, which always return base64-encoded images. ///
- /// url [global::System.Text.Json.Serialization.JsonPropertyName("response_format")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.CreateImageEditRequestResponseFormatJsonConverter))] + [global::System.Obsolete("This property marked as deprecated.")] public global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? ResponseFormat { get; set; } /// @@ -180,14 +179,16 @@ public sealed partial class CreateImageEditRequest /// `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
/// `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg`
/// file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest`
- /// follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square `png`
- /// file less than 4MB. + /// follows the same input constraints as GPT image models. /// /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
+ /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models.
/// Example: A cute baby sea otter wearing a beret /// + /// + /// The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).
+ /// Example: gpt-image-1.5 + /// /// /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. /// @@ -207,25 +208,16 @@ public sealed partial class CreateImageEditRequest /// Default Value: auto
/// Example: transparent /// - /// - /// The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 - /// /// /// The number of images to generate. Must be between 1 and 10.
/// Default Value: 1
/// Example: 1 /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
+ /// The size of the generated images. Defaults to `auto`. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
+ /// Default Value: auto
/// Example: 1024x1024 /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is
/// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
@@ -263,13 +255,12 @@ public sealed partial class CreateImageEditRequest public CreateImageEditRequest( global::tryAGI.OpenAI.AnyOf> image, string prompt, + global::tryAGI.OpenAI.AnyOf model, byte[]? mask, string? maskname, global::tryAGI.OpenAI.CreateImageEditRequestBackground? background, - global::tryAGI.OpenAI.AnyOf? model, int? n, global::tryAGI.OpenAI.AnyOf? size, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat, global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat, int? outputCompression, string? user, @@ -286,7 +277,6 @@ public CreateImageEditRequest( this.Model = model; this.N = n; this.Size = size; - this.ResponseFormat = responseFormat; this.OutputFormat = outputFormat; this.OutputCompression = outputCompression; this.User = user; diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageEditRequestResponseFormat.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageEditRequestResponseFormat.g.cs index c04fc6a04..c9f92d686 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageEditRequestResponseFormat.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageEditRequestResponseFormat.g.cs @@ -4,8 +4,7 @@ namespace tryAGI.OpenAI { /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url + /// Legacy response format parameter for retired image models. Unsupported for GPT image models, which always return base64-encoded images. ///
public enum CreateImageEditRequestResponseFormat { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequest.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequest.g.cs index 0624fb5d0..592f66b08 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequest.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequest.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace tryAGI.OpenAI @@ -9,7 +11,7 @@ namespace tryAGI.OpenAI public sealed partial class CreateImageRequest { /// - /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ /// A text description of the desired image(s). The maximum length is 32000 characters.
/// Example: A cute baby sea otter ///
/// A cute baby sea otter @@ -18,17 +20,17 @@ public sealed partial class CreateImageRequest public required string Prompt { get; set; } /// - /// The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
- /// Default Value: dall-e-2
+ /// The GPT image model to use for image generation. Specify a model explicitly. Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
/// Example: gpt-image-2.5-flare ///
/// gpt-image-2.5-flare [global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter))] - public global::tryAGI.OpenAI.AnyOf? Model { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required global::tryAGI.OpenAI.AnyOf Model { get; set; } /// - /// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
+ /// The number of images to generate. Must be between 1 and 10.
/// Default Value: 1
/// Example: 1 ///
@@ -43,8 +45,6 @@ public sealed partial class CreateImageRequest /// - `high`, `medium` and `low` are supported for the GPT image models.
/// - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
/// snapshots, also support `xhigh` and `max`.
- /// - `hd` and `standard` are supported for `dall-e-3`.
- /// - `standard` is the only option for `dall-e-2`.
/// Default Value: auto
/// Example: medium ///
@@ -54,13 +54,11 @@ public sealed partial class CreateImageRequest public global::tryAGI.OpenAI.CreateImageRequestQuality? Quality { get; set; } /// - /// The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.
- /// Default Value: url
- /// Example: url + /// Legacy response format parameter for retired image models. Unsupported for GPT image models, which always return base64-encoded images. ///
- /// url [global::System.Text.Json.Serialization.JsonPropertyName("response_format")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.CreateImageRequestResponseFormatJsonConverter))] + [global::System.Obsolete("This property marked as deprecated.")] public global::tryAGI.OpenAI.CreateImageRequestResponseFormat? ResponseFormat { get; set; } /// @@ -100,7 +98,7 @@ public sealed partial class CreateImageRequest public int? PartialImages { get; set; } /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto
/// Example: 1024x1024 ///
@@ -138,13 +136,14 @@ public sealed partial class CreateImageRequest public global::tryAGI.OpenAI.CreateImageRequestBackground? Background { get; set; } /// - /// The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
+ /// Legacy style parameter for retired image models. Unsupported for GPT image models; describe the desired style in the prompt instead.
/// Default Value: vivid
/// Example: vivid ///
/// vivid [global::System.Text.Json.Serialization.JsonPropertyName("style")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.CreateImageRequestStyleJsonConverter))] + [global::System.Obsolete("This property marked as deprecated.")] public global::tryAGI.OpenAI.CreateImageRequestStyle? Style { get; set; } /// @@ -165,16 +164,15 @@ public sealed partial class CreateImageRequest /// Initializes a new instance of the class. /// /// - /// A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ /// A text description of the desired image(s). The maximum length is 32000 characters.
/// Example: A cute baby sea otter /// /// - /// The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
- /// Default Value: dall-e-2
+ /// The GPT image model to use for image generation. Specify a model explicitly. Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
/// Example: gpt-image-2.5-flare /// /// - /// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
+ /// The number of images to generate. Must be between 1 and 10.
/// Default Value: 1
/// Example: 1 /// @@ -185,16 +183,9 @@ public sealed partial class CreateImageRequest /// - `high`, `medium` and `low` are supported for the GPT image models.
/// - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
/// snapshots, also support `xhigh` and `max`.
- /// - `hd` and `standard` are supported for `dall-e-3`.
- /// - `standard` is the only option for `dall-e-2`.
/// Default Value: auto
/// Example: medium /// - /// - /// The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.
- /// Default Value: url
- /// Example: url - /// /// /// The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
/// Default Value: png
@@ -214,7 +205,7 @@ public sealed partial class CreateImageRequest /// /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto
/// Example: 1024x1024 /// @@ -236,11 +227,6 @@ public sealed partial class CreateImageRequest /// Default Value: auto
/// Example: transparent /// - /// - /// The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
- /// Default Value: vivid
- /// Example: vivid - /// /// /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
/// Example: user-1234 @@ -250,10 +236,9 @@ public sealed partial class CreateImageRequest #endif public CreateImageRequest( string prompt, - global::tryAGI.OpenAI.AnyOf? model, + global::tryAGI.OpenAI.AnyOf model, int? n, global::tryAGI.OpenAI.CreateImageRequestQuality? quality, - global::tryAGI.OpenAI.CreateImageRequestResponseFormat? responseFormat, global::tryAGI.OpenAI.CreateImageRequestOutputFormat? outputFormat, int? outputCompression, bool? stream, @@ -261,14 +246,12 @@ public CreateImageRequest( global::tryAGI.OpenAI.AnyOf? size, global::tryAGI.OpenAI.CreateImageRequestModeration? moderation, global::tryAGI.OpenAI.CreateImageRequestBackground? background, - global::tryAGI.OpenAI.CreateImageRequestStyle? style, string? user) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.Model = model; this.N = n; this.Quality = quality; - this.ResponseFormat = responseFormat; this.OutputFormat = outputFormat; this.OutputCompression = outputCompression; this.Stream = stream; @@ -276,7 +259,6 @@ public CreateImageRequest( this.Size = size; this.Moderation = moderation; this.Background = background; - this.Style = style; this.User = user; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestModel.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestModel.g.cs index 84a1775c7..7637f9605 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestModel.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestModel.g.cs @@ -8,6 +8,10 @@ namespace tryAGI.OpenAI ///
public enum CreateImageRequestModel { + /// + /// + /// + ChatgptImageLatest, /// /// /// @@ -66,6 +70,7 @@ public static string ToValueString(this CreateImageRequestModel value) { return value switch { + CreateImageRequestModel.ChatgptImageLatest => "chatgpt-image-latest", CreateImageRequestModel.DallE2 => "dall-e-2", CreateImageRequestModel.DallE3 => "dall-e-3", CreateImageRequestModel.GptImage1 => "gpt-image-1", @@ -87,6 +92,7 @@ public static string ToValueString(this CreateImageRequestModel value) { return value switch { + "chatgpt-image-latest" => CreateImageRequestModel.ChatgptImageLatest, "dall-e-2" => CreateImageRequestModel.DallE2, "dall-e-3" => CreateImageRequestModel.DallE3, "gpt-image-1" => CreateImageRequestModel.GptImage1, diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestQuality.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestQuality.g.cs index c375cbbc1..48ff9dabd 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestQuality.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestQuality.g.cs @@ -10,8 +10,6 @@ namespace tryAGI.OpenAI /// - `high`, `medium` and `low` are supported for the GPT image models.
/// - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
/// snapshots, also support `xhigh` and `max`.
- /// - `hd` and `standard` are supported for `dall-e-3`.
- /// - `standard` is the only option for `dall-e-2`.
/// Default Value: auto
/// Example: medium ///
diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestResponseFormat.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestResponseFormat.g.cs index 4f182fc8a..b28222d85 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestResponseFormat.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestResponseFormat.g.cs @@ -4,9 +4,7 @@ namespace tryAGI.OpenAI { /// - /// The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.
- /// Default Value: url
- /// Example: url + /// Legacy response format parameter for retired image models. Unsupported for GPT image models, which always return base64-encoded images. ///
public enum CreateImageRequestResponseFormat { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestStyle.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestStyle.g.cs index 760ec7b97..77ad5cfd8 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestStyle.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageRequestStyle.g.cs @@ -4,7 +4,7 @@ namespace tryAGI.OpenAI { /// - /// The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
+ /// Legacy style parameter for retired image models. Unsupported for GPT image models; describe the desired style in the prompt instead.
/// Default Value: vivid
/// Example: vivid ///
diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageVariationRequest.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageVariationRequest.g.cs index 32baa3013..c41628393 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageVariationRequest.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateImageVariationRequest.g.cs @@ -4,8 +4,9 @@ namespace tryAGI.OpenAI { /// - /// + /// Legacy request for the retired image variations endpoint. /// + [global::System.Obsolete("This model marked as deprecated.")] public sealed partial class CreateImageVariationRequest { /// @@ -13,6 +14,7 @@ public sealed partial class CreateImageVariationRequest /// [global::System.Text.Json.Serialization.JsonPropertyName("image")] [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] public required byte[] Image { get; set; } /// @@ -20,16 +22,18 @@ public sealed partial class CreateImageVariationRequest /// [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] public required string Imagename { get; set; } /// - /// The model to use for image generation. Only `dall-e-2` is supported at this time.
+ /// The legacy model used by the retired image variations endpoint. This endpoint no longer accepts requests.
/// Default Value: dall-e-2
/// Example: dall-e-2 ///
/// dall-e-2 [global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter))] + [global::System.Obsolete("This property marked as deprecated.")] public global::tryAGI.OpenAI.AnyOf? Model { get; set; } /// @@ -39,6 +43,7 @@ public sealed partial class CreateImageVariationRequest /// /// 1 [global::System.Text.Json.Serialization.JsonPropertyName("n")] + [global::System.Obsolete("This property marked as deprecated.")] public int? N { get; set; } /// @@ -49,6 +54,7 @@ public sealed partial class CreateImageVariationRequest /// url [global::System.Text.Json.Serialization.JsonPropertyName("response_format")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.CreateImageVariationRequestResponseFormatJsonConverter))] + [global::System.Obsolete("This property marked as deprecated.")] public global::tryAGI.OpenAI.CreateImageVariationRequestResponseFormat? ResponseFormat { get; set; } /// @@ -59,6 +65,7 @@ public sealed partial class CreateImageVariationRequest /// 1024x1024 [global::System.Text.Json.Serialization.JsonPropertyName("size")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.CreateImageVariationRequestSizeJsonConverter))] + [global::System.Obsolete("This property marked as deprecated.")] public global::tryAGI.OpenAI.CreateImageVariationRequestSize? Size { get; set; } /// @@ -67,6 +74,7 @@ public sealed partial class CreateImageVariationRequest /// /// user-1234 [global::System.Text.Json.Serialization.JsonPropertyName("user")] + [global::System.Obsolete("This property marked as deprecated.")] public string? User { get; set; } /// @@ -85,7 +93,7 @@ public sealed partial class CreateImageVariationRequest /// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. /// /// - /// The model to use for image generation. Only `dall-e-2` is supported at this time.
+ /// The legacy model used by the retired image variations endpoint. This endpoint no longer accepts requests.
/// Default Value: dall-e-2
/// Example: dall-e-2 /// diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EditImageBodyJsonParam.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EditImageBodyJsonParam.g.cs index 7ce9f5a66..02ce90a17 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EditImageBodyJsonParam.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EditImageBodyJsonParam.g.cs @@ -7,16 +7,16 @@ namespace tryAGI.OpenAI /// JSON request body for image edits.
/// Use `images` (array of `ImageRefParam`) instead of multipart `image` uploads.
/// You can reference images via external URLs, data URLs, or uploaded file IDs.
- /// JSON edits support GPT image models only; DALL-E edits require multipart (`dall-e-2` only). + /// JSON edits support GPT image models. ///
public sealed partial class EditImageBodyJsonParam { /// - /// The GPT image model to use for image editing, including `gpt-image-2`, its dated snapshot `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 + /// The GPT image model to use for image editing, including `gpt-image-2`, its dated snapshot `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`. Defaults to `gpt-image-2.5-sunburst`.
+ /// Default Value: gpt-image-2.5-sunburst
+ /// Example: gpt-image-2.5-sunburst ///
- /// gpt-image-1.5 + /// gpt-image-2.5-sunburst [global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.AnyOfJsonConverter))] public global::tryAGI.OpenAI.AnyOf? Model { get; set; } @@ -158,9 +158,9 @@ public sealed partial class EditImageBodyJsonParam /// Example: Add a watercolor effect and keep the subject centered /// /// - /// The GPT image model to use for image editing, including `gpt-image-2`, its dated snapshot `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 + /// The GPT image model to use for image editing, including `gpt-image-2`, its dated snapshot `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`. Defaults to `gpt-image-2.5-sunburst`.
+ /// Default Value: gpt-image-2.5-sunburst
+ /// Example: gpt-image-2.5-sunburst /// /// /// Reference an input image by either URL or uploaded file ID.
diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Image2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Image2.g.cs index e122997f5..546ddb705 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Image2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Image2.g.cs @@ -9,19 +9,19 @@ namespace tryAGI.OpenAI public sealed partial class Image2 { /// - /// The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`. + /// The base64-encoded JSON of the generated image. Returned by default for GPT image models, or when `response_format` is set to `b64_json` for models that support that parameter. /// [global::System.Text.Json.Serialization.JsonPropertyName("b64_json")] public string? B64Json { get; set; } /// - /// When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for the GPT image models. + /// The URL of the generated image when `response_format` is set to `url` for models that support that parameter. Unsupported for GPT image models. /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] public string? Url { get; set; } /// - /// For `dall-e-3` only, the revised prompt that was used to generate the image. + /// The revised prompt used to generate the image, for models that support prompt revision. Not returned by GPT image models. /// [global::System.Text.Json.Serialization.JsonPropertyName("revised_prompt")] public string? RevisedPrompt { get; set; } @@ -36,13 +36,13 @@ public sealed partial class Image2 /// Initializes a new instance of the class. ///
/// - /// The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`. + /// The base64-encoded JSON of the generated image. Returned by default for GPT image models, or when `response_format` is set to `b64_json` for models that support that parameter. /// /// - /// When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for the GPT image models. + /// The URL of the generated image when `response_format` is set to `url` for models that support that parameter. Unsupported for GPT image models. /// /// - /// For `dall-e-3` only, the revised prompt that was used to generate the image. + /// The revised prompt used to generate the image, for models that support prompt revision. Not returned by GPT image models. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageGenTool.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageGenTool.g.cs index 4f868827d..406ce8927 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageGenTool.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageGenTool.g.cs @@ -34,7 +34,7 @@ public sealed partial class ImageGenTool public global::tryAGI.OpenAI.ImageGenToolQuality? Quality { get; set; } /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto ///
[global::System.Text.Json.Serialization.JsonPropertyName("size")] @@ -127,7 +127,7 @@ public sealed partial class ImageGenTool /// Default Value: auto /// /// - /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ /// The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing.
/// Default Value: auto /// /// diff --git a/src/libs/tryAGI.OpenAI/openapi.yaml b/src/libs/tryAGI.OpenAI/openapi.yaml index 3029b90ab..ed13f39b2 100644 --- a/src/libs/tryAGI.OpenAI/openapi.yaml +++ b/src/libs/tryAGI.OpenAI/openapi.yaml @@ -9370,7 +9370,7 @@ paths: - Images summary: Create image edit description: Creates an edited or extended image given one or more source images - and a prompt. This endpoint supports GPT Image models and `dall-e-2`. + and a prompt. This endpoint supports GPT Image models. requestBody: required: true content: @@ -9421,7 +9421,7 @@ paths: schema: $ref: "#/components/schemas/ImageEditStreamEvent" "400": - description: Invalid image request, including invalid DALL-E parameters or input. + description: Invalid image request, including invalid parameters or input. content: application/json: schema: @@ -9644,7 +9644,7 @@ paths: - Images summary: Create image description: > - Creates an image given a prompt. [Learn + Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). requestBody: required: true @@ -9663,7 +9663,7 @@ paths: schema: $ref: "#/components/schemas/ImageGenStreamEvent" "400": - description: Invalid image request, including invalid DALL-E parameters or input. + description: Invalid image request, including invalid parameters or input. content: application/json: schema: @@ -9811,8 +9811,11 @@ paths: tags: - Images summary: Create image variation - description: Creates a variation of a given image. This endpoint only supports - `dall-e-2`. + deprecated: true + description: This endpoint is retired and no longer available. Use the image + edits endpoint with a GPT Image model and a prompt to create a variation + of an image. The request and response schemas below describe the legacy + contract. requestBody: required: true content: @@ -33245,6 +33248,200 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse-2" + x-oaiMeta: + examples: + request: + curl: > + # 1. Omit reasoning: keep its current settings while renaming the + agent. + + curl "https://api.openai.com/v1/agents/$AGENT_ID" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: agents=v1" \ + -d '{"name": "Renamed"}' + + # 2. Send null: reset reasoning to the model's defaults. + + curl "https://api.openai.com/v1/agents/$AGENT_ID" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: agents=v1" \ + -d '{"reasoning": null}' + + # 3. Send an object: replace the entire reasoning configuration, + without merging. + + # The agent's model must support the "low" reasoning effort. + + curl "https://api.openai.com/v1/agents/$AGENT_ID" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: agents=v1" \ + -d '{"reasoning": {"effort": "low"}}' + python: > + from openai import OpenAI + + + client = OpenAI() + + agent_id = "your-agent-id" + + + # 1. Omit reasoning: keep its current settings while renaming the + agent. + + client.beta.agents.update(agent_id, name="Renamed") + + + # 2. Python's None sends JSON null: reset reasoning to the model's + defaults. + + client.beta.agents.update(agent_id, reasoning=None) + + + # 3. Send an object: replace the entire reasoning configuration, + without merging. + + # The agent's model must support the "low" reasoning effort. + + client.beta.agents.update(agent_id, reasoning={"effort": "low"}) + javascript: > + import OpenAI from "openai"; + + + const client = new OpenAI(); + + const agentId = "your-agent-id"; + + + // 1. Omit reasoning: keep its current settings while renaming the + agent. + + await client.beta.agents.update(agentId, { name: "Renamed" }); + + + // 2. Send null: reset reasoning to the model's defaults. + + await client.beta.agents.update(agentId, { reasoning: null }); + + + // 3. Send an object: replace the entire reasoning configuration, + without merging. + + // The agent's model must support the "low" reasoning effort. + + await client.beta.agents.update(agentId, { reasoning: { effort: + "low" } }); + go: > + package main + + + import ( + "context" + "log" + + "github.com/openai/openai-go/v3" + "github.com/openai/openai-go/v3/packages/param" + ) + + + func main() { + client := openai.NewClient() + ctx := context.Background() + agentID := "your-agent-id" + + // 1. Omit reasoning: keep its current settings while renaming the agent. + _, err := client.Beta.Agents.Update(ctx, agentID, openai.BetaAgentUpdateParams{ + Name: openai.String("Renamed"), + }) + if err != nil { + log.Fatal(err) + } + + // 2. Send null: reset reasoning to the model's defaults. + _, err = client.Beta.Agents.Update(ctx, agentID, openai.BetaAgentUpdateParams{ + Reasoning: param.NullStruct[openai.AgentReasoningParam](), + }) + if err != nil { + log.Fatal(err) + } + + // 3. Send an object: replace the entire reasoning configuration, without merging. + // The agent's model must support the "low" reasoning effort. + _, err = client.Beta.Agents.Update(ctx, agentID, openai.BetaAgentUpdateParams{ + Reasoning: openai.AgentReasoningParam{Effort: openai.AgentReasoningParamEffortLow}, + }) + if err != nil { + log.Fatal(err) + } + } + java: > + import com.openai.client.OpenAIClient; + + import com.openai.client.okhttp.OpenAIOkHttpClient; + + import com.openai.core.JsonValue; + + import com.openai.models.beta.agents.AgentReasoningParam; + + import com.openai.models.beta.agents.AgentUpdateParams; + + + public class AgentUpdateExample { + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + String agentId = "your-agent-id"; + + // 1. Omit reasoning: keep its current settings while renaming the agent. + client.beta().agents().update(AgentUpdateParams.builder() + .agentId(agentId) + .name("Renamed") + .build()); + + // 2. Send null: reset reasoning to the model's defaults. + client.beta().agents().update(AgentUpdateParams.builder() + .agentId(agentId) + .reasoning(JsonValue.from(null)) + .build()); + + // 3. Send an object: replace the entire reasoning configuration, without merging. + // The agent's model must support the "low" reasoning effort. + client.beta().agents().update(AgentUpdateParams.builder() + .agentId(agentId) + .reasoning(AgentReasoningParam.builder() + .effort(AgentReasoningParam.Effort.LOW) + .build()) + .build()); + } + } + ruby: > + require "openai" + + + client = OpenAI::Client.new + + agent_id = "your-agent-id" + + + # 1. Omit reasoning: keep its current settings while renaming the + agent. + + client.beta.agents.update(agent_id, name: "Renamed") + + + # 2. Ruby's nil sends JSON null: reset reasoning to the model's + defaults. + + client.beta.agents.update(agent_id, reasoning: nil) + + + # 3. Send an object: replace the entire reasoning configuration, + without merging. + + # The agent's model must support the "low" reasoning effort. + + client.beta.agents.update(agent_id, reasoning: {effort: :low}) delete: operationId: deleteAgent summary: Delete an agent @@ -41450,6 +41647,7 @@ components: - auto - low - high + - original default: auto required: - url @@ -45173,16 +45371,9 @@ components: `chatgpt-image-latest` follows the same input constraints as GPT image models. - - - For `dall-e-2`, you can only provide one image, and it should be a - square `png` - - file less than 4MB. prompt: description: A text description of the desired image(s). The maximum length is - 1000 characters for `dall-e-2`, and 32000 characters for the GPT - image models. + 32000 characters for the GPT image models. type: string example: A cute baby sea otter wearing a beret mask: @@ -45239,21 +45430,21 @@ components: - gpt-image-2.5-sunburst-2026-09-08 - gpt-image-2.5-flare - gpt-image-2.5-flare-2026-09-08 - - dall-e-2 - gpt-image-1 - gpt-image-1-mini - chatgpt-image-latest + - dall-e-2 + x-openai-enum-deprecations: + dall-e-2: + message: This model was retired on May 12, 2026. Use a GPT image model instead. x-stainless-const: true x-oaiTypeLabel: string - default: gpt-image-1.5 example: gpt-image-1.5 - nullable: true - description: The model to use for image generation. One of `dall-e-2` or a GPT - image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + description: The GPT image model to use for image editing (`gpt-image-1`, + `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). - Defaults to `gpt-image-1.5`. n: type: integer minimum: 1 @@ -45267,17 +45458,24 @@ components: - type: string - type: string enum: - - 256x256 - - 512x512 - 1024x1024 - 1536x1024 - 1024x1536 - auto - default: 1024x1024 + - 256x256 + - 512x512 + x-openai-enum-deprecations: + 256x256: + message: This legacy size suggestion is retained for SDK compatibility. Check + the selected GPT image model's supported sizes. + 512x512: + message: This legacy size suggestion is retained for SDK compatibility. Check + the selected GPT image model's supported sizes. + default: auto example: 1024x1024 nullable: true - description: The size of the generated images. For `gpt-image-2`, - `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + description: The size of the generated images. Defaults to `auto`. For + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width @@ -45287,21 +45485,17 @@ components: The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, - use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use - one of `1024x1024`, `1792x1024`, or `1024x1792`. + supported for models that allow automatic sizing. response_format: type: string enum: - url - b64_json - example: url nullable: true - description: The format in which the generated images are returned. Must be one - of `url` or `b64_json`. URLs are only valid for 60 minutes after the - image has been generated. This parameter is only supported for - `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models - always return base64-encoded images. + deprecated: true + description: Legacy response format parameter for retired image models. + Unsupported for GPT image models, which always return base64-encoded + images. output_format: type: string enum: @@ -45354,13 +45548,17 @@ components: quality: type: string enum: - - standard - low - medium - high - xhigh - max - auto + - standard + x-openai-enum-deprecations: + standard: + message: This quality was only supported by retired DALL·E models. Use a GPT + image quality instead. default: auto example: high nullable: true @@ -45371,6 +45569,7 @@ components: `2026-09-08` snapshots, also support `xhigh` and `max`. Defaults to `auto`. required: + - model - prompt - image CreateImageRequest: @@ -45378,8 +45577,7 @@ components: properties: prompt: description: A text description of the desired image(s). The maximum length is - 32000 characters for the GPT image models, 1000 characters for - `dall-e-2` and 4000 characters for `dall-e-3`. + 32000 characters. type: string example: A cute baby sea otter model: @@ -45394,21 +45592,24 @@ components: - gpt-image-2.5-sunburst-2026-09-08 - gpt-image-2.5-flare - gpt-image-2.5-flare-2026-09-08 - - dall-e-2 - - dall-e-3 - gpt-image-1 - gpt-image-1-mini + - chatgpt-image-latest + - dall-e-2 + - dall-e-3 + x-openai-enum-deprecations: + dall-e-2: + message: This model was retired on May 12, 2026. Use a GPT image model instead. + dall-e-3: + message: This model was retired on May 12, 2026. Use a GPT image model instead. x-oaiTypeLabel: string - default: dall-e-2 example: gpt-image-2.5-flare - nullable: true - description: The model to use for image generation. One of `dall-e-2`, - `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, - `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, - `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, - `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults - to `dall-e-2` unless a parameter specific to the GPT image models is - used. + description: The GPT image model to use for image generation. Specify a model + explicitly. Supported models include `gpt-image-1`, + `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`. n: type: integer minimum: 1 @@ -45416,19 +45617,25 @@ components: default: 1 example: 1 nullable: true - description: The number of images to generate. Must be between 1 and 10. For - `dall-e-3`, only `n=1` is supported. + description: The number of images to generate. Must be between 1 and 10. quality: type: string enum: - - standard - - hd - low - medium - high - xhigh - max - auto + - standard + - hd + x-openai-enum-deprecations: + standard: + message: This quality was only supported by retired DALL·E models. Use a GPT + image quality instead. + hd: + message: This quality was only supported by retired DALL·E models. Use a GPT + image quality instead. default: auto example: medium nullable: true @@ -45444,22 +45651,16 @@ components: - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support `xhigh` and `max`. - - `hd` and `standard` are supported for `dall-e-3`. - - - `standard` is the only option for `dall-e-2`. response_format: type: string enum: - url - b64_json - default: url - example: url nullable: true - description: The format in which generated images with `dall-e-2` and `dall-e-3` - are returned. Must be one of `url` or `b64_json`. URLs are only - valid for 60 minutes after the image has been generated. This - parameter isn't supported for the GPT image models, which always - return base64-encoded images. + deprecated: true + description: Legacy response format parameter for retired image models. + Unsupported for GPT image models, which always return base64-encoded + images. output_format: type: string enum: @@ -45504,6 +45705,19 @@ components: - 512x512 - 1792x1024 - 1024x1792 + x-openai-enum-deprecations: + 256x256: + message: This legacy size suggestion is retained for SDK compatibility. Check + the selected GPT image model's supported sizes. + 512x512: + message: This legacy size suggestion is retained for SDK compatibility. Check + the selected GPT image model's supported sizes. + 1792x1024: + message: This legacy size suggestion is retained for SDK compatibility. Check + the selected GPT image model's supported sizes. + 1024x1792: + message: This legacy size suggestion is retained for SDK compatibility. Check + the selected GPT image model's supported sizes. default: auto example: 1024x1024 nullable: true @@ -45518,9 +45732,7 @@ components: The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, - use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use - one of `1024x1024`, `1792x1024`, or `1024x1792`. + supported for models that allow automatic sizing. moderation: type: string enum: @@ -45574,20 +45786,21 @@ components: default: vivid example: vivid nullable: true - description: The style of the generated images. This parameter is only supported - for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes - the model to lean towards generating hyper-real and dramatic images. - Natural causes the model to produce more natural, less hyper-real - looking images. + deprecated: true + description: Legacy style parameter for retired image models. Unsupported for + GPT image models; describe the desired style in the prompt instead. user: type: string example: user-1234 description: | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). required: + - model - prompt CreateImageVariationRequest: type: object + deprecated: true + description: Legacy request for the retired image variations endpoint. properties: image: description: The image to use as the basis for the variation(s). Must be a valid @@ -45605,8 +45818,8 @@ components: default: dall-e-2 example: dall-e-2 nullable: true - description: The model to use for image generation. Only `dall-e-2` is supported - at this time. + description: The legacy model used by the retired image variations endpoint. + This endpoint no longer accepts requests. n: type: integer minimum: 1 @@ -48007,8 +48220,7 @@ components: You can reference images via external URLs, data URLs, or uploaded file IDs. - JSON edits support GPT image models only; DALL-E edits require multipart - (`dall-e-2` only). + JSON edits support GPT image models. properties: model: anyOf: @@ -48027,12 +48239,13 @@ components: - chatgpt-image-latest - type: "null" x-oaiTypeLabel: string - default: gpt-image-1.5 - example: gpt-image-1.5 + default: gpt-image-2.5-sunburst + example: gpt-image-2.5-sunburst description: The GPT image model to use for image editing, including `gpt-image-2`, its dated snapshot `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`. + Defaults to `gpt-image-2.5-sunburst`. images: type: array minItems: 1 @@ -50682,6 +50895,7 @@ components: discriminator: propertyName: type FunctionObject: + x-openai-structured-output: function type: object properties: description: @@ -51660,18 +51874,18 @@ components: b64_json: type: string description: The base64-encoded JSON of the generated image. Returned by default - for the GPT image models, and only present if `response_format` is - set to `b64_json` for `dall-e-2` and `dall-e-3`. + for GPT image models, or when `response_format` is set to `b64_json` + for models that support that parameter. url: type: string format: uri - description: When using `dall-e-2` or `dall-e-3`, the URL of the generated image - if `response_format` is set to `url` (default value). Unsupported - for the GPT image models. + description: The URL of the generated image when `response_format` is set to + `url` for models that support that parameter. Unsupported for GPT + image models. revised_prompt: type: string - description: For `dall-e-3` only, the revised prompt that was used to generate - the image. + description: The revised prompt used to generate the image, for models that + support prompt revision. Not returned by GPT image models. ImageEditCompletedEvent: type: object description: > @@ -52128,9 +52342,7 @@ components: The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, - use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use - one of `1024x1024`, `1792x1024`, or `1024x1792`. + supported for models that allow automatic sizing. default: auto output_format: type: string @@ -69478,6 +69690,7 @@ components: - json_schema x-stainless-const: true json_schema: + x-openai-structured-output: json_schema type: object title: JSON schema description: | @@ -75118,6 +75331,7 @@ components: - $ref: "#/components/schemas/TextResponseFormatJsonSchema" - $ref: "#/components/schemas/ResponseFormatJsonObject" TextResponseFormatJsonSchema: + x-openai-structured-output: json_schema_default_strict type: object title: JSON schema description: | @@ -80961,6 +81175,7 @@ components: description: Defines a function in your own code the model can choose to call. Learn more about [function calling](https://developers.openai.com/api/docs/guides/function-calling). + x-openai-structured-output: function RankerVersionType: type: string enum: @@ -81434,6 +81649,7 @@ components: required: - name - type + x-openai-structured-output: function NamespaceToolParam: properties: type: @@ -86028,12 +86244,16 @@ components: id: resp_001 object: response.compaction output: - - type: message + - id: msg_001 + status: completed + type: message role: user content: - type: input_text text: Summarize our launch checklist from last week. - - type: message + - id: msg_002 + status: completed + type: message role: user content: - type: input_text @@ -86044,8 +86264,13 @@ components: created_at: 1731459200 usage: input_tokens: 42897 + input_tokens_details: + cached_tokens: 0 + cache_write_tokens: 0 output_tokens: 12000 - total_tokens: 54912 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 54897 SkillResource: properties: id: @@ -99247,6 +99472,7 @@ components: required: - type BetaTextResponseFormatJsonSchema: + x-openai-structured-output: json_schema_default_strict type: object title: JSON schema description: | @@ -99657,6 +99883,7 @@ components: required: - name - type + x-openai-structured-output: function BetaFunctionShellToolParam: properties: type: @@ -100016,9 +100243,7 @@ components: The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, - use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use - one of `1024x1024`, `1792x1024`, or `1024x1792`. + supported for models that allow automatic sizing. default: auto output_format: type: string @@ -100755,6 +100980,7 @@ components: description: Defines a function in your own code the model can choose to call. Learn more about [function calling](https://developers.openai.com/api/docs/guides/function-calling). + x-openai-structured-output: function BetaInputItem: oneOf: - $ref: "#/components/schemas/BetaEasyInputMessage" @@ -106123,12 +106349,16 @@ components: id: resp_001 object: response.compaction output: - - type: message + - id: msg_001 + status: completed + type: message role: user content: - type: input_text text: Summarize our launch checklist from last week. - - type: message + - id: msg_002 + status: completed + type: message role: user content: - type: input_text @@ -106139,8 +106369,13 @@ components: created_at: 1731459200 usage: input_tokens: 42897 + input_tokens_details: + cached_tokens: 0 + cache_write_tokens: 0 output_tokens: 12000 - total_tokens: 54912 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 54897 BetaResponseUsage: type: object description: | @@ -113809,3 +114044,15 @@ x-oaiMeta: - type: object key: LiveInfoEvent path: +x-openai-structured-output-limits: + version: 1 + max_object_properties: 5000 + max_nesting_depth: 10 + max_enum_values: 1000 + max_string_characters: 120000 + large_enum_threshold: 250 + max_large_enum_string_characters: 15000 + string_length_unit: unicode_code_points + non_string_enum_characters: false + property_count_scope: root_or_definition + references: count_definition_once