agentscope
agentscope copied to clipboard
请问大模型输出后,怎么tts呢?
可以不累计返回吗?
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.
@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.