Create Chapter Summaries Using LLM Gateway
In this guide, we’ll show you how to use AssemblyAI’s LLM Gateway to process an audio file and summarize it into chapters using paragraph data from the transcription.
This guide shows how to use paragraph data from transcriptions to create chapter summaries. You can customize the paragraph grouping and prompts to fit your specific use case for creating structured summaries.
Quickstart
Get Started
Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for an account and get your API key from your dashboard.
Step-by-Step Instructions
Install the required packages:
Set up your API client and transcribe the audio file:
Fetch all paragraphs from the transcript and combine them into groups. We set a step variable that controls how many paragraphs we combine into one overall paragraph to provide LLM Gateway with more context to create better summaries.
We also extract the appropriate start and end timestamps, and save all of our combined paragraphs in string form to send to LLM Gateway in a later step.
Now we’ll use LLM Gateway to process all of our combined_paragraphs and create summaries for each one.
The summary for each paragraph then gets saved to a results array so we can output all of them at the same time.
The output will look similar to the example below.