Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: fal ai wizper also return text msg (#10789)

Kalo Chin305fbc7c923b
diff --git a/api/core/tools/provider/builtin/fal/tools/wizper.py b/api/core/tools/provider/builtin/fal/tools/wizper.py
index 67a5e451189..ba05a620733 100644
--- a/api/core/tools/provider/builtin/fal/tools/wizper.py
+++ b/api/core/tools/provider/builtin/fal/tools/wizper.py
@@ -19,7 +19,7 @@ class WizperTool(BuiltinTool):
version = tool_parameters.get("version", "3")
if audio_file.type != FileType.AUDIO:
- return [self.create_text_message("Not a valid audio file.")]
+ return self.create_text_message("Not a valid audio file.")
api_key = self.runtime.credentials["fal_api_key"]
@@ -31,9 +31,8 @@ class WizperTool(BuiltinTool):
try:
audio_url = fal_client.upload(file_data, mime_type)
-
except Exception as e:
- return [self.create_text_message(f"Error uploading audio file: {str(e)}")]
+ return self.create_text_message(f"Error uploading audio file: {str(e)}")
arguments = {
"audio_url": audio_url,
@@ -49,4 +48,9 @@ class WizperTool(BuiltinTool):
with_logs=False,
)
- return self.create_json_message(result)
+ json_message = self.create_json_message(result)
+
+ text = result.get("text", "")
+ text_message = self.create_text_message(text)
+
+ return [json_message, text_message]