Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dashscope/audio/qwen_tts_realtime/qwen_tts_realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def update_session(
bit_rate: int = None,
language_type: str = None,
enable_tn: bool = None,
instructions: str = None,
optimize_instructions: str = None,
**kwargs,
) -> None:
"""
Expand Down Expand Up @@ -206,6 +208,10 @@ def update_session(
bit_rate for tts, support 6~510,default is 128kbps. only work on format: opus/mp3 # noqa: E501 # pylint: disable=line-too-long
enable_tn: bool
enable text normalization for tts, default is None
instructions: str
instructions for tts, default is None
optimize_instructions: str
optimize_instructions for tts, default is None
Comment on lines +211 to +214

Choose a reason for hiding this comment

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

medium

The current descriptions for instructions and optimize_instructions are very brief. To help users understand and use these new parameters effectively, please expand the docstrings to include:

  • A clear explanation of what each parameter does.
  • The expected format or some examples of valid values.
  • The distinction between instructions and optimize_instructions.

Clear documentation is essential for API usability.

"""
self.config = {
"voice": voice,
Expand All @@ -230,6 +236,10 @@ def update_session(

if language_type is not None:
self.config["language_type"] = language_type
if instructions is not None:
self.config["instructions"] = instructions
if optimize_instructions is not None:
self.config["optimize_instructions"] = optimize_instructions
self.config.update(kwargs)
self.__send_str(
json.dumps(
Expand Down