Skip to content

Multimodal fix#89

Merged
Iamsdt merged 4 commits intomainfrom
multimodal_fix
Apr 5, 2026
Merged

Multimodal fix#89
Iamsdt merged 4 commits intomainfrom
multimodal_fix

Conversation

@Iamsdt
Copy link
Copy Markdown
Collaborator

@Iamsdt Iamsdt commented Apr 5, 2026

This pull request introduces several important improvements to media handling, exception management, and public API structure in the agentflow framework. The most significant changes include the addition of a new exception for unsupported media input, enhanced internal media reference resolution, improved Google integration for media handling, and a more comprehensive and user-friendly package initialization.

Media Handling and Integration:

  • Added a new exception class, UnsupportedMediaInputError, to provide clear and actionable errors when a model or provider cannot accept a given media input, including structured logging and helpful suggestions.
  • Improved internal media reference resolution in agent execution by resolving agentflow://media/... URLs to signed URLs or inline base64 before the provider call, ensuring compatibility with provider capabilities. [1] [2]
  • Enhanced Google provider integration to fetch external media (images, documents, videos) via HTTP if not provided as a Google Storage URI, improving support for non-Google-hosted media. [1] [2]

API and Usability Improvements:

  • Refactored the main package __init__.py to provide a more comprehensive and user-friendly API surface, including a quick start example, organized imports, and a complete __all__ for easier discovery and usage.

Type Annotations and Documentation:

  • Updated the Message class to use Sequence[ContentBlock] instead of list[ContentBlock] for stricter type contracts, improving type safety and clarity. [1] [2]
  • Removed redundant docstring in add_conditional_edges to reduce duplication and improve maintainability.

Iamsdt added 4 commits April 5, 2026 17:26
…onality

- Introduced tests for MediaResolver with capability-based fallback for OpenAI and Google models.
- Implemented tests for handling unsupported media input errors.
- Added regression tests to ensure existing workflows for file_id and signed URLs remain functional.
- Created tests for TemporaryMediaCache to validate storage, retrieval, and cleanup processes.
- Enhanced tests for converting external URLs to inline bytes for various media types.
- Established a test suite for the integration of media handling in multimodal content.
Comment thread tests/storage/media/test_media_resolver.py Dismissed
@Iamsdt Iamsdt merged commit c513d15 into main Apr 5, 2026
5 of 6 checks passed
@Iamsdt Iamsdt deleted the multimodal_fix branch April 5, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants