forked from oconnoob/extract-call-insights
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
35 lines (28 loc) · 1.13 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import assemblyai as aai
# Create a Transcriber object
transcriber = aai.Transcriber()
# Transcribe the audio file
transcript = transcriber.transcribe("https://storage.googleapis.com/aai-web-samples/Custom-Home-Builder.mp3")
# Print the transcribed text
print(f"TRANSCRIPT:\n{transcript.text}\n")
# Define our task
prompt = """
ROLE:
You are a customer service professional. You are very competent and able to extract meaningful insights from transcripts of customer calls that are submitted to you.
CONTEXT:
This is a call from someone who is inquiring at a home building company
INSTRUCTION:
Respond to the following command: "Provide a short summary of the phone call, and list any outstanding action items after the summary. Finally, provide the caller's contact information. Do not include a preamble."
FORMAT:
SUMMARY:
a one or two sentence summary
ACTION ITEMS:
a bulleted list of sufficiently detailed action items
CONTACT INFORMATION:
Name: Last name, first name
Phone number: The caller's phone number
""".strip()
# Get the response
result = transcript.lemur.task(prompt)
# Extract the response text and print
print(result.response.strip())