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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
126 changes: 66 additions & 60 deletions src/cli/AI21.CLI/Commands/DefaultApiGroupCommand.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,72 +103,78 @@ public static Command Create()
command.Subcommands.Add(ListProviderKeysTokenwiseSettingsProviderKeysGetCommandApiCommand.Create());
command.Subcommands.Add(ParsePdfStudioV1DemosDocumentModifierParsePdfPostCommandApiCommand.Create());
command.Subcommands.Add(ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyBedrockCountTokensGatewayModelModelIdCountTokensPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyBedrockCountTokensTokenwiseModelModelIdCountTokensPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyBedrockInvokeGatewayModelModelIdInvokePostCommandApiCommand.Create());
command.Subcommands.Add(ProxyBedrockInvokeStreamGatewayModelModelIdInvokeWithResponseStreamPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyBedrockInvokeStreamTokenwiseModelModelIdInvokeWithResponseStreamPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyBedrockInvokeTokenwiseModelModelIdInvokePostCommandApiCommand.Create());
command.Subcommands.Add(ProxyCliConfigHarnessApiAuthCliConfigGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyHarnessApiHarnessApiPathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyHarnessApiHarnessApiPathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyHarnessApiHarnessApiPathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyHarnessApiHarnessApiPathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyHarnessApiHarnessApiPathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathPostCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathPost2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathPost3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathPost4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathPost5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathPost6CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1GatewayV1PathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1TokenwiseV1PathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaGatewayV1betaPathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1betaTokenwiseV1betaPathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalGatewayV1internalPathGet6CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathGetCommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathGet2CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathGet3CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathGet4CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathGet5CommandApiCommand.Create());
command.Subcommands.Add(ProxyV1internalTokenwiseV1internalPathGet6CommandApiCommand.Create());
command.Subcommands.Add(SubmitInsightFeedbackGatewayInsightsInsightIdFeedbackPostCommandApiCommand.Create());
command.Subcommands.Add(SubmitInsightFeedbackTokenwiseInsightsInsightIdFeedbackPostCommandApiCommand.Create());
command.Subcommands.Add(UpdateAgentGatewaySettingsAgentsAgentIdPutCommandApiCommand.Create());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace AI21.CLI.Commands;

internal static partial class ProxyBedrockCountTokensGatewayModelModelIdCountTokensPostCommandApiCommand
{
private static Argument<string> ModelId { get; } = new(
name: @"model-id")
{
Description = @"",
};

private static Option<string?> XAi21Key { get; } = new(
name: @"--x-ai21-key")
{
Description = @"",
};

private static string FormatResponse(ParseResult parseResult, string 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, string 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 ?? @"proxy-bedrock-count-tokens-gateway-model-model-id-count-tokens-post", @"Proxy Bedrock Count Tokens
Bedrock ``CountTokens`` — optional for Claude Code (``/context``), not a generation.");
command.Arguments.Add(ModelId);
command.Options.Add(XAi21Key);


command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{
var modelId = parseResult.GetRequiredValue(ModelId);
var xAi21Key = parseResult.GetValue(XAi21Key);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.ProxyBedrockCountTokensGatewayModelModelIdCountTokensPostAsync(
modelId: modelId,
xAi21Key: xAi21Key,
cancellationToken: cancellationToken).ConfigureAwait(false);


await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::AI21.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
Loading
Loading