feat (engine): Support video block conversion in AgentScope#417
feat (engine): Support video block conversion in AgentScope#417rayrayraykk merged 2 commits intoagentscope-ai:mainfrom
Conversation
Summary of ChangesHello @rayrayraykk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the AgentScope framework by integrating robust support for video content. It achieves this by refactoring the core message conversion mechanisms, specifically removing an outdated function, and then extending both the static message conversion and streaming adaptation processes to correctly handle video blocks. This upgrade expands the system's multimedia capabilities, allowing for richer and more diverse interactions within the AgentScope ecosystem. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for video block conversion in AgentScope's message handling adapters. The changes enable the runtime to process video content similar to how it handles images and audio.
Changes:
- Added
VideoContentimport and video block handling in the streaming adapter - Enabled video block support in the message-to-AgentScope converter
- Removed the entire test file
test_agentscope_message_converter.py(287 lines) - Removed unused imports (
FunctionCall,FunctionCallOutput,ResponseBuilder) - Removed the unused
agentscope_msg_to_messagefunction (258 lines)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/unit/test_agentscope_message_converter.py | Entire test file deleted, removing all test coverage for message conversion |
| src/agentscope_runtime/adapters/agentscope/stream.py | Added VideoContent import and video block handling for both URL and base64 sources in streaming adapter |
| src/agentscope_runtime/adapters/agentscope/message.py | Removed unused imports and function; added video block support (URL-only) in message_to_agentscope_msg converter |
There was a problem hiding this comment.
Code Review
This pull request adds support for video block conversion, which is a great addition. However, it also includes a significant refactoring by removing the agentscope_msg_to_message function and integrating its logic into the adapt_agentscope_message_stream function. This makes an already complex function even more complex.
My main concern is the removal of the entire test file tests/unit/test_agentscope_message_converter.py. This leaves the new video conversion functionality in message_to_agentscope_msg and the refactored streaming logic without dedicated unit tests. The PR checklist also indicates that tests have not been passed locally. It's critical to add tests to cover these changes to ensure correctness and prevent future regressions. Without tests, this PR is not ready to be merged.
I've found one bug in the new video handling logic in the streaming adapter, which I've commented on.
Description
Support video block conversion in AgentScope
Type of Change
Component(s) Affected
Checklist
Testing
[How to test these changes]
Additional Notes
[Optional: any other context]