Multilingual support squad

Use language‑specific assistants with selection and seamless context handoff

Overview

Provide structured multilingual support using a Squad: present a short language selection, then route to dedicated EN/ES/FR assistants with tuned prompts and voices.

Squad Capabilities:

  • Explicit language choice for clarity
  • Language‑specific prompts and voices
  • Seamless transfers while preserving context

1. Define members

Example squad payload
1{
2 "members": [
3 { "assistant": { "name": "English Support", "model": {"provider": "openai", "model": "gpt-4o", "messages": [{"role": "system", "content": "English support. Direct, friendly, professional."}] }, "voice": {"provider": "azure", "voiceId": "en-US-AriaNeural"}, "firstMessage": "Hello! How can I help you today?", "firstMessageMode": "assistant-speaks-first" } },
4 { "assistant": { "name": "Soporte Español", "model": {"provider": "openai", "model": "gpt-4o", "messages": [{"role": "system", "content": "Soporte en español. Cálido y respetuoso; usa 'usted' inicialmente."}] }, "voice": {"provider": "azure", "voiceId": "es-ES-ElviraNeural"} } },
5 { "assistant": { "name": "Support Français", "model": {"provider": "openai", "model": "gpt-4o", "messages": [{"role": "system", "content": "Support français. Poli, courtois et formel."}] }, "voice": {"provider": "azure", "voiceId": "fr-FR-DeniseNeural"} } }
6 ]
7}

2. Entrance flow

Start with a brief selection (EN/ES/FR). Route to the matching assistant. Optionally auto‑detect and confirm.

3. Implement

1import { VapiClient } from "@vapi-ai/server-sdk";
2const vapi = new VapiClient({ token: process.env.VAPI_API_KEY! });
3
4await vapi.calls.create({
5 transport: { type: "web" },
6 squad: {
7 members: [
8 { assistant: { name: "English Support", model: { provider: "openai", model: "gpt-4o", messages: [{ role: "system", content: "English support. Direct, friendly, professional." }] }, voice: { provider: "azure", voiceId: "en-US-AriaNeural" }, firstMessage: "Hello! How can I help you today?", firstMessageMode: "assistant-speaks-first" } },
9 { assistant: { name: "Soporte Español", model: { provider: "openai", model: "gpt-4o", messages: [{ role: "system", content: "Soporte en español. Cálido y respetuoso; usa 'usted' inicialmente." }] }, voice: { provider: "azure", voiceId: "es-ES-ElviraNeural" } } },
10 { assistant: { name: "Support Français", model: { provider: "openai", model: "gpt-4o", messages: [{ role: "system", content: "Support français. Poli, courtois et formel." }] }, voice: { provider: "azure", voiceId: "fr-FR-DeniseNeural" } } }
11 ],
12 },
13});

4. Test

Create a phone number for the Squad and test each language path.

Next steps