[feat] Standardize media handling and unify AgentOS routers#7310
Open
nklowns wants to merge 1 commit intoagno-agi:mainfrom
Open
[feat] Standardize media handling and unify AgentOS routers#7310nklowns wants to merge 1 commit intoagno-agi:mainfrom
nklowns wants to merge 1 commit intoagno-agi:mainfrom
Conversation
Contributor
PR TriageMissing issue link: Please link the issue this PR addresses using |
394fa4b to
994a781
Compare
994a781 to
5ce7318
Compare
5ce7318 to
c668b41
Compare
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
fixes #7311 This PR standardizes media validation across the Agent platform by moving MIME type and extension checks into the core
Mediaclasses and simplifying the corresponding AgentOS routers.Changes
Core Media Layer (
libs/agno/agno/media.py):valid_mime_types()andvalid_extensions()class methods toImage,Video, andFileMedia.AgentOS Routers (
libs/agno/agno/os/routers/):agents/router.py&teams/router.py: Refactored file upload handling to use centralized media validation.Utilities & Normalization (
libs/agno/agno/utils/common.py&libs/agno/agno/os/utils.py):IMAGE/PNG->image/png).Tests:
libs/agno/tests/unit/test_media_structure.pyfor core validation.libs/agno/tests/unit/os/test_utils_media.pyfor filename and normalization.libs/agno/tests/unit/os/test_router_uploads.py.Type of change
Checklist
./scripts/format.shand./scripts/validate.shupward)Duplicate and AI-Generated PR Check
Additional Notes