execute_manim_code
Render Manim-Slides scenes from Python code and retrieve the produced media files. Automatically caches unchanged renders to save time.
Instructions
Execute Manim-Slides Python code and render the resulting scenes.
Writes the provided code to a secure temporary script, renders it with
``manim-slides render`` (headless, no preview popup), and returns the
produced media files. Rendered-frame percentages are streamed to the client
as ``notifications/progress`` updates while rendering is in progress.
Renders are cached by a content hash of ``code``, ``scenes``, and
``quality``: an unchanged request reuses the previously rendered media
instead of re-rendering.
Args:
code: Python source code defining one or more Manim Scene/Slide classes.
scenes: Names of the Scene/Slide classes to render. If omitted or empty,
all scenes in the file are rendered.
quality: Render quality: "l" (low), "m" (medium), "h" (high),
"p" (2K), or "k" (4K). Defaults to "l".
media_dir: Directory where rendered media is stored. Defaults to the
``WORKSPACE_DIR`` environment variable or a temporary directory.
timeout: Maximum time in seconds to wait for rendering.
use_cache: When True, reuse previously rendered media for unchanged
requests instead of re-rendering. Defaults to True.
Returns:
A JSON string with the render status, produced media file paths,
executed command, and captured stdout/stderr. A cache hit sets
``cached`` to True and omits the command.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| scenes | No | ||
| quality | No | l | |
| timeout | No | ||
| media_dir | No | ||
| use_cache | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |