Skip to content

InspectModelSchema

This example assumes using Runway; is in scope and apiKey contains your Runway API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var imageToVideo = RunwayModelSchema.Lookup("gen4_turbo");

var multiEndpoint = RunwayModelSchema.Lookup("veo3.1_fast");

var gptImage = RunwayModelSchema.Lookup("gpt_image_2");

var withDash = RunwayModelSchema.Lookup("gen4-turbo");

var unknown = RunwayModelSchema.Lookup("definitely_not_a_runway_model");

var known = RunwayModelSchema.KnownModelIds().ToList();

// EnsureModelSupportsEndpoint catches mismatches against the spec.
var rejection = Action(() => RunwayModelSchema.EnsureModelSupportsEndpoint("gpt_image_2", "text_to_video"));

// Correct pairing passes silently.
Action(() => RunwayModelSchema.EnsureModelSupportsEndpoint("gpt_image_2", "text_to_image"))

// Unknown models are allowed through (so brand-new spec entries work without a CLI release).
Action(() => RunwayModelSchema.EnsureModelSupportsEndpoint("future_model_id", "text_to_image"))

// EnsureRequiredParametersProvided complains when a spec-required param is marked missing,
// and translates spec property names to the CLI flag the user should add.
var missingPromptImage = Action(() => RunwayModelSchema.EnsureRequiredParametersProvided(
    "gen3a_turbo",
    "image_to_video",
    new Dictionary<string, bool>
    {
        ["promptText"] = true,
        ["promptImage"] = false,
        ["ratio"] = true,
    }));
    .WithMessage("*requires promptImage (--image)*");

// DescribeRequiredParam annotates known spec params with their CLI flag.
// Unknown spec params fall through to bare name.

// Spec param the caller didn't list is not enforced (CLI doesn't track every flag).
Action(() => RunwayModelSchema.EnsureRequiredParametersProvided(
    "gen4_image_turbo",
    "text_to_image",
    new Dictionary<string, bool>
    {
        ["promptText"] = true,
        // ratio + referenceImages omitted -> not enforced
    }))

// All required flags satisfied -> passes silently.
Action(() => RunwayModelSchema.EnsureRequiredParametersProvided(
    "veo3.1_fast",
    "text_to_video",
    new Dictionary<string, bool>
    {
        ["promptText"] = true,
        ["ratio"] = true,
    }))

// Unknown model -> passes silently (brand-new spec entries don't break the CLI).
Action(() => RunwayModelSchema.EnsureRequiredParametersProvided(
    "future_unknown_model",
    "text_to_image",
    new Dictionary<string, bool>()))

static Action Action(Action action) => action;