Skip to content

Commit ceca8e7

Browse files
committed
Merge branch 'hotfix/0.2.2'
2 parents 041a9cd + 0419906 commit ceca8e7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## Next
4+
5+
- fix: add support for any `Mapping` with an "audio" key (not just `dict`)
6+
37
## Version 0.2.1 (2025-09-20)
48

59
- fix: fix "missing token" error message

src/pyannoteai/sdk/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import time
2828
import warnings
2929
from pathlib import Path
30-
from typing import Callable, Optional, Union
30+
from typing import Callable, Optional, Union, Mapping
3131

3232
import requests
3333
from requests import Response
@@ -279,7 +279,7 @@ def upload(
279279
or "media://{md5-hash-of-audio-file}" otherwise.
280280
"""
281281

282-
if isinstance(audio, dict):
282+
if isinstance(audio, Mapping):
283283
if "audio" not in audio:
284284
raise ValueError(
285285
"When `audio` is a dict, it must provide the path to the audio file in 'audio' key."

0 commit comments

Comments
 (0)