@@ -328,6 +328,7 @@ def diarize(
328
328
min_speakers : Optional [int ] = None ,
329
329
max_speakers : Optional [int ] = None ,
330
330
confidence : bool = False ,
331
+ ** kwargs ,
331
332
) -> str :
332
333
"""Initiate a diarization job on the pyannoteAI web API
333
334
@@ -345,6 +346,8 @@ def diarize(
345
346
Not supported yet. Maximum number of speakers. Has no effect when `num_speakers` is provided.
346
347
confidence : bool, optional
347
348
Defaults to False
349
+ **kwargs : optional
350
+ Extra arguments to send in the body of the request.
348
351
349
352
Returns
350
353
-------
@@ -360,6 +363,8 @@ def diarize(
360
363
assert max_speakers is None , "`max_speakers` is not supported yet"
361
364
362
365
json = {"url" : media_url , "numSpeakers" : num_speakers , "confidence" : confidence }
366
+ # add extra arguments to the request body
367
+ json .update (kwargs )
363
368
364
369
response = self ._authenticated_post ("/diarize" , json = json )
365
370
data = response .json ()
@@ -368,6 +373,7 @@ def diarize(
368
373
def voiceprint (
369
374
self ,
370
375
media_url : str ,
376
+ ** kwargs ,
371
377
) -> str :
372
378
"""Initiate a voiceprint job on the pyannoteAI web API
373
379
@@ -376,6 +382,8 @@ def voiceprint(
376
382
media_url : str
377
383
media://{...} URL created with the `upload` method or
378
384
any other public URL pointing to an audio file.
385
+ **kwargs : optional
386
+ Extra arguments to send in the body of the request.
379
387
380
388
Returns
381
389
-------
@@ -388,6 +396,8 @@ def voiceprint(
388
396
"""
389
397
390
398
json = {"url" : media_url }
399
+ # add extra arguments to the request body
400
+ json .update (kwargs )
391
401
392
402
response = self ._authenticated_post ("/voiceprint" , json = json )
393
403
data = response .json ()
@@ -403,6 +413,7 @@ def identify(
403
413
min_speakers : Optional [int ] = None ,
404
414
max_speakers : Optional [int ] = None ,
405
415
confidence : bool = False ,
416
+ ** kwargs ,
406
417
) -> str :
407
418
"""Initiate an identification job on the pyannoteAI web API
408
419
@@ -427,6 +438,8 @@ def identify(
427
438
Not supported yet. Maximum number of speakers. Has no effect when `num_speakers` is provided.
428
439
confidence : bool, optional
429
440
Defaults to False
441
+ **kwargs : optional
442
+ Extra arguments to send in the body of the request.
430
443
431
444
Returns
432
445
-------
@@ -454,6 +467,8 @@ def identify(
454
467
"threshold" : matching_threshold ,
455
468
},
456
469
}
470
+ # add extra arguments to the request body
471
+ json .update (kwargs )
457
472
458
473
response = self ._authenticated_post ("/identify" , json = json )
459
474
data = response .json ()
0 commit comments