Skip to content

Commit 0277b8d

Browse files
committed
Update readme.md
1 parent 8b5b1c3 commit 0277b8d

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

SDK_v1/readme.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,36 @@ SDK for SlashML documentation:
44
Steps to Integrate
55
1 - (Optional) Upload files where the data points to your audio file
66
```
7+
# call the class
78
speect_to_text = speechtotext.SpeechToText()
8-
file_location="/Users/JJneid/Desktop/SlashMl/s2t_experiments/api_tests/test_audio_1.mp3"
9+
file_location="path/to/your/file.mp3"
910
# when
10-
API_KEY="1bd15e1c161ff6d4db2ea1d661d7468b4fa61ca9"
11+
API_KEY="SLASH_ML_API_KEY"
1112
model_choice="assembly"
12-
result = speect_to_text.upload_audio(file_location,API_KEY, model_choice)
13+
result_upload = speect_to_text.upload_audio(file_location,API_KEY, model_choice)
14+
print(result_upload)
1315
```
1416
Save the upload_url. You can use this url link in the rest of the calls.
1517

16-
2- Submit your audio file for transcription by sendingPOST request tohttps://api.slashml.com/speech-to-text/v1/transcribe/. The body should contain a json object with audio_url which points to an audio file that is publicly available.
18+
2- Submit your audio file for transcription
19+
```
20+
upload_url=upload_url
21+
22+
result_transcribe = speect_to_text.transcribe(upload_url,API_KEY, model_choice)
23+
24+
print(result_transcribe)
25+
```
1726
Save the id in the response object.
1827

19-
3 - Check the status of the transcription by sending a GETrequest tohttps://api.slashml.com/speech-to-text/v1/transcription/
28+
3 - Check the status and get the text result of the transcription
29+
```
30+
job_id= id
31+
result = speect_to_text.status(job_id,API_KEY, model_choice=model_choice)
32+
33+
print(json.loads(result)["text"])
2034
35+
36+
```
2137
Next steps:
2238
- pip install slashml
2339
- add SLASH_API_KEY to sys path

0 commit comments

Comments
 (0)