Skip to content

fix:audio block type check#434

Merged
rayrayraykk merged 1 commit intoagentscope-ai:mainfrom
Shun-Chu:feature/fix-audio-type-check
Feb 5, 2026
Merged

fix:audio block type check#434
rayrayraykk merged 1 commit intoagentscope-ai:mainfrom
Shun-Chu:feature/fix-audio-type-check

Conversation

@Shun-Chu
Copy link
Copy Markdown
Contributor

@Shun-Chu Shun-Chu commented Feb 4, 2026

Summary

  • Fix audio block type detection so type=audio is handled correctly.
  • Prevent audio content from being misrouted to TextContent.

Changes

  • [stream.py](app://-/index.html#): use element.get("type") == "audio".

Testing

  • Not run (not requested).

@Shun-Chu Shun-Chu requested a review from a team February 4, 2026 03:56
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @chu0623, 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 resolves an issue where audio content blocks were not being correctly identified within the streaming process. The fix involves updating the attribute used for detecting audio elements from 'text' to 'type', ensuring that multimedia content is properly recognized and routed, thereby preventing misclassification and incorrect handling.

Highlights

  • Audio Block Type Detection: Corrected the logic for detecting audio blocks by checking the 'type' attribute instead of the 'text' attribute in the 'element' object.
  • Content Routing Prevention: Ensures that audio content is correctly identified, preventing it from being mistakenly processed as text content.
Changelog
  • src/agentscope_runtime/adapters/agentscope/stream.py
    • Modified the condition for identifying audio elements from 'element.get("text") == "audio"' to 'element.get("type") == "audio"' on line 521.
Activity
  • The pull request was created by chu0623.
  • No specific review comments or discussions have been recorded yet.
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.

@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Feb 4, 2026

CLA assistant check
All committers have signed the CLA.

@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Feb 4, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


css seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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 addresses a bug in audio block type detection. The change correctly modifies the condition to check element.get("type") == "audio" instead of element.get("text") == "audio", which aligns the logic with how other media types like images and videos are handled. This ensures that audio content is properly processed and not mistakenly treated as text. The fix is straightforward and correct.

@Shun-Chu Shun-Chu force-pushed the feature/fix-audio-type-check branch from 40a7fd4 to f8cc5a8 Compare February 4, 2026 04:20
@rayrayraykk
Copy link
Copy Markdown
Member

Thanks for your contributions to agentscope!

@rayrayraykk rayrayraykk merged commit 1470b5b into agentscope-ai:main Feb 5, 2026
7 checks passed
@rayrayraykk
Copy link
Copy Markdown
Member

@all-contributors please add @Shun-Chu for bug

@allcontributors
Copy link
Copy Markdown
Contributor

@rayrayraykk

I've put up a pull request to add @Shun-Chu! 🎉

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