start • AI Agent SDK
start: Generate video with optional wait and file output.
start
Method
</div>
This is a method of the VideoAgent class in the video_agent module.
Generate video with optional wait and file output.
Beginner-friendly method that handles the full workflow:
- Generate video
- Wait for completion (if wait=True)
- Download and save to file (if output is specified)
Signature
def start(prompt: str, wait: bool, output: Optional[str]) -> Union[Any, bytes]Parameters
ParamField
strText description of the desired video
ParamField
boolIf True, wait for completion before returning
ParamField
Optional[str]Path to save the video file (e.g., “video.mp4”) **kwargs: Additional parameters for generate()
Returns
ResponseField
Union[Any, bytes]VideoObject with initial status – If wait=True and output: bytes (video content) – If wait=True and no output: VideoObject with completed status
Usage
# Full workflow with file output
video = agent.start(
prompt="A serene lake at sunset",
wait=True,
output="sunset.mp4"
)
# Just generate (don't wait)
video = agent.start(
prompt="A cat playing",
wait=False
)
print(f"Video ID: {video.id}") # Poll later with status()Uses
generatewait_for_completioncontentf.write
Used By
Source
View on GitHubpraisonaiagents/agent/video_agent.py at line 639