Skip to content

Commit 7ffedd4

Browse files
committed
Added squads example
Signed-off-by: Sahil Suman <[email protected]>
1 parent d6176d7 commit 7ffedd4

File tree

2 files changed

+98
-1
lines changed

2 files changed

+98
-1
lines changed

mint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
},
176176
{
177177
"group": "Squads",
178-
"pages": ["squads"]
178+
"pages": ["squads","squads-example"]
179179
}
180180
]
181181
},

squads-example.mdx

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: "Configuring Inbound and Outbound Calls for Squads"
3+
sidebarTitle: "Example"
4+
description: "Configuring assistants for inbound/outbound calls."
5+
---
6+
7+
This guide details how to set up and manage inbound and outbound call functionality within Squads, leveraging AI assistants.
8+
9+
### Key Concepts
10+
* **Transient Assistant:** A temporary assistant configuration passed directly in the request payload.
11+
* **Assistant ID:** A unique identifier referring to a pre-existing assistant configuration.
12+
13+
<Note>When using Assistant IDs, ensure the `name` property in the payload matches the associated assistant's name accurately.</Note>
14+
15+
### Inbound Call Configuration
16+
17+
When your server receives a request of type `assistant-request`, respond with a JSON payload structured as follows:
18+
19+
20+
```json
21+
{
22+
"squad": {
23+
"members": [
24+
{
25+
"assistant": {
26+
"name": "Emma",
27+
"model": { "model": "gpt-4o", "provider": "openai" },
28+
"voice": { "voiceId": "emma", "provider": "azure" },
29+
"transcriber": { "provider": "deepgram" },
30+
"firstMessage": "Hi, I am Emma, what is your name?",
31+
"firstMessageMode": "assistant-speaks-first"
32+
},
33+
"assistantDestinations": [
34+
{
35+
"type": "assistant",
36+
"assistantName": "Mary",
37+
"message": "Please hold on while I transfer you to our appointment booking assistant Mary.",
38+
"description": "Transfer the user to the appointment booking assistant."
39+
}
40+
]
41+
},
42+
{
43+
"assistantId": "your-assistant-id"
44+
}
45+
]
46+
}
47+
}
48+
```
49+
50+
**In this example:**
51+
52+
* The first `members` entry is a **transient assistant** (full configuration provided).
53+
* The second `members` entry uses an **Assistant ID**.
54+
* `assistantDestinations` defines how to **transfer the call** to another assistant.
55+
56+
### Outbound Call Configuration
57+
58+
To initiate an outbound call, send a POST request to the API endpoint /call/phone with a JSON payload structured as follows:
59+
60+
```json
61+
{
62+
"squad": {
63+
"members": [
64+
{
65+
"assistant": {
66+
"name": "Emma",
67+
"model": { "model": "gpt-4o", "provider": "openai" },
68+
"voice": { "voiceId": "emma", "provider": "azure" },
69+
"transcriber": { "provider": "deepgram" },
70+
"firstMessage": "Hi, I am Emma, what is your name?",
71+
"firstMessageMode": "assistant-speaks-first"
72+
},
73+
"assistantDestinations": [
74+
{
75+
"type": "assistant",
76+
"assistantName": "Mary",
77+
"message": "Please hold on while I transfer you to our appointment booking assistant Mary.",
78+
"description": "Transfer the user to the appointment booking assistant."
79+
}
80+
]
81+
},
82+
{
83+
"assistantId": "your-assistant-id"
84+
}
85+
]
86+
},
87+
"customer": {
88+
"number": "your-phone-number"
89+
},
90+
"phoneNumberId": "your-phone-number-id"
91+
}
92+
```
93+
94+
**Key points:**
95+
96+
* `customer.number` is the phone number to call.
97+
* `phoneNumberId` is a unique identifier for the phone number (obtain this from your provider).

0 commit comments

Comments
 (0)