Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assemblyai/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.63.0"
__version__ = "0.63.1"
6 changes: 1 addition & 5 deletions assemblyai/streaming/v3/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,7 @@ def _parse_error(
code=error.error_code,
)
elif isinstance(error, websockets.exceptions.ConnectionClosed):
if (
error.code >= 4000
and error.code <= 4999
and error.code in StreamingErrorCodes
):
if error.code in StreamingErrorCodes:
error_message = StreamingErrorCodes[error.code]
else:
error_message = error.reason
Expand Down
5 changes: 5 additions & 0 deletions assemblyai/streaming/v3/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ def __init__(self, message: str, code: Optional[int] = None):


StreamingErrorCodes = {
3005: "Server error",
3006: "Input validation error",
3007: "Audio chunk duration violation",
3008: "Session expired: maximum session duration exceeded",
3009: "Too many concurrent sessions",
4000: "Sample rate must be a positive integer",
4001: "Not Authorized",
4002: "Insufficient Funds",
Expand Down
Loading