Module: RunApi::Runway

Defined in:
lib/runapi/runway.rb,
lib/runapi/runway/types.rb,
lib/runapi/runway/client.rb,
lib/runapi/runway/contract_gen.rb,
lib/runapi/runway/resources/extend_video.rb,
lib/runapi/runway/resources/text_to_video.rb

Defined Under Namespace

Modules: Resources, Types Classes: Client

Constant Summary collapse

AuthenticationError =
RunApi::Core::AuthenticationError
RateLimitError =
RunApi::Core::RateLimitError
InsufficientCreditsError =
RunApi::Core::InsufficientCreditsError
NotFoundError =
RunApi::Core::NotFoundError
ValidationError =
RunApi::Core::ValidationError
TaskFailedError =
RunApi::Core::TaskFailedError
TaskTimeoutError =
RunApi::Core::TaskTimeoutError
CONTRACT =
{
  "extend-video" => {
    "models" => ["runway"],
    "fields_by_model" => {
      "runway" => {
        "output_resolution" => {
          "enum" => ["720p", "1080p"],
          "required" => true
        },
        "prompt" => {
          "required" => true
        },
        "source_task_id" => {
          "required" => true
        }
      }
    }
  },
  "text-to-video" => {
    "models" => ["runway"],
    "fields_by_model" => {
      "runway" => {
        "aspect_ratio" => {
          "enum" => ["16:9", "9:16", "1:1", "4:3", "3:4"]
        },
        "duration_seconds" => {
          "enum" => [5, 10],
          "required" => true,
          "type" => "integer"
        },
        "output_resolution" => {
          "enum" => ["720p", "1080p"],
          "required" => true
        },
        "prompt" => {
          "required" => true
        }
      }
    },
    "rules" => [{
      "when" => {
        "first_frame_image_url" => {
          "present" => false
        }
      },
      "required" => ["aspect_ratio"]
    }, {
      "when" => {
        "first_frame_image_url" => {
          "present" => true
        }
      },
      "forbidden" => ["aspect_ratio"]
    }]
  }
}.freeze