fix: stt node error

This commit is contained in:
wxg0103 2025-02-05 17:58:47 +08:00
parent 8be91b128f
commit 1a4c1b26ea

View File

@ -61,9 +61,11 @@ class AliyunBaiLianSpeechToText(MaxKBBaseModel, BaseSpeechToText):
result = recognition.call(temp_file_path)
text = ''
if result.status_code == 200:
for sentence in result.get_sentence():
text += sentence['text']
return text
result_sentence = result.get_sentence()
if result_sentence is not None:
for sentence in result_sentence:
text += sentence['text']
return text
else:
raise Exception('Error: ', result.message)
finally: