Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions src/rev_ai/apiclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def submit_job_url(
skip_postprocessing=False,
remove_atmospherics=False,
speakers_count=None,
diarization_type=None,
summarization_config: SummarizationOptions = None,
translation_config: TranslationOptions = None):
"""Submit media given a URL for transcription.
Expand Down Expand Up @@ -124,6 +125,7 @@ def submit_job_url(
:param speakers_count: Use to specify the total number of unique speakers in the audio.
:param summarization_config: Use to request transcript summary.
:param translation_config: Use to request transcript translation.
:param diarization_type: Use to specify diarization type.
:returns: raw response data
:raises: HTTPError
"""
Expand All @@ -137,6 +139,10 @@ def submit_job_url(
segments_to_transcribe, speaker_names,
source_config, notification_config,
skip_postprocessing,
remove_atmospherics,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that they were declared on the prototype but were not actually submitted....

speakers_count,
diarization_type,
skip_postprocessing,
summarization_config=summarization_config,
translation_config=translation_config)

Expand Down Expand Up @@ -172,6 +178,7 @@ def submit_job_local_file(
skip_postprocessing=False,
remove_atmospherics=False,
speakers_count=None,
diarization_type=None,
summarization_config: SummarizationOptions = None,
translation_config: TranslationOptions = None):
"""Submit a local file for transcription.
Expand Down Expand Up @@ -220,6 +227,7 @@ def submit_job_local_file(
:param remove_atmospherics: Atmospherics such as <laugh>, <affirmative>, etc. will not
appear in the transcript.
:param speakers_count: Use to specify the total number of unique speakers in the audio.
:param diarization_type: Use to specify diarization type.
:param summarization_config: Use to request transcript summary.
:param translation_config: Use to request transcript translation.
:returns: raw response data
Expand All @@ -237,6 +245,8 @@ def submit_job_local_file(
verbatim, rush, test_mode,
segments_to_transcribe, speaker_names, None,
notification_config, skip_postprocessing,
remove_atmospherics, speakers_count,
diarization_type,
summarization_config=summarization_config,
translation_config=translation_config)

Expand Down Expand Up @@ -714,6 +724,7 @@ def _create_job_options_payload(
skip_postprocessing=False,
remove_atmospherics=None,
speakers_count=None,
diarization_type=None,
summarization_config: SummarizationOptions = None,
translation_config: TranslationOptions = None):
payload = {}
Expand Down Expand Up @@ -764,6 +775,8 @@ def _create_job_options_payload(
payload['remove_atmospherics'] = remove_atmospherics
if speakers_count:
payload['speakers_count'] = speakers_count
if diarization_type:
payload['diarization_type'] = diarization_type
if summarization_config:
payload['summarization_config'] = summarization_config.to_dict()
if translation_config:
Expand Down
4 changes: 4 additions & 0 deletions src/rev_ai/models/asynchronous/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(
segments_to_transcribe=None,
remove_atmospherics=None,
speakers_count=None,
diarization_type=None,
summarization: Summarization = None,
translation: Translation = None):
"""
Expand Down Expand Up @@ -62,6 +63,7 @@ def __init__(
:param remove_atmospherics: Atmospherics such as <laugh>, <affirmative>, etc. will noT
appear in the transcript.
:param speakers_count: Use to specify the total number of unique speakers in the audio.
:param diarization_type: Use to specify diarization type.
"""
self.id = id_
self.created_on = created_on
Expand All @@ -88,6 +90,7 @@ def __init__(
self.segments_to_transcribe = segments_to_transcribe
self.remove_atmospherics = remove_atmospherics
self.speakers_count = speakers_count
self.diarization_type = diarization_type
self.summarization = summarization
self.translation = translation

Expand Down Expand Up @@ -126,6 +129,7 @@ def from_json(cls, json):
segments_to_transcribe=json.get('segments_to_transcribe'),
remove_atmospherics=json.get('remove_atmospherics'),
speakers_count=json.get('speakers_count'),
diarization_type=json.get('diarization_type'),
summarization=Summarization.from_json(json.get('summarization')),
translation=Translation.from_json(json.get('translation'))
)