custom assistant client-side functions @vapi-ai/we...
# support
g
Hello, I'm trying to make a custom assistant call functions in React+Next.js client side. I've seen the [doc here for React](https://github.com/VapiAI/client-example-javascript-react/blob/master/src/assistants/character.assistant.ts) and I can see I have to add a functions object to the model param of the assistant. However the CreateAssistantDTO type doesn't allow a functions key in the model object.
Copy code
js
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?
s
@Gabsplat functions are deprecated instead use tools check this out https://docs.vapi.ai/tools-calling
5 Views