agentscope icon indicating copy to clipboard operation
agentscope copied to clipboard

请问大模型输出后,怎么tts呢?

Open zhaojiangbing opened this issue 2 months ago • 2 comments

Image

可以不累计返回吗?

zhaojiangbing avatar Nov 11 '25 12:11 zhaojiangbing

You can use pre_print_hook to call TTS. As for accumulation, you can use a prefix to truncate and get incremental content. Please refer to the implementation of the print function for details.

qbc2016 avatar Nov 12 '25 03:11 qbc2016

@zhaojiangbing The pre_print hook function takes a bool argument last as input, indicating if the current message is the last accumulated chunk in a streaming message. You can use tts model when last is True, and ignore the other messages.

DavdGao avatar Nov 14 '25 02:11 DavdGao