Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REVAI-3855: Update python sdk to support Super API #105

Merged
merged 33 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,8 @@ History
2.18.0
------------------
* Add atmospherics and speaker_count support
* Deprecated support for Python versions up to 3.8
* Deprecated support for Python versions up to 3.8

2.19.0
------------------
* Add async translation and summarization
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@ and `custom_vocabulary_id` as optional parameters.

The url submission option also supports authentication headers by using the `source_config` option.

You can request transcript summary.

```python
# submitting a human transcription jobs
job = client.submit_job_url("https://example.com/file-to-transcribe.mp3",
language='en',
summarization_config=SummarizationOptions(
formatting_type=SummarizationFormattingOptions.BULLETS
))
```

You can request transcript translation into up to five languages.

```javascript
job = client.submit_job_url("https://example.com/file-to-transcribe.mp3",
language='en',
translation_config=TranslationOptions(
target_languages: [
TranslationLanguageOptions("es", NlpModel.PREMIUM),
TranslationLanguageOptions("de")
]
));
```

All options are described in the request body of the
[Submit Job](https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob) endpoint.

Expand Down Expand Up @@ -131,20 +155,42 @@ transcript_json = client.get_transcript_json(job.id)

# or as a python object
transcript_object = client.get_transcript_object(job.id)

# or if you requested transcript translation(s)
transcript_object = client.get_translated_transcript_object(job.id,'es')
```

Both the json and object forms contain all the formation outlined in the response
of the [Get Transcript](https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById) endpoint
when using the json response schema. While the text output is a string containing
just the text of your transcript

### Getting transcript summary

If you requested transcript summary, you can retrieve it as plain text or structured object:

```python
# as text
summary = client.get_transcript_summary_text(job.id)

# as json
summary = client.get_transcript_summary_json(job.id)

# or as a python object
summary = client.get_transcript_summary_object(job.id)

```
### Getting captions output

You can also get captions output from the SDK. We offer both SRT and VTT caption formats.
If you submitted your job as speaker channel audio then you must also provide a `channel_id` to be captioned:

```python
captions = client.get_captions(job.id, content_type=CaptionType.SRT, channel_id=None)

# or if you requested transcript translation(s)
captions = client.get_translated_captions(job.id, 'es')

```

### Streamed outputs
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.18.0
current_version = 2.19.0
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion src/rev_ai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Top-level package for rev_ai"""

__version__ = '2.18.0'
__version__ = '2.19.0'

from .models import Job, JobStatus, Account, Transcript, Monologue, Element, MediaConfig, \
CaptionType, CustomVocabulary, TopicExtractionJob, TopicExtractionResult, Topic, Informant, \
Expand Down
Loading
Loading