hey iam trying to build a ai interviewer using vap...
# general-english
c
hey iam trying to build a ai interviewer using vapi but my vapi.start() is giving me a 400 error any idea why const startCall = async () => { if (!interviewInfo || !vapiRef.current) return; try { setLoading(true); const { userName, userEmail, InterviewData } = interviewInfo; const jobPosition = InterviewData?.jobPosition || "the position"; // Format questions safely const questions = InterviewData?.questionList ?.map((q, i) =>
${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:
Copy code
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); } };
3 Views