Create custom LLM prompts

Learn about different use cases for LeMUR with these examples.

If you want a Quickstart, see Apply LLMs to audio files.

Before you start

To use LeMUR, you need an AssemblyAI account with a credit card set up.

Custom prompt example

If you want to send a custom prompt to the LLM, you can use the LeMUR Task and apply the model to your transcribed audio files.

1import assemblyai as aai
2
3aai.settings.api_key = "<YOUR_API_KEY>"
4
5# Step 1: Transcribe an audio file.
6# audio_file = "./local_file.mp4"
7audio_file = "https://assembly.ai/call.mp4"
8
9transcriber = aai.Transcriber()
10transcript = transcriber.transcribe(audio_file)
11
12# Step 2: Define your prompt.
13prompt = "What was the emotional sentiment of the phone call?"
14
15# Step 3: Apply LeMUR.
16result = transcript.lemur.task(
17 prompt, final_model=aai.LemurModel.claude3_5_sonnet
18)
19
20print(result.response)

Ideas to get you started

Use caseExample prompt
Question & Answer”Identify any patterns or trends based on the transcript”
Quote or Citation”List the timestamp X topic was discussed, provide specific citations”
Closed-ended questions”Did the customer express a positive sentiment in the phone call?”
Sentiment analysis”What was the emotional sentiment of the phone call?”
Summaries”Summarize key decisions and important points from the phone call transcript”
Summarize audio segments”Summarize the key events of each chapter”
Generate titles and descriptions”Generate an attention-grabbing YouTube title based on the video transcript”
Generate tags”Generate keywords that can be used to describe the key themes of the conversation”
Action items”What action items were assigned to each participant?”
Generate content”Generate a blog post with key information presented in bullet points from the transcript”
Paraphrasing”Rephrase X segment from the transcript in a different way”

You can find more ideas and code examples in the AssemblyAI Cookbook repo on Github.

Built with