Merged
Conversation
8 tasks
DavdGao
reviewed
Dec 4, 2025
Member
DavdGao
left a comment
There was a problem hiding this comment.
- Please test more model and voice combinations, e.g. the combination of RealtimeTTSModel * qwen3-tts-flash-realtime * Serena doesn't work at all.
- When we ask the agent to generate a long response (e.g. 背诵长恨歌), the realtime API will be blocked for unknown reason in the example.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements comprehensive Text-to-Speech (TTS) functionality for AgentScope, introducing a unified interface for multiple TTS API providers including OpenAI, Gemini, and DashScope. The implementation supports both realtime (streaming input) and non-realtime TTS models, with seamless integration into the ReActAgent class.
Key Changes:
- Added TTS base class and model implementations for 4 different TTS APIs with streaming support
- Integrated TTS capability into ReActAgent with automatic speech synthesis
- Extended the Message class with a
speechfield for audio content
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 24 comments.
Show a summary per file
| File | Description |
|---|---|
src/agentscope/tts/_tts_base.py |
Base class defining the TTS model interface with support for both realtime and non-realtime models |
src/agentscope/tts/_tts_response.py |
Data structures for TTS responses and usage tracking |
src/agentscope/tts/_openai_tts_model.py |
OpenAI TTS implementation with streaming output support |
src/agentscope/tts/_gemini_tts_model.py |
Gemini TTS implementation with streaming output support |
src/agentscope/tts/_dashscope_tts_model.py |
DashScope non-realtime TTS implementation |
src/agentscope/tts/_dashscope_realtime_tts_model.py |
DashScope realtime TTS with streaming input and output support |
src/agentscope/tts/__init__.py |
TTS module exports and public API |
src/agentscope/agent/_react_agent.py |
Integration of TTS into ReActAgent for automatic speech synthesis |
src/agentscope/agent/_agent_base.py |
Updated agent base to handle audio playback from speech field |
src/agentscope/agent/_utils.py |
Added async null context manager utility for optional TTS |
src/agentscope/message/_message_base.py |
Added speech field to Message class and updated get_text_content method |
src/agentscope/hooks/_studio_hooks.py |
Updated hook field names for studio integration |
tests/tts_openai_test.py |
Comprehensive unit tests for OpenAI TTS model |
tests/tts_gemini_test.py |
Comprehensive unit tests for Gemini TTS model |
tests/tts_dashscope_test.py |
Comprehensive unit tests for both DashScope TTS models |
examples/functionality/tts/main.py |
Example demonstrating TTS integration with ReActAgent |
examples/functionality/tts/README.md |
Documentation for the TTS example |
docs/tutorial/en/src/task_tts.py |
English tutorial for using TTS in AgentScope |
docs/tutorial/zh_CN/src/task_tts.py |
Chinese tutorial for using TTS in AgentScope |
docs/tutorial/en/index.rst |
Updated English documentation index |
docs/tutorial/zh_CN/index.rst |
Updated Chinese documentation index |
README.md |
Added TTS feature announcement |
README_zh.md |
Added TTS feature announcement in Chinese |
# Conflicts: # src/agentscope/pipeline/_functional.py
DavdGao
approved these changes
Dec 7, 2025
rayrayraykk
pushed a commit
to rayrayraykk/AgentScope
that referenced
this pull request
Dec 22, 2025
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.
AgentScope Version
1.0.9dev
Description
As the title says.
Checklist
Please check the following items before code is ready to be reviewed.
pre-commit run --all-filescommand