feat: Add Manim toolkit and AgentOS examples#7554
Open
Conversation
Introduce a Manim toolkit and example agents for rendering Manim CE scenes and attaching MP4s to run responses. Adds libs/agno/agno/tools/manim.py (ManimTools with render_scene/arender_scene, quality presets, error handling, and list_rendered_videos), a CLI demo cookbook/91_tools/manim_tools/manim_tools.py, an AgentOS wrapper cookbook/91_tools/manim_tools/manim_agentos.py, plus README and TEST_LOG. Videos are read into memory as agno.media.Video (base64-inlined at serialization); on-disk artifacts are placed under tmp/ for easy cleanup.
kausmeows
reviewed
Apr 16, 2026
| ) | ||
|
|
||
|
|
||
| def save_base64_video_to_disk(video: Video, dest_dir: Path) -> Path: |
Contributor
There was a problem hiding this comment.
this should rather be a util function within the sdk.
Member
|
Please add some tests and link a docs PR |
Add size and duration safety bounds for Manim renders: introduce max_inline_bytes (25 MB default) and max_duration_seconds (120s default), increase default timeout to 900s, and validate their values. Use ffprobe to probe output duration and reject overlong renders; inline small mp4s as Video(content=...) and persist/return large renders as Video(filepath=...). Quiet manim subprocess output by adding -v WARNING and --progress_bar none. Update README to document delivery and safety bounds, adjust example script, and add comprehensive unit tests (libs/agno/tests/unit/tools/test_manim.py) covering success, errors, delivery modes, and probes.
Add robust video persistence and update test log. - Implement save_video_to_disk that handles Video(content), Video(filepath) and remote content (via get_content_bytes), copying or decoding as appropriate; add backwards-compatible alias save_base64_video_to_disk. Import shutil for file copies. - Update CLI/agent scripts to detect delivery mode (inline/filepath/url), print delivery info and saved file sizes, and switch to the new save_video_to_disk API. - Remove hardcoded timeout_seconds=180 from Agent tool instantiations to rely on defaults. - Expand TEST_LOG.md with unit test results (16/16 pass) and mark end-to-end / voice / AgentOS checks as pending. These changes ensure large renders that are returned as filepaths are handled correctly, preserve backward compatibility, and improve developer visibility into test and run outputs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce a Manim toolkit and example agents for rendering Manim CE scenes and attaching MP4s to run responses. Adds libs/agno/agno/tools/manim.py (ManimTools with render_scene/arender_scene, quality presets, error handling, and list_rendered_videos), a CLI demo cookbook/91_tools/manim_tools/manim_tools.py, an AgentOS wrapper cookbook/91_tools/manim_tools/manim_agentos.py, plus README and TEST_LOG. Videos are read into memory as agno.media.Video (base64-inlined at serialization); on-disk artifacts are placed under tmp/ for easy cleanup.
TLDR: allow agents to make 3blue1brown videos
(If applicable, issue number: #____)
Type of change
Checklist
./scripts/format.shand./scripts/validate.sh)Duplicate and AI-Generated PR Check
Additional Notes
Add any important context (deployment instructions, screenshots, security considerations, etc.)