Skip to content
Merged
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
8 changes: 8 additions & 0 deletions dashscope/legacy_1x/audio/tts/speech_synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ def call( # pylint: disable=R1702,too-many-branches # type: ignore[override] #
part,
)
else:
if (
not isinstance(part.output, dict)
or "sentence" not in part.output
):
# Non-timestamp message (e.g. extra messages returned
# in the SSML/bgm scenario). Skip it safely instead of
# raising KeyError on part.output["sentence"].
continue
if _callback is not None:
sentence = SpeechSynthesisResult(
None, # type: ignore[arg-type]
Expand Down
Loading