JM
06/11/2024, 11:24 AMVapi
06/11/2024, 11:25 AMVapi
06/11/2024, 11:26 AMconst assistant
with const squad
and then provide the JSON configuration for the squad. Here's how you can modify your existing snippet:
javascript
<script>
var vapiInstance = null;
const squad = {
"squadId": "<squad_id>", // Substitute with your squad ID
"assistants": [
// Add your assistant configurations here
{
"assistantId": "<assistant_id_1>",
"publicApiKey": "<public_api_key_1>"
},
{
"assistantId": "<assistant_id_2>",
"publicApiKey": "<public_api_key_2>"
}
// ... add more assistants as needed
]
};
const buttonConfig = {}; // Modify this as required
(function (d, t) {
var g = document.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src =
"https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js";
g.defer = true;
g.async = true;
s.parentNode.insertBefore(g, s);
g.onload = function () {
vapiInstance = window.vapiSDK.run({
squad: squad, // Use the squad configuration instead of a single assistant
config: buttonConfig, // optional
});
};
})(document, "script");
</script>
Make sure to replace <squad_id>
, <assistant_id_1>
, <public_api_key_1>
, <assistant_id_2>
, and <public_api_key_2>
with the actual IDs and keys from your Vapi dashboard. This configuration will allow your main assistant to pass the call to other assistants within the squad as needed.
If you need any further assistance or have additional questions, feel free to ask!Vapi
06/11/2024, 11:26 AMVapi
06/11/2024, 11:27 AMJM
06/11/2024, 11:28 AMSahil
06/11/2024, 11:38 AMJM
06/12/2024, 6:23 AMSahil
06/12/2024, 6:30 AMJM
06/12/2024, 8:51 AMJM
07/01/2024, 8:27 PMSahil
07/01/2024, 8:41 PMJM
07/01/2024, 9:23 PMShubham Bajaj
07/02/2024, 4:19 AMJM
07/02/2024, 6:03 AMSahil
07/02/2024, 8:04 AMShubham Bajaj
07/02/2024, 10:37 AMJM
07/02/2024, 11:16 AMShubham Bajaj
07/02/2024, 11:17 AMNehal Azhar
07/28/2024, 6:17 PMVapi
07/28/2024, 6:17 PMsquadId
rather than the individual assistantId
values. Here's how you can adjust your snippet:
javascript
<script>
var vapiInstance = null;
const squadId = "<Your-Squad-ID>"; // Replace with your actual squad ID
const apiKey = "<Your-Public-API-Key>"; // Replace with your actual Public API key
const buttonConfig = {
// ... (button configuration remains the same)
};
(function (d, t) {
var g = document.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = "https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js";
g.defer = true;
g.async = true;
s.parentNode.insertBefore(g, s);
g.onload = function () {
vapiInstance = window.vapiSDK.run({
apiKey: apiKey,
squad: squadId, // Pass the squadId here
config: buttonConfig
});
};
})(document, "script");
</script>
Make sure to replace <Your-Squad-ID>
with the actual squad ID you obtained from the dashboard and <Your-Public-API-Key>
with your public API key.
If the call is not being transferred to other assistants within the squad, it could be due to the logic defined in your assistants or the squad settings. Ensure that the transfer conditions are set correctly and that the assistants are configured to handle transfers as expected.
If you continue to experience issues, please provide the squad ID and the specific error messages you're encountering so that we can assist you further.Shubham Bajaj
07/29/2024, 5:55 PM