Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .claude/skills/tryagi-openai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dnx tryAGI.OpenAI.CLI <group> --help
|-------|-----------:|---------|
| `agent` | 47 | |
| `assistant` | 18 | Build Assistants that can call models and use tools. |
| `audio` | 10 | Turn audio into text or text into audio. |
| `audio` | 9 | Turn audio into text or text into audio. |
| `audit-log` | 1 | List user actions and configuration changes within this organization. |
| `batch` | 4 | Create large batches of API requests to run asynchronously. |
| `certificate` | 10 | |
Expand Down Expand Up @@ -64,7 +64,7 @@ dnx tryAGI.OpenAI.CLI <group> --help
| `user-organization-role-assignment` | 4 | |
| `vault` | 10 | |
| `vector-store` | 16 | |
| `default` | 43 | |
| `default` | 60 | |

## References

Expand Down
18 changes: 17 additions & 1 deletion .claude/skills/tryagi-openai/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ Turn audio into text or text into audio.
|---------|-------|-------------|
| `create-speech` | `POST /audio/speech` | Create speech |
| `create-transcription` | `POST /audio/transcriptions` | Create transcription |
| `create-translation` | `POST /audio/translations` | Create translation |
| `create-voice` | `POST /audio/voices` | Create voice |
| `create-voice-consent` | `POST /audio/voice_consents` | Create voice consent |
| `delete-voice` | `DELETE /audio/voices/{voice_id}` | Delete voice |
Expand Down Expand Up @@ -545,6 +544,7 @@ Use Uploads to upload large files in multiple parts.

| Command | Route | Description |
|---------|-------|-------------|
| `addanexternalkeyconfigforanorganization` | `POST /organization/external_keys` | Add an external key config for an organization |
| `admin-api-keys-create` | `POST /organization/admin_api_keys` | Create admin API key |
| `admin-api-keys-delete` | `DELETE /organization/admin_api_keys/{key_id}` | Delete admin API key |
| `admin-api-keys-get` | `GET /organization/admin_api_keys/{key_id}` | Retrieve admin API key |
Expand All @@ -553,14 +553,19 @@ Use Uploads to upload large files in multiple parts.
| `create-chat-session-method` | `POST /chatkit/sessions` | Create a ChatKit session |
| `create-container` | `POST /containers` | Create container |
| `create-container-file` | `POST /containers/{container_id}/files` | Create container file |
| `create-platformworkloadidentityfederationrule` | `POST /organization/workload_identity_providers/{workload_identity_provider_id}/federation_rules` | Create Platform workload identity federation rule |
| `create-platformworkloadidentityprovider` | `POST /organization/workload_identity_providers` | Create Platform workload identity provider |
| `create-webhook-endpoint` | `POST /webhook_endpoints` | Create Webhook Endpoint |
| `createan-apikeyforaserviceaccount` | `POST /organization/projects/{project_id}/service_accounts/{service_account_id}/api_keys` | Create an API key for a service account |
| `createanexternalstorageconfiguration` | `POST /organization/external_storage` | Create an external storage configuration |
| `createcontentprovenancecheck` | `POST /content_provenance_checks` | Create content provenance check |
| `delete-container` | `DELETE /containers/{container_id}` | Delete a container |
| `delete-container-file` | `DELETE /containers/{container_id}/files/{file_id}` | Delete a container file |
| `delete-platformworkloadidentityfederationrule` | `DELETE /organization/workload_identity_providers/{workload_identity_provider_id}/federation_rules/{workload_identity_federation_rule_id}` | Delete Platform workload identity federation rule |
| `delete-platformworkloadidentityprovider` | `DELETE /organization/workload_identity_providers/{workload_identity_provider_id}` | Delete Platform workload identity provider |
| `delete-thread-method` | `DELETE /chatkit/threads/{thread_id}` | Delete a ChatKit thread |
| `delete-webhook-endpoint` | `DELETE /webhook_endpoints/{webhook_endpoint_id}` | Delete Webhook Endpoint |
| `deleteanexternalkeyconfigfortheuser'sorganization` | `DELETE /organization/external_keys/{external_key_id}` | Delete an external key config for the user's organization |
| `deleteanexternalstorageconfiguration` | `DELETE /organization/external_storage/{external_storage_id}` | Delete an external storage configuration |
| `deleteorganizationspendlimit` | `DELETE /organization/spend_limit` | Delete organization spend limit |
| `deleteprojectspendlimit` | `DELETE /organization/projects/{project_id}/spend_limit` | Delete project spend limit |
Expand All @@ -572,21 +577,32 @@ Use Uploads to upload large files in multiple parts.
| `getsafetycase` | `GET /safety/cases/{id}` | Get safety case |
| `list-container-files` | `GET /containers/{container_id}/files` | List container files |
| `list-containers` | `GET /containers` | List containers |
| `list-platformworkloadidentityfederationrules` | `GET /organization/workload_identity_providers/{workload_identity_provider_id}/federation_rules` | List Platform workload identity federation rules |
| `list-platformworkloadidentityproviders` | `GET /organization/workload_identity_providers` | List Platform workload identity providers |
| `list-thread-items-method` | `GET /chatkit/threads/{thread_id}/items` | List ChatKit thread items |
| `list-threads-method` | `GET /chatkit/threads` | List ChatKit threads |
| `list-webhook-endpoints` | `GET /webhook_endpoints` | List Webhook Endpoints |
| `list-webhook-event-types` | `GET /webhook_event_types` | List Webhook Event Types |
| `listexternalstorageconfigurations` | `GET /organization/external_storage` | List external storage configurations |
| `listtheexternalkeyconfigsregisteredontheuser'sorganization` | `GET /organization/external_keys` | List the external key configs registered on the user's organization |
| `organization-decisionsusage` | `GET /organization/usage/decisions` | Decisions |
| `retrieve-container` | `GET /containers/{container_id}` | Retrieve container |
| `retrieve-container-file` | `GET /containers/{container_id}/files/{file_id}` | Retrieve container file |
| `retrieve-container-file-content` | `GET /containers/{container_id}/files/{file_id}/content` | Retrieve container file content |
| `retrieve-platformworkloadidentityfederationrule` | `GET /organization/workload_identity_providers/{workload_identity_provider_id}/federation_rules/{workload_identity_federation_rule_id}` | Retrieve Platform workload identity federation rule |
| `retrieve-platformworkloadidentityprovider` | `GET /organization/workload_identity_providers/{workload_identity_provider_id}` | Retrieve Platform workload identity provider |
| `retrieve-webhook-endpoint` | `GET /webhook_endpoints/{webhook_endpoint_id}` | Retrieve Webhook Endpoint |
| `retrieveanexternalkeyregistration` | `GET /organization/external_keys/{external_key_id}` | Retrieve an external key registration |
| `retrieveprojectservicetiersettings` | `GET /organization/projects/{project_id}/service_tier_settings` | Retrieve project service tier settings |
| `rotate-webhook-endpoint-signing-secret` | `POST /webhook_endpoints/{webhook_endpoint_id}/rotate_secret` | Rotate Webhook Endpoint Signing Secret |
| `test-webhook-endpoint` | `POST /webhook_endpoints/{webhook_endpoint_id}/test` | Test Webhook Endpoint |
| `update-platformworkloadidentityfederationrule` | `POST /organization/workload_identity_providers/{workload_identity_provider_id}/federation_rules/{workload_identity_federation_rule_id}` | Update Platform workload identity federation rule |
| `update-platformworkloadidentityprovider` | `POST /organization/workload_identity_providers/{workload_identity_provider_id}` | Update Platform workload identity provider |
| `update-webhook-endpoint` | `POST /webhook_endpoints/{webhook_endpoint_id}` | Update Webhook Endpoint |
| `updateorganizationspendlimit` | `POST /organization/spend_limit` | Update organization spend limit |
| `updateprojectservicetiersettings` | `POST /organization/projects/{project_id}/service_tier_settings` | Update project service tier settings |
| `updateprojectspendlimit` | `POST /organization/projects/{project_id}/spend_limit` | Update project spend limit |
| `validateanexternalkeyconfigfortheuser'sorganization` | `POST /organization/external_keys/{external_key_id}/validate` | Validate an external key config for the user's organization |
| `validateanexternalstorageconfiguration` | `POST /organization/external_storage/{external_storage_id}/validate` | Validate an external storage configuration |

## Usage tips
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace tryAGI.OpenAI.Cli.GeneratedApi.Commands;

internal static partial class AddanexternalkeyconfigforanorganizationCommandApiCommand
{

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.ExternalKeyResource 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<string, CliFormatHint>(StringComparer.OrdinalIgnoreCase)
{
};
CustomizeResponseFormatHints(hints);
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

static partial void CustomizeResponseText(ParseResult parseResult, global::tryAGI.OpenAI.ExternalKeyResource value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create(string? commandName = null)
{
var command = new Command(commandName ?? @"addanexternalkeyconfigforanorganization", @"Add an external key config for an organization
Add an external key config for an organization");

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 exactly one of --input, --request-json, or --request-file.");
}
});

command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{

var request = await CliRuntime.ReadRequestAsync<global::tryAGI.OpenAI.V1OrganizationExternalKeysPostRequest>(
parseResult,
Input,
RequestJson,
RequestFile,
global::tryAGI.OpenAI.SourceGenerationContext.Default,
cancellationToken).ConfigureAwait(false);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.AddanexternalkeyconfigforanorganizationAsync(

request: request,
cancellationToken: cancellationToken).ConfigureAwait(false);


if (!await CliRuntime.TryWriteOutputDirectoryAsync(
parseResult,
response,
global::tryAGI.OpenAI.SourceGenerationContext.Default,
@"ApiProjectIds",
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ namespace tryAGI.OpenAI.Cli.GeneratedApi.Commands;

internal static partial class AgentsCreateAgentCommandApiCommand
{
private static Option<global::tryAGI.OpenAI.ExperimentalConfigParam?> Experimental { get; } = new(
name: @"--experimental")
{
Description = @"Experimental agent settings. All experimental features default to disabled.",
};

private static Option<global::System.Collections.Generic.Dictionary<string, string>?> Metadata { get; } = new(
name: @"--metadata")
{
Expand Down Expand Up @@ -56,6 +62,8 @@ internal static partial class AgentsCreateAgentCommandApiCommand
Description = @"Tools available to the agent. Defaults to an empty list. The tool list must fit within 3 MiB (3,145,728 bytes) of compact UTF-8 JSON.",
};
private static readonly MultiAgentConfigCurrentParamOptionSet MultiAgentOptions = MultiAgentConfigCurrentParamOptionSet.Create(@"multi-agent");

private static readonly CompactionParamOptionSet CompactionOptions = CompactionParamOptionSet.Create(@"compaction");
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.",
Expand Down Expand Up @@ -99,6 +107,7 @@ public static Command Create(string? commandName = null)
{
var command = new Command(commandName ?? @"create-agent", @"Create an agent
Creates a reusable agent without storing credentials. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).");
command.Options.Add(Experimental);
command.Options.Add(Metadata);
command.Options.Add(NameOption);
command.Options.Add(Model);
Expand All @@ -107,7 +116,7 @@ public static Command Create(string? commandName = null)
command.Options.Add(ServiceTier);
command.Options.Add(Instructions);
command.Options.Add(Tools); command.Options.Add(MultiAgentOptions.Enabled);
command.Options.Add(MultiAgentOptions.MaxConcurrentSubagents);
command.Options.Add(MultiAgentOptions.MaxConcurrentSubagents); command.Options.Add(CompactionOptions.Async);
command.Options.Add(Input);
command.Options.Add(RequestJson);
command.Options.Add(RequestFile);
Expand All @@ -133,6 +142,7 @@ await CliRuntime.RunAsync(async () =>
RequestFile,
global::tryAGI.OpenAI.SourceGenerationContext.Default,
cancellationToken).ConfigureAwait(false);
var experimental = CliRuntime.WasSpecified(parseResult, Experimental) ? parseResult.GetValue(Experimental) : (__requestBase is { } __ExperimentalBaseValue ? __ExperimentalBaseValue.Experimental : default);
var metadata = CliRuntime.WasSpecified(parseResult, Metadata) ? parseResult.GetValue(Metadata) : (__requestBase is { } __MetadataBaseValue ? __MetadataBaseValue.Metadata : default);
var name = CliRuntime.WasSpecified(parseResult, NameOption) ? parseResult.GetValue(NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default);
var model = parseResult.GetRequiredValue(Model);
Expand All @@ -154,10 +164,22 @@ await CliRuntime.RunAsync(async () =>

}
: __MultiAgentBase;

var __CompactionBase = __requestBase is { } __CompactionBaseValue ? __CompactionBaseValue.Compaction : default; var compactionAsync = CliRuntime.WasSpecified(parseResult, CompactionOptions.Async) ? parseResult.GetValue(CompactionOptions.Async) : (__CompactionBase is { } __CompactionasyncBaseValue ? __CompactionasyncBaseValue.Async : default);
var __CompactionSpecified = CliRuntime.WasSpecified(parseResult, CompactionOptions.Async);
var compaction =
__CompactionSpecified || __CompactionBase is not null
? new global::tryAGI.OpenAI.CompactionParam
{
Async = compactionAsync,

}
: __CompactionBase;
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Agents.CreateAgentAsync(
experimental: experimental,
metadata: metadata,
name: name,
model: model,
Expand All @@ -167,6 +189,7 @@ await CliRuntime.RunAsync(async () =>
instructions: instructions,
tools: tools,
multiAgent: multiAgent,
compaction: compaction,
cancellationToken: cancellationToken).ConfigureAwait(false);


Expand Down
Loading
Loading