|
| 1 | +--- |
| 2 | +title: "Squads" |
| 3 | +sidebarTitle: "Introduction" |
| 4 | +description: "Use Squads to handle complex workflows and tasks." |
| 5 | +--- |
| 6 | + |
| 7 | +Sometimes, complex workflows are easier to manage with multiple assistants. |
| 8 | +For example, you might have one assistant for asking about personal information, and another for booking appointments. |
| 9 | +Each of these assistants can have their own configuration and may require drastically different prompts. |
| 10 | + |
| 11 | +Squads enable calls to transfer assistants mid-conversation, while maintaining full conversation context. |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +To use Squads, you can create a `squad` when starting a call and specify `members` as a list of assistants and destinations. |
| 16 | +The first member is the assistant that will start the call, and assistants can be either persistent or transient. |
| 17 | + |
| 18 | +Each assistant should be assigned the relevant assistant transfer destinations. |
| 19 | +Transfers are specified by assistant name and are used when the model recognizes a specific trigger. |
| 20 | + |
| 21 | +```json |
| 22 | +{ |
| 23 | + "squad": { |
| 24 | + "members": [ |
| 25 | + { |
| 26 | + "assistantId": "information-gathering-assistant-id", |
| 27 | + "assistantDestinations": [{ |
| 28 | + "type": "assistant", |
| 29 | + "assistantName": "Appointment Booking", |
| 30 | + "message": "Please hold on while I transfer you to our appointment booking assistant.", |
| 31 | + "description": "Transfer the user to the appointment booking assistant after they say their name." |
| 32 | + }], |
| 33 | + }, |
| 34 | + { |
| 35 | + "assistant": { |
| 36 | + "name": "Appointment Booking", |
| 37 | + ... |
| 38 | + }, |
| 39 | + } |
| 40 | + ] |
| 41 | + } |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | + |
| 46 | +## Best practices |
| 47 | + |
| 48 | +The following are some best practices for using Squads to reduce errors: |
| 49 | + |
| 50 | +- Group assistants by closely related tasks |
| 51 | +- Create as few assistants as possible to reduce complexity |
| 52 | +- Make sure descriptions for transfers are clear and concise |
0 commit comments