From a14f06562c23594d52c8c48e8c1e7eefaa58cb6b Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 26 Dec 2024 18:23:09 +0800 Subject: [PATCH] fix: tts node add a prompt with empty text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1050887 --user=王孝刚 【应用编排】知识库检索节点为空,走到文本转语音节点会报错 https://www.tapd.cn/57709429/s/1637596 --- apps/common/util/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/common/util/common.py b/apps/common/util/common.py index bd5e74b22e5..0c1eeec5d42 100644 --- a/apps/common/util/common.py +++ b/apps/common/util/common.py @@ -214,6 +214,8 @@ def split_and_transcribe(file_path, model, max_segment_length_ms=59000, audio_fo def _remove_empty_lines(text): + if not text: + raise AppApiException(500, '文本转语音节点,文本内容不能为空') result = '\n'.join(line for line in text.split('\n') if line.strip()) return markdown_to_plain_text(result)