Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/tryagi-openai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dnx tryAGI.OpenAI.CLI <group> --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. |
Expand Down
1 change: 0 additions & 1 deletion .claude/skills/tryagi-openai/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static CreateImageEditRequestOptionSet Create(string? prefix = null)
return new CreateImageEditRequestOptionSet(
Prompt: new Option<string>($"--{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<string?>($"--{normalizedPrefix}maskname")
Expand All @@ -52,7 +52,7 @@ set the output format to `png` or `webp`.
},
ResponseFormat: new Option<global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat?>($"--{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<global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat?>($"--{normalizedPrefix}output-format")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public static CreateImageRequestOptionSet Create(string? prefix = null)
return new CreateImageRequestOptionSet(
Prompt: new Option<string>($"--{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<int?>($"--{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<global::tryAGI.OpenAI.CreateImageRequestQuality?>($"--{normalizedPrefix}quality")
{
Expand All @@ -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<global::tryAGI.OpenAI.CreateImageRequestResponseFormat?>($"--{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<global::tryAGI.OpenAI.CreateImageRequestOutputFormat?>($"--{normalizedPrefix}output-format")
{
Expand Down Expand Up @@ -86,7 +84,7 @@ set the output format to `png` or `webp`.
},
Style: new Option<global::tryAGI.OpenAI.CreateImageRequestStyle?>($"--{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<string?>($"--{normalizedPrefix}user")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ namespace tryAGI.OpenAI.Cli.GeneratedApi.Commands;

internal static partial class ImagesCreateImageAsStreamCommandApiCommand
{
private static Option<global::tryAGI.OpenAI.AnyOf<string, global::tryAGI.OpenAI.CreateImageRequestModel?>?> Model { get; } = new(
private static Option<global::tryAGI.OpenAI.AnyOf<string, global::tryAGI.OpenAI.CreateImageRequestModel?>> 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<global::tryAGI.OpenAI.AnyOf<string, global::tryAGI.OpenAI.CreateImageRequestSize?>?> 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<string?> Input { get; } = new(@"--input")
Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -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);

Expand Down
Loading
Loading