Generate Action Items with LeMUR

This tutorial will demonstrate how to use AssemblyAI’s LeMUR (Leveraging Large Language Models to Understand Recognized Speech) framework to create action items from a transcript using the Task endpoint.

Quickstart

1import assemblyai as aai
2
3aai.settings.api_key = "YOUR_API_KEY"
4audio_url = "https://storage.googleapis.com/aai-web-samples/meeting.mp4"
5
6transcript = aai.Transcriber().transcribe(audio_url)
7
8prompt = f"""
9Here are guidelines to follow:
10- You are an expert at understanding transcripts of conversations, calls and meetings.
11- You are an expert at coming up with ideal action items based on the contents of the transcripts.
12- Action items are things that the transcript implies should get done.
13- Your action item ideas do not make stuff up that isn't relevant to the transcript.
14- You do not needlessly make up action items - you stick to important tasks.
15- You are useful, true and concise, and write in perfect English.
16- Your action items can be tied back to direct quotes in the transcript.
17- You do not cite the quotes the action items relate to.
18- The action items are written succinctly.
19- Please give useful action items based on the transcript.
20"""
21
22answer_format = "Bullet Points"
23
24if answer_format:
25 prompt += f"\nYour response should have the following format: {answer_format}"
26
27result = transcript.lemur.task(
28 prompt,
29 final_model=aai.LemurModel.claude3_5_sonnet
30)
31
32response = result.response
33print(response)

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. You will need to upgrade your account by adding a credit card to have access to LeMUR.

Find more details on the current LeMUR pricing in the AssemblyAI pricing page.

Step-by-Step Instructions

In this guide, we will prompt LeMUR to generate action items from our transcript.

First, let’s install the AssemblyAI SDK.

$pip install -U assemblyai

Then we’ll import the SDK and set our AssemblyAI API key.

1import assemblyai as aai
2
3aai.settings.api_key = "API_KEY"

Next, we’ll use AssemblyAI to transcribe a file and save our transcript.

1audio_url = "https://storage.googleapis.com/aai-web-samples/meeting.mp4"
2
3transcript = aai.Transcriber().transcribe(audio_url)

Provide detailed instructions to prompt LeMUR to create action items from the transcript.

1prompt = f"""
2Here are guidelines to follow:
3- You are an expert at understanding transcripts of conversations, calls and meetings.
4- You are an expert at coming up with ideal action items based on the contents of the transcripts.
5- Action items are things that the transcript implies should get done.
6- Your action item ideas do not make stuff up that isn't relevant to the transcript.
7- You do not needlessly make up action items - you stick to important tasks.
8- You are useful, true and concise, and write in perfect English.
9- Your action items can be tied back to direct quotes in the transcript.
10- You do not cite the quotes the action items relate to.
11- The action items are written succinctly.
12- Please give useful action items based on the transcript.
13"""

You can also optionally specify an action items format and append it to the prompt.

1answer_format = "Bullet Points"
2
3if answer_format:
4 prompt += f"\nYour response should have the following format: {answer_format}"

Prompt the LeMUR model using the Task Endpoint and return the response.

1result = transcript.lemur.task(
2 prompt,
3 final_model=aai.LemurModel.claude3_5_sonnet
4)
5
6response = result.response
7print(response)