feat(tools): add read_media tool for image/video/audio processing#1228
Open
YvanJiang wants to merge 1 commit intoagentscope-ai:mainfrom
Open
feat(tools): add read_media tool for image/video/audio processing#1228YvanJiang wants to merge 1 commit intoagentscope-ai:mainfrom
YvanJiang wants to merge 1 commit intoagentscope-ai:mainfrom
Conversation
Add a new async tool that can read and process media files from: - Local file paths - file:// URLs - http(s):// URLs Features: - Image support (PNG, JPG, GIF, WEBP, BMP) with compression - Video support (MP4, AVI, MOV, etc.) with frame extraction - Audio support (MP3, WAV, AAC, etc.) - File format validation via magic numbers - Maximum file size: 20MB before compression
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
|
Hi @YvanJiang, This is a useful feature, but base64 encoding consumes too much context. Additionally, this PR introduces dependencies on Pillow and FFmpeg, adding extra complexity for users. I’ve submitted an update in #1526 with a more lightweight approach to image reading for multi-modal models. Feel free to share any suggestions there. For audio and video support, new PRs are welcome. BTW, more discussion is welcome in #1230 if you'd like to follow up there. |
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
Add a new `read_media` tool for reading and processing image, video, and audio files.
Features
Supported Formats
Usage
```python
from copaw.agents.tools import read_media
result = await read_media("/path/to/image.png")
```
Related
Split from PR #1063
🤖 Generated with Claude Code