0
Extract action items
One script reply has been approved by the moderators Verified

Use LeMUR to generate a list of action items from a transcript

Created by hugo697 32 days ago Viewed 2781 times
0
Submitted by hugo697 Bun
Verified 32 days ago
1
//native
2
type Assemblyai = {
3
  apiKey: string;
4
};
5
/**
6
 * Extract action items
7
 * Use LeMUR to generate a list of action items from a transcript
8
 */
9
export async function main(
10
  auth: Assemblyai,
11
  body: {
12
    transcript_ids?: string[];
13
    input_text?: string;
14
    context?: string | {};
15
    final_model?: string;
16
    max_output_size?: number;
17
    temperature?: number;
18
  } & { answer_format?: string },
19
) {
20
  const url = new URL(
21
    `https://api.assemblyai.com/lemur/v3/generate/action-items`,
22
  );
23

24
  const response = await fetch(url, {
25
    method: "POST",
26
    headers: {
27
      "Content-Type": "application/json",
28
      Authorization: "Bearer " + auth.apiKey,
29
    },
30
    body: JSON.stringify(body),
31
  });
32
  if (!response.ok) {
33
    const text = await response.text();
34
    throw new Error(`${response.status} ${text}`);
35
  }
36
  return await response.json();
37
}
38