Implement Retry Server Error Logic
In this guide, we’ll show you how to setup automatic server error retry logic in your transcription process.
Server errors indicate a server-side issue during the transcription process. These rarely happen, but can occasionally occur on our side. If a transcription fails due to a server error, we recommend that you resubmit the file for transcription to allow another server to process the audio. If the issue persists, please reach out to our support team: support@assemblyai.com
This workflow is designed to automatically retry these transcripts if a server error is encountered.
If your transcription fails due to a server error on our side, we will automatically retry the request up to three times. You can find this option in your Account Settings.
Quickstart
Get started
Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for a free account and get your API key from your dashboard.
Step-by-step instructions
Install the SDK:
Import the assemblyai
and time
package and set your API key:
Create a function that handles errors that may occur during the transcription process. The default number of retires is 1. The default wait time before retranscribing is 5 seconds.
Define the audio file that you want to transcribe.
Create a Transcriber
object and specify features in TranscriptionConfig
.
Call the function to handle transcription with error handling. Specify number of retries and wait time. Return the transcribed text if transcription is successful.