Skip to content

Commit 15085fa

Browse files
committed
Bringing the PR up to date.
1 parent 1160659 commit 15085fa

File tree

4 files changed

+88
-36
lines changed

4 files changed

+88
-36
lines changed

examples/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
rev-ai==2.19.4
1+
rev-ai==2.19.5
22
pyaudio==0.2.11
33
six==1.12.0

src/rev_ai/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
"""Top-level package for rev_ai"""
33

4-
__version__ = '2.19.4'
4+
__version__ = '2.19.5'
55

66
from .models import Job, JobStatus, Account, Transcript, Monologue, Element, MediaConfig, \
77
CaptionType, CustomVocabulary, TopicExtractionJob, TopicExtractionResult, Topic, Informant, \

src/rev_ai/apiclient.py

+49-26
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,36 @@ def submit_job_url(
123123
:param remove_atmospherics: Atmospherics such as <laugh>, <affirmative>, etc. will not
124124
appear in the transcript.
125125
:param speakers_count: Use to specify the total number of unique speakers in the audio.
126+
:param diarization_type: Use to specify diarization type.
126127
:param summarization_config: Use to request transcript summary.
127128
:param translation_config: Use to request transcript translation.
128-
:param diarization_type: Use to specify diarization type.
129129
:returns: raw response data
130130
:raises: HTTPError
131131
"""
132-
payload = self._create_job_options_payload(media_url, metadata, callback_url,
133-
skip_diarization, skip_punctuation,
134-
speaker_channels_count,
135-
custom_vocabularies, filter_profanity,
136-
remove_disfluencies, delete_after_seconds,
137-
language, custom_vocabulary_id, transcriber,
138-
verbatim, rush, test_mode,
139-
segments_to_transcribe, speaker_names,
140-
source_config, notification_config,
141-
skip_postprocessing,
142-
remove_atmospherics,
143-
speakers_count,
144-
diarization_type,
145-
skip_postprocessing,
132+
payload = self._create_job_options_payload(media_url=media_url,
133+
metadata=metadata,
134+
callback_url=callback_url,
135+
skip_diarization=skip_diarization,
136+
skip_punctuation=skip_punctuation,
137+
speaker_channels_count=speaker_channels_count,
138+
custom_vocabularies=custom_vocabularies,
139+
filter_profanity=filter_profanity,
140+
remove_disfluencies=remove_disfluencies,
141+
delete_after_seconds=delete_after_seconds,
142+
language=language,
143+
custom_vocabulary_id=custom_vocabulary_id,
144+
transcriber=transcriber,
145+
verbatim=verbatim,
146+
rush=rush,
147+
test_mode=test_mode,
148+
segments_to_transcribe=segments_to_transcribe,
149+
speaker_names=speaker_names,
150+
source_config=source_config,
151+
notification_config=notification_config,
152+
skip_postprocessing=skip_postprocessing,
153+
remove_atmospherics=remove_atmospherics,
154+
speakers_count=speakers_count,
155+
diarization_type=diarization_type,
146156
summarization_config=summarization_config,
147157
translation_config=translation_config)
148158

@@ -236,17 +246,30 @@ def submit_job_local_file(
236246
if not filename:
237247
raise ValueError('filename must be provided')
238248

239-
payload = self._create_job_options_payload(None, metadata, callback_url,
240-
skip_diarization, skip_punctuation,
241-
speaker_channels_count,
242-
custom_vocabularies, filter_profanity,
243-
remove_disfluencies, delete_after_seconds,
244-
language, custom_vocabulary_id, transcriber,
245-
verbatim, rush, test_mode,
246-
segments_to_transcribe, speaker_names, None,
247-
notification_config, skip_postprocessing,
248-
remove_atmospherics, speakers_count,
249-
diarization_type,
249+
payload = self._create_job_options_payload(media_url=None,
250+
metadata=metadata,
251+
callback_url=callback_url,
252+
skip_diarization=skip_diarization,
253+
skip_punctuation=skip_punctuation,
254+
speaker_channels_count=speaker_channels_count,
255+
custom_vocabularies=custom_vocabularies,
256+
filter_profanity=filter_profanity,
257+
remove_disfluencies=remove_disfluencies,
258+
delete_after_seconds=delete_after_seconds,
259+
language=language,
260+
custom_vocabulary_id=custom_vocabulary_id,
261+
transcriber=transcriber,
262+
verbatim=verbatim,
263+
rush=rush,
264+
test_mode=test_mode,
265+
segments_to_transcribe=segments_to_transcribe,
266+
speaker_names=speaker_names,
267+
source_config=None,
268+
notification_config=notification_config,
269+
skip_postprocessing=skip_postprocessing,
270+
remove_atmospherics=remove_atmospherics,
271+
speakers_count=speakers_count,
272+
diarization_type=diarization_type,
250273
summarization_config=summarization_config,
251274
translation_config=translation_config)
252275

tests/test_job.py

+37-8
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def test_submit_job_url_with_success(self, mock_session, make_mock_response):
120120
'delete_after_seconds': 0,
121121
'language': LANGUAGE,
122122
'transcriber': TRANSCRIBER,
123-
'skip_postprocessing': True
123+
'skip_postprocessing': True,
124+
'remove_atmospherics': True,
125+
'speakers_count': 123,
126+
'diarization_type': "premium"
124127
}
125128
response = make_mock_response(url=JOB_ID_URL, json_data=data)
126129
mock_session.request.return_value = response
@@ -130,7 +133,12 @@ def test_submit_job_url_with_success(self, mock_session, make_mock_response):
130133
NOTIFICATION_URL, True,
131134
True, 1, CUSTOM_VOCAB, True,
132135
True, 0, LANGUAGE, CUSTOM_VOCAB_ID,
133-
TRANSCRIBER, skip_postprocessing=True)
136+
TRANSCRIBER,
137+
skip_postprocessing=True,
138+
remove_atmospherics=True,
139+
speakers_count=123,
140+
diarization_type="premium"
141+
)
134142

135143
assert res == Job(JOB_ID,
136144
CREATED_ON,
@@ -143,7 +151,11 @@ def test_submit_job_url_with_success(self, mock_session, make_mock_response):
143151
remove_disfluencies=True,
144152
delete_after_seconds=0,
145153
language=LANGUAGE,
146-
transcriber=TRANSCRIBER)
154+
transcriber=TRANSCRIBER,
155+
remove_atmospherics=True,
156+
speakers_count=123,
157+
diarization_type="premium"
158+
)
147159
mock_session.request.assert_called_once_with(
148160
"POST",
149161
JOBS_URL,
@@ -161,7 +173,10 @@ def test_submit_job_url_with_success(self, mock_session, make_mock_response):
161173
'language': LANGUAGE,
162174
'custom_vocabulary_id': CUSTOM_VOCAB_ID,
163175
'transcriber': TRANSCRIBER,
164-
'skip_postprocessing': True
176+
'skip_postprocessing': True,
177+
'remove_atmospherics': True,
178+
'speakers_count': 123,
179+
'diarization_type': "premium"
165180
},
166181
headers=client.default_headers)
167182

@@ -283,7 +298,10 @@ def test_submit_job_local_file_with_success(self, mocker, mock_session, make_moc
283298
'delete_after_seconds': 0,
284299
'language': LANGUAGE,
285300
'transcriber': TRANSCRIBER,
286-
'skip_postprocessing': True
301+
'skip_postprocessing': True,
302+
'remove_atmospherics': True,
303+
'speakers_count': 123,
304+
'diarization_type': "premium"
287305
}
288306
response = make_mock_response(url=JOB_ID_URL, json_data=data)
289307
mock_session.request.return_value = response
@@ -294,7 +312,11 @@ def test_submit_job_local_file_with_success(self, mocker, mock_session, make_moc
294312
NOTIFICATION_URL, True,
295313
True, 1, CUSTOM_VOCAB, True,
296314
True, 0, LANGUAGE, CUSTOM_VOCAB_ID,
297-
TRANSCRIBER, skip_postprocessing=True)
315+
TRANSCRIBER, skip_postprocessing=True,
316+
remove_atmospherics=True,
317+
speakers_count=123,
318+
diarization_type="premium"
319+
)
298320

299321
assert res == Job(JOB_ID,
300322
CREATED_ON,
@@ -308,7 +330,11 @@ def test_submit_job_local_file_with_success(self, mocker, mock_session, make_moc
308330
remove_disfluencies=True,
309331
delete_after_seconds=0,
310332
language=LANGUAGE,
311-
transcriber=TRANSCRIBER)
333+
transcriber=TRANSCRIBER,
334+
remove_atmospherics=True,
335+
speakers_count=123,
336+
diarization_type="premium"
337+
)
312338
mock_session.request.assert_called_once_with(
313339
"POST",
314340
JOBS_URL,
@@ -329,7 +355,10 @@ def test_submit_job_local_file_with_success(self, mocker, mock_session, make_moc
329355
'language': LANGUAGE,
330356
'custom_vocabulary_id': CUSTOM_VOCAB_ID,
331357
'transcriber': TRANSCRIBER,
332-
'skip_postprocessing': True
358+
'skip_postprocessing': True,
359+
'remove_atmospherics': True,
360+
'speakers_count': 123,
361+
'diarization_type': "premium"
333362
}, sort_keys=True)
334363
)
335364
},

0 commit comments

Comments
 (0)