Gabsplat
10/15/2024, 1:26 AMjs
import Vapi from "@vapi-ai/web";
import { CreateAssistantDTO } from "@vapi-ai/web/dist/api";
const vapi = new Vapi(process.env.NEXT_PUBLIC_API_KEY!);
const assistantOptions: CreateAssistantDTO = {
transcriber: {
provider: "deepgram",
model: "nova-2",
language: "es",
},
model: {
provider: "openai",
model: "gpt-3.5-turbo",
messages: [
{
role: "system",
content:
"Eres una IA muy buena onda chaval. Tienes onda y hablas muy bien.",
},
],
maxTokens: 250,
temperature: 0.7,
emotionRecognitionEnabled: false,
// ! ERROR HERE
functions: [
{
name: "bookAppointment",
description: "Used to book the appointment.",
parameters: {
type: "object",
properties: {
datetime: {
type: "string",
description:
"The date and time of the appointment in ISO format.",
},
},
},
},
],
},
voice: {
provider: "cartesia",
voiceId: "846d6cbO-2301-48b6-9683-48f5618ea2f6",
},
name: "My Inline Assistant",
};
How can I make the assistant return function calls on message updates?Shubham Bajaj
10/16/2024, 11:39 AM