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
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,12 @@ internal static partial class GenerateCreateGenerateVideoCommandApiCommand
Required = true,
};

private static Option<bool?> DryRun { get; } = CliRuntime.CreateNullableBoolOption(
name: @"--dry-run",
description: @"When true, run the full routing pipeline and return the decision and estimated cost without generating. No task is created, nothing is billed, and no asset is produced.");

private static Option<global::Runway.CreateGenerateVideoRequestInput> InputOption { get; } = new(
name: @"--input")
{
Description = @"Model-agnostic video generation input. Fields are optional; the router selects a model and maps these options to it.",
Required = true,
};
private static Option<string?> RequestInput { get; } = new(@"--request-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::Runway.CreateGenerateVideoResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings)
{
Expand Down Expand Up @@ -74,44 +54,21 @@ public static Command Create()
Start a video generation task using a saved Model Router config instead of naming a model.");
command.Options.Add(XRunwayVersion);
command.Options.Add(ConfigId);
command.Options.Add(DryRun);
command.Options.Add(InputOption);
command.Options.Add(RequestInput);
command.Options.Add(RequestJson);
command.Options.Add(RequestFile);
command.Validators.Add(result =>
{
var hasInput = result.GetResult(RequestInput) 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 --request-input, --request-json, or --request-file.");
}
});


command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{
var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync<global::Runway.CreateGenerateVideoRequest>(
parseResult,
RequestInput,
RequestJson,
RequestFile,
global::Runway.SourceGenerationContext.Default,
cancellationToken).ConfigureAwait(false);
var xRunwayVersion = parseResult.GetRequiredValue(XRunwayVersion);
var configId = parseResult.GetRequiredValue(ConfigId);
var dryRun = CliRuntime.WasSpecified(parseResult, DryRun) ? parseResult.GetValue(DryRun) : (__requestBase is { } __DryRunBaseValue ? __DryRunBaseValue.DryRun : default);
var input = parseResult.GetRequiredValue(InputOption);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Generate.CreateGenerateVideoAsync(
xRunwayVersion: xRunwayVersion,
configId: configId,
dryRun: dryRun,
input: input,
cancellationToken: cancellationToken).ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ partial void ProcessCreateGenerateVideoResponseContent(
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// No model satisfies the config and request together. Returned identically for real and dry-run requests.
// No model satisfies the config and request together.
if ((int)__response.StatusCode == 400)
{
string? __content_400 = null;
Expand Down Expand Up @@ -533,9 +533,6 @@ partial void ProcessCreateGenerateVideoResponseContent(
/// <param name="configId">
/// The slug of a saved Model Router config to route this request with.
/// </param>
/// <param name="dryRun">
/// When true, run the full routing pipeline and return the decision and estimated cost without generating. No task is created, nothing is billed, and no asset is produced.
/// </param>
/// <param name="input">
/// Model-agnostic video generation input. Fields are optional; the router selects a model and maps these options to it.
/// </param>
Expand All @@ -546,14 +543,12 @@ partial void ProcessCreateGenerateVideoResponseContent(
string configId,
global::Runway.CreateGenerateVideoRequestInput input,
string xRunwayVersion = "2024-11-06",
bool? dryRun = default,
global::Runway.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Runway.CreateGenerateVideoRequest
{
ConfigId = configId,
DryRun = dryRun,
Input = input,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public partial interface IGenerateClient
/// <param name="configId">
/// The slug of a saved Model Router config to route this request with.
/// </param>
/// <param name="dryRun">
/// When true, run the full routing pipeline and return the decision and estimated cost without generating. No task is created, nothing is billed, and no asset is produced.
/// </param>
/// <param name="input">
/// Model-agnostic video generation input. Fields are optional; the router selects a model and maps these options to it.
/// </param>
Expand All @@ -61,7 +58,6 @@ public partial interface IGenerateClient
string configId,
global::Runway.CreateGenerateVideoRequestInput input,
string xRunwayVersion = "2024-11-06",
bool? dryRun = default,
global::Runway.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading