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 ChatClient.audio_to_text files keyword to make it work (#26317)

Timo0e4f19eee013
diff --git a/sdks/python-client/dify_client/client.py b/sdks/python-client/dify_client/client.py
index 791cb98a1bf..201391eae95 100644
--- a/sdks/python-client/dify_client/client.py
+++ b/sdks/python-client/dify_client/client.py
@@ -139,9 +139,9 @@ class ChatClient(DifyClient):
data = {"user": user}
return self._send_request("DELETE", f"/conversations/{conversation_id}", data)
- def audio_to_text(self, audio_file: dict, user: str):
+ def audio_to_text(self, audio_file: IO[bytes] | tuple, user: str):
data = {"user": user}
- files = {"audio_file": audio_file}
+ files = {"file": audio_file}
return self._send_request_with_files("POST", "/audio-to-text", data, files)