Skip to content

Commit 710d81f

Browse files
s0h3ylmez171
authored andcommitted
fix(python/sdk): fix word_boost for realtime transcriber (#2009)
GitOrigin-RevId: dabd8b26960684bd254dfd54f9702fd24aca2897
1 parent 0c950b0 commit 710d81f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

assemblyai/transcriber.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def connect(
10121012
"sample_rate": self._sample_rate,
10131013
}
10141014
if self._word_boost:
1015-
params["word_boost"] = self._word_boost
1015+
params["word_boost"] = json.dumps(self._word_boost)
10161016

10171017
websocket_base_url = self._client.settings.base_url.replace("https", "wss")
10181018

tests/unit/test_realtime_transcriber.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def mocked_websocket_connect(
5858

5959
assert (
6060
actual_url
61-
== f"wss://api.assemblyai.com/v2/realtime/ws?{urlencode(dict(sample_rate=44100, word_boost=['AssemblyAI']))}"
61+
== f"wss://api.assemblyai.com/v2/realtime/ws?{urlencode(dict(sample_rate=44100, word_boost=json.dumps(['AssemblyAI'])))}"
6262
)
6363
assert actual_additional_headers == {"Authorization": aai.settings.api_key}
6464
assert actual_open_timeout == 15.0

0 commit comments

Comments
 (0)