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
4 changes: 2 additions & 2 deletions .claude/skills/tryagi-openai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dnx tryAGI.OpenAI.CLI <group> --help
| `invite` | 4 | |
| `model` | 3 | List and describe the various models available in the API. |
| `moderation` | 1 | Given text and/or image inputs, classifies if those inputs are potentially harmful. |
| `project` | 24 | |
| `project` | 23 | |
| `project-group` | 4 | |
| `project-group-role-assignment` | 4 | |
| `project-user-role-assignment` | 4 | |
Expand All @@ -61,7 +61,7 @@ dnx tryAGI.OpenAI.CLI <group> --help
| `user-organization-role-assignment` | 4 | |
| `vector-store` | 16 | |
| `video` | 10 | |
| `default` | 23 | |
| `default` | 24 | |

## References

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/tryagi-openai/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ Given text and/or image inputs, classifies if those inputs are potentially harmf
| `archive-project` | `POST /organization/projects/{project_id}/archive` | Archives a project in the organization. Archived projects cannot be used or updated. |
| `create-project` | `POST /organization/projects` | Create a new project in the organization. Projects can be created and archived, but cannot be deleted. |
| `create-project-service-account` | `POST /organization/projects/{project_id}/service_accounts` | Creates a new service account in the project. By default, this also returns an unredacted API key for the service account. |
| `create-project-service-account-api-key` | `POST /organization/projects/{project_id}/service_accounts/{service_account_id}/api_keys` | Creates an API key for a service account in the project. |
| `create-project-user` | `POST /organization/projects/{project_id}/users` | Adds a user to the project. Users must already be members of the organization to be added to a project. |
| `delete-project-api-key` | `DELETE /organization/projects/{project_id}/api_keys/{api_key_id}` | Deletes an API key from the project. Returns confirmation of the key deletion, or an error if the key belonged to a service account. |
| `delete-project-model-permissions` | `DELETE /organization/projects/{project_id}/model_permissions` | Deletes model permissions for a project. |
Expand Down Expand Up @@ -476,6 +475,7 @@ Use Uploads to upload large files in multiple parts.
| `create-chat-kit-session` | `POST /chatkit/sessions` | Create a ChatKit session. |
| `create-container` | `POST /containers` | Create Container |
| `create-container-file` | `POST /containers/{container_id}/files` | Create a Container File You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID. |
| `create-project-service-account-api-key` | `POST /organization/projects/{project_id}/service_accounts/{service_account_id}/api_keys` | Creates an API key for a service account in the project. |
| `delete-acontainer` | `DELETE /containers/{container_id}` | Delete Container |
| `delete-acontainer-file` | `DELETE /containers/{container_id}/files/{file_id}` | Delete Container File |
| `delete-admin-api-key` | `DELETE /organization/admin_api_keys/{key_id}` | Delete an organization admin API key |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace tryAGI.OpenAI.Cli.GeneratedApi.Commands;

internal static partial class ProjectsCreateProjectServiceAccountApiKeyCommandApiCommand
internal static partial class CreateProjectServiceAccountApiKeyCommandApiCommand
{
private static Argument<string> ProjectId { get; } = new(
name: @"project-id")
Expand Down Expand Up @@ -47,7 +47,7 @@ internal static partial class ProjectsCreateProjectServiceAccountApiKeyCommandAp
Hidden = true,
};

private static string FormatResponse(ParseResult parseResult, global::tryAGI.OpenAI.ProjectServiceAccountApiKey value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings)
private static string FormatResponse(ParseResult parseResult, global::tryAGI.OpenAI.ServiceAccountApiKeyBody value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings)
{
string? text = null;
CustomizeResponseText(parseResult, value, ref text);
Expand All @@ -63,7 +63,7 @@ private static string FormatResponse(ParseResult parseResult, global::tryAGI.Ope
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

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


Expand Down Expand Up @@ -92,7 +92,7 @@ public static Command Create()
command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{
var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync<global::tryAGI.OpenAI.ProjectServiceAccountApiKeyCreateRequest>(
var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync<global::tryAGI.OpenAI.CreateProjectServiceAccountApiKeyBody>(
parseResult,
Input,
RequestJson,
Expand All @@ -106,7 +106,7 @@ await CliRuntime.RunAsync(async () =>
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Projects.CreateProjectServiceAccountApiKeyAsync(
var response = await client.CreateProjectServiceAccountApiKeyAsync(
projectId: projectId,
serviceAccountId: serviceAccountId,
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static Command Create()
command.Subcommands.Add(CreateChatKitSessionCommandApiCommand.Create());
command.Subcommands.Add(CreateContainerCommandApiCommand.Create());
command.Subcommands.Add(CreateContainerFileCommandApiCommand.Create());
command.Subcommands.Add(CreateProjectServiceAccountApiKeyCommandApiCommand.Create());
command.Subcommands.Add(DeleteAContainerCommandApiCommand.Create());
command.Subcommands.Add(DeleteAContainerFileCommandApiCommand.Create());
command.Subcommands.Add(DeleteAdminApiKeyCommandApiCommand.Create());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public static Command Create()
command.Subcommands.Add(ProjectsArchiveProjectCommandApiCommand.Create());
command.Subcommands.Add(ProjectsCreateProjectCommandApiCommand.Create());
command.Subcommands.Add(ProjectsCreateProjectServiceAccountCommandApiCommand.Create());
command.Subcommands.Add(ProjectsCreateProjectServiceAccountApiKeyCommandApiCommand.Create());
command.Subcommands.Add(ProjectsCreateProjectUserCommandApiCommand.Create());
command.Subcommands.Add(ProjectsDeleteProjectApiKeyCommandApiCommand.Create());
command.Subcommands.Add(ProjectsDeleteProjectModelPermissionsCommandApiCommand.Create());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,57 @@

namespace tryAGI.OpenAI
{
public partial interface IProjectsClient
public partial interface IOpenAiClient
{
/// <summary>
/// Creates an API key for a service account in the project.
/// </summary>
/// <param name="projectId"></param>
/// <param name="serviceAccountId"></param>
/// <param name="projectId">
/// The ID of the project.
/// </param>
/// <param name="serviceAccountId">
/// The ID of the service account.
/// </param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::tryAGI.OpenAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.ProjectServiceAccountApiKey> CreateProjectServiceAccountApiKeyAsync(
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.ServiceAccountApiKeyBody> CreateProjectServiceAccountApiKeyAsync(
string projectId,
string serviceAccountId,

global::tryAGI.OpenAI.ProjectServiceAccountApiKeyCreateRequest request,
global::tryAGI.OpenAI.CreateProjectServiceAccountApiKeyBody request,
global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Creates an API key for a service account in the project.
/// </summary>
/// <param name="projectId"></param>
/// <param name="serviceAccountId"></param>
/// <param name="projectId">
/// The ID of the project.
/// </param>
/// <param name="serviceAccountId">
/// The ID of the service account.
/// </param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::tryAGI.OpenAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.AutoSDKHttpResponse<global::tryAGI.OpenAI.ProjectServiceAccountApiKey>> CreateProjectServiceAccountApiKeyAsResponseAsync(
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.AutoSDKHttpResponse<global::tryAGI.OpenAI.ServiceAccountApiKeyBody>> CreateProjectServiceAccountApiKeyAsResponseAsync(
string projectId,
string serviceAccountId,

global::tryAGI.OpenAI.ProjectServiceAccountApiKeyCreateRequest request,
global::tryAGI.OpenAI.CreateProjectServiceAccountApiKeyBody request,
global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Creates an API key for a service account in the project.
/// </summary>
/// <param name="projectId"></param>
/// <param name="serviceAccountId"></param>
/// <param name="projectId">
/// The ID of the project.
/// </param>
/// <param name="serviceAccountId">
/// The ID of the service account.
/// </param>
/// <param name="name">
/// API key name.
/// </param>
Expand All @@ -50,7 +62,7 @@ public partial interface IProjectsClient
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.ProjectServiceAccountApiKey> CreateProjectServiceAccountApiKeyAsync(
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.ServiceAccountApiKeyBody> CreateProjectServiceAccountApiKeyAsync(
string projectId,
string serviceAccountId,
string? name = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class ServiceAccountApiKeyBodyObjectJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObjectExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObjectExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class ServiceAccountApiKeyBodyObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject?>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObjectExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObject? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::tryAGI.OpenAI.ServiceAccountApiKeyBodyObjectExtensions.ToValueString(value.Value));
}
}
}
}
Loading