Skip to content

Commit 9e5ae41

Browse files
authored
fix: make polling interval configurable through Settings (#17)
1 parent f8da209 commit 9e5ae41

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

assemblyai/transcriber.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def wait_for_completion(self) -> Self:
7777
):
7878
break
7979

80-
time.sleep(3)
80+
time.sleep(self._client.settings.polling_interval)
8181

8282
return self
8383

assemblyai/types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class Settings(BaseSettings):
3737
base_url: str = "https://api.assemblyai.com/v2"
3838
"The base URL for the AssemblyAI API"
3939

40+
polling_interval: float = 1.0
41+
"The default polling interval for long-running requests (e.g. polling the `Transcript`'s status)"
42+
4043
class Config:
4144
env_prefix = "assemblyai_"
4245

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name="assemblyai",
10-
version="0.8.0",
10+
version="0.8.1",
1111
description="AssemblyAI Python SDK",
1212
author="AssemblyAI",
1313
author_email="[email protected]",

0 commit comments

Comments
 (0)