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/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Full per-command reference derived from the OpenAPI spec. For the short overview
|---------|-------|-------------|
| `create-agent` | `POST /agents` | Create an agent |
| `create-agent-environment` | `POST /agents/environments` | Create an agent environment |
| `create-agent-environment-file` | `POST /agents/environments/{environment_id}/files` | Create an agent environment file |
| `create-agent-environment-file` | `POST /agents/environments/{environment_id}/files` | Write an agent environment file |
| `create-agent-environment-template` | `POST /agents/environments/templates` | Create an agent environment template |
| `create-agent-session` | `POST /agents/sessions` | Create an agent session |
| `create-agent-session-events` | `POST /agents/sessions/{session_id}/events` | Create agent session input events |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ private static string FormatResponse(ParseResult parseResult, global::tryAGI.Ope

public static Command Create(string? commandName = null)
{
var command = new Command(commandName ?? @"create-agent-environment-file", @"Create an agent environment file
Copies inline bytes or a Files API file into a connected execution environment. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files).");
var command = new Command(commandName ?? @"create-agent-environment-file", @"Write an agent environment file
Copies inline bytes or a Files API file into a connected execution environment, replacing an existing regular file at the same path. Upload between turns and wait for success before starting the next turn. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files).");
command.Arguments.Add(EnvironmentId);
command.Options.Add(Input);
command.Options.Add(RequestJson);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal static partial class DecisionsCreateDecisionCommandApiCommand
private static Option<string> Model { get; } = new(
name: @"--model")
{
Description = @"",
Description = @"The model to use. Only `gpt-6-luna` is supported.",
Required = true,
};

Expand All @@ -24,7 +24,7 @@ internal static partial class DecisionsCreateDecisionCommandApiCommand
private static Option<global::System.Collections.Generic.IList<global::tryAGI.OpenAI.QuestionParam>> Questions { get; } = new(
name: @"--questions")
{
Description = @"",
Description = @"Ask 1–200 questions about the input. Each question can be a predicate, choice, or score. Answers come back in the same order.",
Required = true,
};

Expand Down Expand Up @@ -75,11 +75,7 @@ private static string FormatResponse(ParseResult parseResult, global::tryAGI.Ope
public static Command Create(string? commandName = null)
{
var command = new Command(commandName ?? @"create-decision", @"Create a decision
Use this endpoint to ask classification or scoring questions about the same input. You’ll get the answers back in the order you asked the questions.

For text, you can pass a string. You can also send user messages containing `input_text` and `input_image` parts, with up to 128 images per request. Images can be base64 data URLs or publicly accessible HTTP(S) URLs. File IDs aren’t accepted. Other message roles, function calls, files, audio, and item references aren’t supported.

Sometimes a question returns a refusal instead of an answer. The result has type `refusal` and includes the question’s name, or `null` if you didn’t give it one.");
Use this endpoint to quickly answer classification or scoring questions about some input. You can ask multiple questions in one request.");
command.Options.Add(Model);
command.Options.Add(InputOption);
command.Options.Add(Questions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,34 @@ internal static partial class ProjectsUpdateProjectApiKeyCommandApiCommand
Description = @"The ID of the API key.",
};

private static Option<int> ExpiresInSeconds { get; } = new(
private static Option<int?> ExpiresInSeconds { get; } = new(
name: @"--expires-in-seconds")
{
Description = @"Number of seconds from this request until the API key expires. Must comply with the organization and project expiry policies. Expired keys cannot be updated. Retrying resets the expiry relative to the new request.",
Required = true,
Description = @"Number of seconds from this request until the API key expires. Must comply with the organization and project expiry policies. Expired keys cannot be updated. Retrying resets the expiry relative to the new request. Omit to keep the current expiration.",
};

private static Option<global::System.Collections.Generic.IList<string>?> Scopes { get; } = new(
name: @"--scopes")
{
Description = @"Replace the API key scope restrictions. Omit to leave scopes unchanged. An empty array removes key restrictions (All permissions), subject to the owner's effective permissions. Use [""api.all.read""] for read-only access. Scopes do not change the owner's roles or grant administrative permissions.",
};
private static Option<string?> Input { get; } = new(@"--input")
{
Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.",
};

private static Option<string?> RequestJson { get; } = new(@"--request-json")
{
Description = "Request body as JSON.",
Hidden = true,
};

private static Option<string?> 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.ProjectApiKey value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings)
{
string? text = null;
Expand All @@ -51,9 +72,19 @@ private static string FormatResponse(ParseResult parseResult, global::tryAGI.Ope
public static Command Create(string? commandName = null)
{
var command = new Command(commandName ?? @"update-project-api-key", @"Update project API key
Updates the expiration of an existing API key in the project, including a
Updates the scopes and/or expiration of an existing API key in the project, including a
service-account-owned key. Requires permission to write project API keys.

Provide at least one of `scopes` or `expires_in_seconds`. Omitted fields stay
unchanged; neither field accepts `null`. Both changes are saved together.

`scopes` replaces the key's scope restrictions using the same scope identifiers
as the dashboard. An empty array means All permissions, subject to the owner's
effective access; it does not mean no access. Use `[""api.all.read""]` for read-only
access or specific scopes such as `[""api.files.read""]` for restricted access.
This does not change user or service-account roles or grant admin permissions.
Scope changes follow the same authentication-cache propagation as dashboard edits.

Provide `expires_in_seconds` to set the expiration relative to this request.
The value must satisfy the organization's and project's expiry policies.
Expired keys cannot be updated. Retrying resets the expiration relative to
Expand All @@ -62,21 +93,44 @@ Expired keys cannot be updated. Retrying resets the expiration relative to
command.Arguments.Add(ProjectId);
command.Arguments.Add(ApiKeyId);
command.Options.Add(ExpiresInSeconds);

command.Options.Add(Scopes);
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<global::tryAGI.OpenAI.UpdateProjectApiKeyBody>(
parseResult,
Input,
RequestJson,
RequestFile,
global::tryAGI.OpenAI.SourceGenerationContext.Default,
cancellationToken).ConfigureAwait(false);
var projectId = parseResult.GetRequiredValue(ProjectId);
var apiKeyId = parseResult.GetRequiredValue(ApiKeyId);
var expiresInSeconds = parseResult.GetRequiredValue(ExpiresInSeconds);
var expiresInSeconds = CliRuntime.WasSpecified(parseResult, ExpiresInSeconds) ? parseResult.GetValue(ExpiresInSeconds) : (__requestBase is { } __ExpiresInSecondsBaseValue ? __ExpiresInSecondsBaseValue.ExpiresInSeconds : default);
var scopes = CliRuntime.WasSpecified(parseResult, Scopes) ? parseResult.GetValue(Scopes) : (__requestBase is { } __ScopesBaseValue ? __ScopesBaseValue.Scopes : default);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Projects.UpdateProjectApiKeyAsync(
projectId: projectId,
apiKeyId: apiKeyId,
expiresInSeconds: expiresInSeconds,
scopes: scopes,
cancellationToken: cancellationToken).ConfigureAwait(false);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ public sealed partial class RealtimeResponseStatusDetailsError
[global::System.Text.Json.Serialization.JsonPropertyName("code")]
public string? Code { get; set; }

/// <summary>
/// A human-readable error message.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("message")]
public string? Message { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -36,15 +42,20 @@ public sealed partial class RealtimeResponseStatusDetailsError
/// <param name="code">
/// Error code, if any.
/// </param>
/// <param name="message">
/// A human-readable error message.
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
public RealtimeResponseStatusDetailsError(
string? type,
string? code)
string? code,
string? message)
{
this.Type = type;
this.Code = code;
this.Message = message;
}

/// <summary>
Expand Down
31 changes: 21 additions & 10 deletions src/libs/tryAGI.OpenAI/Generated/autosdk.generated-examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@
},
{
"Order": 15,
"Title": "Update project API key",
"Slug": "update-project-api-key",
"Description": "Updates the scopes and/or expiration of an existing API key in the project, including a\nservice-account-owned key. Requires permission to write project API keys.\n\nProvide at least one of \u0060scopes\u0060 or \u0060expires_in_seconds\u0060. Omitted fields stay\nunchanged; neither field accepts \u0060null\u0060. Both changes are saved together.\n\n\u0060scopes\u0060 replaces the key\u0027s scope restrictions using the same scope identifiers\nas the dashboard. An empty array means All permissions, subject to the owner\u0027s\neffective access; it does not mean no access. Use \u0060[\u0022api.all.read\u0022]\u0060 for read-only\naccess or specific scopes such as \u0060[\u0022api.files.read\u0022]\u0060 for restricted access.\nThis does not change user or service-account roles or grant admin permissions.\nScope changes follow the same authentication-cache propagation as dashboard edits.\n\nProvide \u0060expires_in_seconds\u0060 to set the expiration relative to this request.\nThe value must satisfy the organization\u0027s and project\u0027s expiry policies.\nExpired keys cannot be updated. Retrying resets the expiration relative to\nthe new request. The response contains only the redacted key, not its secret.",
"Language": "http",
"Code": "### Update project API key\n# @name update-project-api-key\nPOST {{host}}/organization/projects/{{project_id}}/api_keys/{{api_key_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022scopes\u0022: [\n \u0022api.all.read\u0022\n ]\n}\n\n## Responses\n# 200\n# Description: Project API key updated successfully.\n# Content-Type: application/json\n# 400\n# Description: The project is archived, the key is expired, or the requested scopes or expiration are invalid.\n# Content-Type: application/json\n# 403\n# Description: The caller does not have permission to update this API key.\n# Content-Type: application/json\n# 404\n# Description: The project or API key was not found.\n# Content-Type: application/json\n# 429\n# Description: Too many management requests. Reduce the request rate and try again later.\n# Content-Type: application/json",
"Format": "http",
"OperationId": "update-project-api-key",
"Setup": null
},
{
"Order": 16,
"Title": "Modify project rate limit",
"Slug": "update-project-rate-limits",
"Description": "Updates a project rate limit.",
Expand All @@ -166,7 +177,7 @@
"Setup": null
},
{
"Order": 16,
"Order": 17,
"Title": "Cancel a response",
"Slug": "beta-cancelresponse",
"Description": "Cancels a model response with the given ID. Only responses created with\nthe \u0060background\u0060 parameter set to \u0060true\u0060 can be cancelled.\n[Learn more](https://developers.openai.com/api/docs/guides/background).",
Expand All @@ -177,7 +188,7 @@
"Setup": null
},
{
"Order": 17,
"Order": 18,
"Title": "Compact conversation",
"Slug": "beta-compactconversation",
"Description": "Compact a conversation. Returns a compacted response object.\n\nLearn when and how to compact long-running conversations in the [conversation state guide](https://developers.openai.com/api/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](https://developers.openai.com/api/docs/guides/conversation-state#compaction-advanced).",
Expand All @@ -188,7 +199,7 @@
"Setup": null
},
{
"Order": 18,
"Order": 19,
"Title": "Create a model response",
"Slug": "beta-createresponse",
"Description": "Creates a model response. Provide [text](https://developers.openai.com/api/docs/guides/text) or\n[image](https://developers.openai.com/api/docs/guides/images-vision) inputs to generate [text](https://developers.openai.com/api/docs/guides/text)\nor [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have the model call\nyour own [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use built-in\n[tools](https://developers.openai.com/api/docs/guides/tools) like [web search](https://developers.openai.com/api/docs/guides/tools-web-search)\nor [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use your own data\nas input for the model\u0027s response.",
Expand All @@ -199,7 +210,7 @@
"Setup": null
},
{
"Order": 19,
"Order": 20,
"Title": "Get a model response",
"Slug": "beta-getresponse",
"Description": "Retrieves a model response with the given ID.",
Expand All @@ -210,7 +221,7 @@
"Setup": null
},
{
"Order": 20,
"Order": 21,
"Title": "Get input token counts",
"Slug": "beta-getinputtokencounts",
"Description": "Returns input token counts of the request.\n\nReturns an object with \u0060object\u0060 set to \u0060response.input_tokens\u0060 and an \u0060input_tokens\u0060 count.",
Expand All @@ -221,7 +232,7 @@
"Setup": null
},
{
"Order": 21,
"Order": 22,
"Title": "Cancel a response",
"Slug": "cancelresponse",
"Description": "Cancels a model response with the given ID. Only responses created with\nthe \u0060background\u0060 parameter set to \u0060true\u0060 can be cancelled.\n[Learn more](https://developers.openai.com/api/docs/guides/background).",
Expand All @@ -232,7 +243,7 @@
"Setup": null
},
{
"Order": 22,
"Order": 23,
"Title": "Compact conversation",
"Slug": "compactconversation",
"Description": "Compact a conversation. Returns a compacted response object.\n\nLearn when and how to compact long-running conversations in the [conversation state guide](https://developers.openai.com/api/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](https://developers.openai.com/api/docs/guides/conversation-state#compaction-advanced).",
Expand All @@ -243,7 +254,7 @@
"Setup": null
},
{
"Order": 23,
"Order": 24,
"Title": "Create a model response",
"Slug": "createresponse",
"Description": "Creates a model response. Provide [text](https://developers.openai.com/api/docs/guides/text) or\n[image](https://developers.openai.com/api/docs/guides/images-vision) inputs to generate [text](https://developers.openai.com/api/docs/guides/text)\nor [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have the model call\nyour own [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use built-in\n[tools](https://developers.openai.com/api/docs/guides/tools) like [web search](https://developers.openai.com/api/docs/guides/tools-web-search)\nor [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use your own data\nas input for the model\u0027s response.",
Expand All @@ -254,7 +265,7 @@
"Setup": null
},
{
"Order": 24,
"Order": 25,
"Title": "Get a model response",
"Slug": "getresponse",
"Description": "Retrieves a model response with the given ID.",
Expand All @@ -265,7 +276,7 @@
"Setup": null
},
{
"Order": 25,
"Order": 26,
"Title": "Get input token counts",
"Slug": "getinputtokencounts",
"Description": "Returns input token counts of the request.\n\nReturns an object with \u0060object\u0060 set to \u0060response.input_tokens\u0060 and an \u0060input_tokens\u0060 count.",
Expand Down
Loading
Loading