Skip to main content

Multi-speaker analysis recipe

Generate one report per speaker while reusing the same uploaded media.

import { Conduit } from "@mappa-ai/conduit"

const conduitClient = new Conduit({ apiKey: process.env.CONDUIT_API_KEY! })

const media = await conduitClient.primitives.media.upload({ path: "./interview.mp4" })

const [candidateReceipt, interviewerReceipt] = await Promise.all([
conduitClient.reports.create({
source: { mediaId: media.mediaId },
output: { template: "general_report" },
target: {
strategy: "magic_hint",
hint: "the job candidate being interviewed",
onMiss: "fallback_dominant",
},
}),
conduitClient.reports.create({
source: { mediaId: media.mediaId },
output: { template: "general_report" },
target: {
strategy: "magic_hint",
hint: "the interviewer asking questions",
onMiss: "fallback_dominant",
},
}),
])

const [candidate, interviewer] = await Promise.all([
candidateReceipt.handle?.wait(),
interviewerReceipt.handle?.wait(),
])

console.info(candidate?.id, interviewer?.id)