Skip to content

Commit

Permalink
fix: fix multipart/form
Browse files Browse the repository at this point in the history
  • Loading branch information
ymshenyu committed Dec 24, 2024
1 parent 6d711f1 commit 391a80f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/core/tools/provider/builtin/azurespeech/tools/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _invoke(self, user_id: str, tool_parameters: dict[str, Any]) -> list[ToolInv

files: dict = {"audio": audio_binary}
if definition:
files["definition"] = definition
files["definition"] = (None, definition, "application/json")
resp = requests.post(
"https://{}.api.cognitive.microsoft.com/speechtotext/transcriptions:transcribe?api-version={}".format(
self.runtime.credentials.get("azure_speech_region"),
Expand All @@ -39,7 +39,7 @@ def _invoke(self, user_id: str, tool_parameters: dict[str, Any]) -> list[ToolInv
raise Exception(
"""No text detected.
Error: {}
Definition: {}""".format(json.dumps(data), files.get("definition", ""))
Definition: {}""".format(json.dumps(data), definition)
)

return [
Expand Down

0 comments on commit 391a80f

Please sign in to comment.