Implement a Sales Playbook Using LeMUR

This guide will show you how to use AssemblyAI’s LeMUR framework to implement a sales playbook with a call from a sales representative to a client.

This guide aims to show different ways of using the question-answer feature with a hypothetical sales use case to produce personalized, precise responses. Using this feature, a user can immediately evaluate large numbers of sales calls and ensure that prospecting steps are followed, including quotes in the response, which can inform future sales by identifying trends and quantitative performance tracking.

In this example, we will demonstrate how to use request variables such as context, answer_format, and answer_options to make the most of LeMUR’s Question & Answer feature. You can use the concepts in this guide to create custom specifications to evalute your sales representatives.

Quickstart

1import assemblyai as aai
2
3aai.settings.api_key = "YOUR_API_KEY"
4transcriber = aai.Transcriber()
5transcript = transcriber.transcribe("./sales-call.mp3") # You can also provide a URL to a publicly available audio file
6
7context = "There are sales interactions between a salesperson who is selling an internet plan to customers who are warm leads."
8answer_format = """
9 Answer with JSON in the following format:
10 {
11 "Answer: "<answer_options>",
12 "Reason": "<justification for the answer in one sentence including quotes>"
13 }
14 """
15
16answer_options = ["Yes", "No"]
17
18questions = [
19 aai.LemurQuestion(
20 question="Did the salesperson start the conversation with a professional greeting?",
21 context=context,
22 answer_format=answer_format,
23 answer_options=["Poor", "Satisfactory", "Excellent"],
24 ),
25 aai.LemurQuestion(
26 question="How well did the salesperson answer questions during the call?",
27 context=context,
28 answer_format=answer_format,
29 ),
30 aai.LemurQuestion(
31 question="Did the salesperson discuss next steps clearly?",
32 context=context,
33 answer_format=answer_format,
34 answer_options=answer_options,
35 ),
36]
37
38result = transcript.lemur.question(questions, final_model=aai.LemurModel.claude3_5_sonnet)
39
40for qa in result.response:
41 print(qa.question)
42 print(qa.answer)

Get 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.

LeMUR features are currently only available to paid users at two pricing tiers: LeMUR and LeMUR Basic. See the pricing page for more detail.

Step-by-Step Instructions

In this guide, we will ask three questions evaluating the prospecting performance of the sales representative. Each question has slightly different paremeters based on the use case but largely has a fixed context that we will apply to each question.

Import the assemblyai package and set your API key.

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

Use the Transcriber object’s transcribe method and pass in the audio file’s path as a parameter. The transcribe method will save the results of the transcription to the Transcriber object’s transcript attribute.

1transcriber = aai.Transcriber()
2transcript = transcriber.transcribe("./sales-call.mp3")

Define your LeMUR context, answer_format, and answer_options request variables.

1context = "There are sales interactions between a salesperson who is selling an internet plan to customers who are warm leads."
2answer_format = """
3 Answer with JSON in the following format:
4 {
5 "Answer: "<answer_options>",
6 "Reason": "<justification for the answer in one sentence including quotes>"
7 }
8 """
9
10answer_options = ["Yes", "No"]

Next, define your LeMUR request parameters for your sales playbook processes using the Question & Answer feature. Note: You can edit the variables to provide custom answers for each question.

1questions = [
2 aai.LemurQuestion(
3 question="Did the salesperson start the conversation with a professional greeting?",
4 context=context,
5 answer_format=answer_format,
6 answer_options=["Poor", "Satisfactory", "Excellent"],
7 ),
8 aai.LemurQuestion(
9 question="How well did the salesperson answer questions during the call?",
10 context=context,
11 answer_format=answer_format,
12 ),
13 aai.LemurQuestion(
14 question="Did the salesperson discuss next steps clearly?",
15 context=context,
16 answer_format=answer_format,
17 answer_options=answer_options,
18 ),
19]

Run the question method on transcript and print the result to your terminal.

1result = transcript.lemur.question(questions, final_model=aai.LemurModel.claude3_5_sonnet)
2
3for qa in result.response:
4 print(qa.question)
5 print(qa.answer)