Skip to content

Commit 0325617

Browse files
authored
Merge branch 'develop' into feat/precision-2
2 parents 8f03eff + 1597da3 commit 0325617

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
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+
## Version 0.1.1 (2025-06-04)
4+
5+
- Allow arbitrary kwargs in `diarize`, `identify` and `voiceprint`
6+
37
## Version 0.1.0 (2025-03-14)
48

59
- *Hello world!*

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66
<h1>Official pyannoteAI Python SDK </h1>
77
</div>
88

9-
109
## Installation
1110

1211
```bash
13-
$ pip install pyannoteai.sdk
12+
$ pip install pyannoteai-sdk
1413
```
1514

1615
Then head over to [`dashboard.pyannote.ai`](https://dashboard.pyannote.ai) and create an API key.
1716

18-
## Speaker diarization
17+
## Speaker diarization
1918

2019
```python
2120
# instantiate client

src/pyannoteai/sdk/client.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ def diarize(
331331
turn_level_confidence: bool = False,
332332
exclusive: bool = False,
333333
model: str = "precision-2",
334+
**kwargs,
334335
) -> str:
335336
"""Initiate a diarization job on the pyannoteAI web API
336337
@@ -354,6 +355,8 @@ def diarize(
354355
Defaults to False
355356
exclusive: bool, optional
356357
Defaults to False
358+
**kwargs : optional
359+
Extra arguments to send in the body of the request.
357360
358361
Returns
359362
-------
@@ -375,6 +378,8 @@ def diarize(
375378
"turn_level_confidence": turn_level_confidence,
376379
"exclusive": exclusive,
377380
}
381+
# add extra arguments to the request body
382+
json.update(kwargs)
378383

379384
response = self._authenticated_post("/diarize", json=json)
380385
data = response.json()
@@ -384,6 +389,7 @@ def voiceprint(
384389
self,
385390
media_url: str,
386391
model: str = "precision-2",
392+
**kwargs,
387393
) -> str:
388394
"""Initiate a voiceprint job on the pyannoteAI web API
389395
@@ -394,6 +400,8 @@ def voiceprint(
394400
any other public URL pointing to an audio file.
395401
model : str, optional
396402
Defaults to "precision-2".
403+
**kwargs : optional
404+
Extra arguments to send in the body of the request.
397405
398406
Returns
399407
-------
@@ -406,6 +414,8 @@ def voiceprint(
406414
"""
407415

408416
json = {"url": media_url, "model": model}
417+
# add extra arguments to the request body
418+
json.update(kwargs)
409419

410420
response = self._authenticated_post("/voiceprint", json=json)
411421
data = response.json()
@@ -424,6 +434,7 @@ def identify(
424434
confidence: bool = False,
425435
turn_level_confidence: bool = False,
426436
exclusive: bool = False,
437+
**kwargs,
427438
) -> str:
428439
"""Initiate an identification job on the pyannoteAI web API
429440
@@ -450,6 +461,8 @@ def identify(
450461
Maximum number of speakers. Has no effect when `num_speakers` is provided.
451462
confidence : bool, optional
452463
Defaults to False
464+
**kwargs : optional
465+
Extra arguments to send in the body of the request.
453466
454467
Returns
455468
-------
@@ -479,6 +492,8 @@ def identify(
479492
"threshold": matching_threshold,
480493
},
481494
}
495+
# add extra arguments to the request body
496+
json.update(kwargs)
482497

483498
response = self._authenticated_post("/identify", json=json)
484499
data = response.json()

uv.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)