ck_vivek
06/17/2025, 9:22 PM${i + 1}. ${q.question})
.join('\n') || "No questions available";
await vapiRef.current.start({
assistantId: process.env.NEXT_PUBLIC_VAPI_ASSISSTANT_ID,
assistant: {
variableValues: {
userName,
jobPosition
}
},
model: {
provider: "openai",
model: "gpt-4-turbo",
systemPrompt: You're conducting a ${jobPosition} interview. Ask these questions one by one:
${questions}
Guidelines:
1. Keep responses under 20 seconds
2. Provide brief feedback after each answer
3. End after all questions are answered
},
voice: {
provider: "11labs",
voiceId: "pNInz6obpgDQGcFmaJgB"
},
firstMessage: Hi ${userName}! Ready for your ${jobPosition} interview? Let's begin.,
endCallFunction: "interviewCompleted"
});
console.log("h");
setCallActive(true);
} catch (err) {
console.error("Call start failed:", err);
toast.error("Failed to start interview");
} finally {
setLoading(false);
}
};