6bf8bebf51
CI / Test and Build (push) Failing after 1s
CI / Migrate Dev DB (push) Has been skipped
CI / Migrate DB (push) Has been skipped
CodeQL / Analyze actions (push) Has been cancelled
CodeQL / Analyze javascript-typescript (push) Has been cancelled
CI / Detect Version (push) Has been cancelled
CI / Detect Desktop Changes (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/cron.Dockerfile, ubuntu-latest, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build AMD64 (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/cron.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/db.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/pii.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/realtime.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-8vcpu-ubuntu-2404-arm, ./docker/app.Dockerfile, linux-arm64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
Helm Chart / Lint, test, and validate chart (push) Has been cancelled
Helm Chart / Chart version bumped (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Build Dev ECR (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core) (push) Has been cancelled
CI / Promote Images (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Check Desktop Signing Secrets (push) Has been cancelled
CI / Desktop Release (push) Has been cancelled
CI / Create Desktop Prerelease (push) Has been cancelled
CI / Desktop Prerelease Build (push) Has been cancelled
CI / Publish Desktop Prerelease (push) Has been cancelled
CI / Prune Desktop Prereleases (push) Has been cancelled
Helm Chart / Install on kind and run helm test (push) Has been cancelled
140 lines
4.0 KiB
TypeScript
140 lines
4.0 KiB
TypeScript
import type { ToolConfig } from '@/tools/types'
|
|
import type { VideoParams, VideoResponse } from '@/tools/video/types'
|
|
|
|
export const runwayVideoTool: ToolConfig<VideoParams, VideoResponse> = {
|
|
id: 'video_runway',
|
|
name: 'Runway Gen-4 Video',
|
|
description: 'Generate videos using Runway Gen-4 with world consistency and visual references',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
provider: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Video provider (runway)',
|
|
},
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Runway API key',
|
|
},
|
|
model: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Runway model: gen-4 (default, higher quality) or gen-4-turbo (faster)',
|
|
},
|
|
prompt: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'Text prompt describing the video to generate',
|
|
},
|
|
duration: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Video duration in seconds (5 or 10, default: 5)',
|
|
},
|
|
aspectRatio: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Aspect ratio: 16:9 (landscape), 9:16 (portrait), or 1:1 (square)',
|
|
},
|
|
resolution: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Video resolution (720p output). Note: Gen-4 Turbo outputs at 720p natively',
|
|
},
|
|
visualReference: {
|
|
type: 'file',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description:
|
|
'Reference image REQUIRED for Gen-4 (UserFile object). Gen-4 only supports image-to-video, not text-only generation',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
modelInput: {
|
|
mode: 'project',
|
|
select: (params) => ({ prompt: params.prompt }),
|
|
},
|
|
url: '/api/tools/video',
|
|
method: 'POST',
|
|
headers: () => ({
|
|
'Content-Type': 'application/json',
|
|
}),
|
|
body: (
|
|
params: VideoParams & {
|
|
_context?: { workspaceId?: string; workflowId?: string; executionId?: string }
|
|
}
|
|
) => ({
|
|
provider: 'runway',
|
|
apiKey: params.apiKey,
|
|
model: 'gen-4-turbo', // Only gen4_turbo model is supported
|
|
prompt: params.prompt,
|
|
duration: params.duration || 5,
|
|
aspectRatio: params.aspectRatio || '16:9',
|
|
resolution: params.resolution || '720p',
|
|
visualReference: params.visualReference,
|
|
workspaceId: params._context?.workspaceId,
|
|
workflowId: params._context?.workflowId,
|
|
executionId: params._context?.executionId,
|
|
}),
|
|
},
|
|
|
|
transformResponse: async (response: Response) => {
|
|
const data = await response.json()
|
|
|
|
if (!response.ok || data.error) {
|
|
return {
|
|
success: false,
|
|
error: data.error || 'Video generation failed',
|
|
output: {
|
|
videoUrl: '',
|
|
},
|
|
}
|
|
}
|
|
|
|
if (!data.videoUrl) {
|
|
return {
|
|
success: false,
|
|
error: 'Missing videoUrl in response',
|
|
output: {
|
|
videoUrl: '',
|
|
},
|
|
}
|
|
}
|
|
|
|
return {
|
|
success: true,
|
|
output: {
|
|
videoUrl: data.videoUrl,
|
|
videoFile: data.videoFile,
|
|
duration: data.duration,
|
|
width: data.width,
|
|
height: data.height,
|
|
provider: 'runway',
|
|
model: data.model,
|
|
jobId: data.jobId,
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
videoUrl: { type: 'string', description: 'Generated video URL' },
|
|
videoFile: { type: 'file', description: 'Video file object with metadata' },
|
|
duration: { type: 'number', description: 'Video duration in seconds' },
|
|
width: { type: 'number', description: 'Video width in pixels' },
|
|
height: { type: 'number', description: 'Video height in pixels' },
|
|
provider: { type: 'string', description: 'Provider used (runway)' },
|
|
model: { type: 'string', description: 'Model used' },
|
|
jobId: { type: 'string', description: 'Runway job ID' },
|
|
},
|
|
}
|