Extract Transcript Quotes with LLM Gateway
This guide will demonstrate how to use AssemblyAI’s LLM Gateway to process an audio file and find the best quotes via the chat completions endpoint.
Quickstart
Python
JavaScript
Getting Started
Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for an AssemblyAI account and get your API key from your dashboard.
Step-by-Step Instructions
Step 1: Set up your API key and headers
Python
JavaScript
Step 2: Transcribe the audio file
Next, we’ll use AssemblyAI to transcribe a file and save our transcript for later use. We’ll enable speaker_labels to get utterances grouped by speaker.
Python
JavaScript
Step 3: Extract utterances with timestamps
Then we’ll take the timestamped utterances array from our transcript and format it as structured data. Utterances are grouped by speaker and include continuous speech segments.
Python
JavaScript
Step 4: Use LLM Gateway to extract engaging quotes
Finally, we’ll provide the timestamped utterances to the LLM Gateway chat completions endpoint to extract the most engaging quotes from this transcript with their associated timestamps in a structured JSON format.