Skip to content

feat (engine): Support video block conversion in AgentScope#417

Merged
rayrayraykk merged 2 commits intoagentscope-ai:mainfrom
rayrayraykk:dev/0123/video
Jan 26, 2026
Merged

feat (engine): Support video block conversion in AgentScope#417
rayrayraykk merged 2 commits intoagentscope-ai:mainfrom
rayrayraykk:dev/0123/video

Conversation

@rayrayraykk
Copy link
Copy Markdown
Member

Description

Support video block conversion in AgentScope

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Engine
  • Sandbox
  • Tools
  • Common
  • Documentation
  • Tests
  • CI/CD

Checklist

  • Pre-commit hooks pass
  • Tests pass locally
  • Documentation updated (if needed)
  • Ready for review

Testing

[How to test these changes]

Additional Notes

[Optional: any other context]

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @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

  • Video Block Support: Introduced comprehensive support for video blocks within AgentScope messages, enabling the system to process and represent video content.
  • Message Conversion Refactoring: The agentscope_msg_to_message function and its related imports (FunctionCall, FunctionCallOutput, ResponseBuilder) have been removed from message.py, streamlining the message conversion logic.
  • Streaming Adaptation for Video: Implemented streaming adaptation for video content in stream.py, allowing video data from both URL and Base64 sources to be handled during message streaming.
  • Test File Removal: The test_agentscope_message_converter.py file has been removed, likely due to the refactoring and removal of the agentscope_msg_to_message function it was designed to test.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 VideoContent import 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_message function (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

Comment thread src/agentscope_runtime/adapters/agentscope/stream.py Outdated
Comment thread src/agentscope_runtime/adapters/agentscope/message.py Outdated
Comment thread src/agentscope_runtime/adapters/agentscope/stream.py
Comment thread src/agentscope_runtime/adapters/agentscope/message.py Outdated
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/agentscope_runtime/adapters/agentscope/stream.py Outdated
@rayrayraykk rayrayraykk merged commit caaed3b into agentscope-ai:main Jan 26, 2026
7 checks passed
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.

3 participants