Skip to content
Closed
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
7 changes: 5 additions & 2 deletions speech-to-text/python/quickstart/example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys

from dotenv import load_dotenv
from elevenlabs import ElevenLabs
from elevenlabs import ElevenLabs, SpeechToTextChunkResponseModel
from elevenlabs.core.api_error import ApiError

load_dotenv()
Expand All @@ -20,7 +20,10 @@ def main():
model_id="scribe_v2"
)

# Print transcript to stdout
if not isinstance(result, SpeechToTextChunkResponseModel):
print("Error: Transcription response did not include text", file=sys.stderr)
sys.exit(1)

print(result.text)

except FileNotFoundError:
Expand Down
Loading