Skip to content

Commit d482406

Browse files
authored
fixes, more handoff (#804)
* fixes, more handoff * actually save files * move handoff location * add function name * handoff tool top level * properly link handoff docs from tools -> squads
1 parent 77bf24c commit d482406

File tree

6 files changed

+80
-61
lines changed

6 files changed

+80
-61
lines changed

fern/docs.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ navigation:
191191
- page: Custom tools troubleshooting
192192
path: tools/custom-tools-troubleshooting.mdx
193193
icon: fa-light fa-wrench
194-
- page: Handoff tool
195-
path: tools/handoff.mdx
194+
- link: Handoff tool
195+
href: /squads/handoff
196196
icon: fa-light fa-hand-holding-hand
197197
- section: External tools
198198
icon: fa-light fa-cubes
@@ -308,6 +308,9 @@ navigation:
308308
- page: Overview
309309
path: squads.mdx
310310
icon: fa-light fa-eye
311+
- page: Handoff tool
312+
path: squads/handoff.mdx
313+
icon: fa-light fa-hand-holding-hand
311314
- section: Examples
312315
icon: fa-light fa-code
313316
contents:
@@ -321,8 +324,8 @@ navigation:
321324
path: squads/examples/property-management.mdx
322325
- page: Multilingual support
323326
path: squads/examples/multilingual-support.mdx
324-
- page: Silent transfers
325-
path: squads/silent-transfers.mdx
327+
- page: Silent handoffs
328+
path: squads/silent-handoffs.mdx
326329
icon: fa-light fa-arrow-right-arrow-left
327330

328331
- section: Best practices

fern/squads.mdx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ We recommend using [Handoff Tools](/tools/handoff) to specify which destinations
5151
"assistantId": "assistant-123",
5252
"description": "Call this tool when the customer wants to talk about pricing"
5353
}
54-
]
54+
],
55+
"function": {
56+
"name": "handoff_to_assistant_123"
57+
}
5558
}
5659
]
5760
},
@@ -94,7 +97,7 @@ To override the configuration of a saved assistant without modifying the underly
9497
}
9598
```
9699

97-
You may also define inline tools via assistant overrides through the `model` object (using `tools:append`), so that the assistant will only handoff if it is a part of this squad.
100+
You may also define inline tools via `assistantOverrides` through the `tools:append` array, so that the assistant will only handoff if it is a part of this squad.
98101
```json
99102
{
100103
"squad": {
@@ -111,22 +114,21 @@ You may also define inline tools via assistant overrides through the `model` obj
111114
{
112115
"assistantId": "saved-assistant-id",
113116
"assistantOverrides": {
114-
"model": {
115-
"provider": "openai",
116-
"model": "gpt-4o",
117-
"tools:append": [
118-
{
119-
"type": "handoff",
120-
"destinations": [
121-
{
122-
"type": "assistant",
123-
"assistantId": "assistant-123",
124-
"description": "Call this tool when the customer wants to talk about pricing"
125-
}
126-
]
117+
"tools:append": [
118+
{
119+
"type": "handoff",
120+
"destinations": [
121+
{
122+
"type": "assistant",
123+
"assistantId": "assistant-123",
124+
"description": "Call this tool when the customer wants to talk about pricing"
125+
}
126+
],
127+
"function": {
128+
"name": "handoff_to_assistant_123"
127129
}
128-
]
129-
},
130+
}
131+
]
130132
}
131133
},
132134
]

fern/squads/examples/clinic-triage-scheduling.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ Compose multiple assistants into a Squad for safe, specialized healthcare flows:
3535
- From Triage → Scheduler for routine care
3636
- Warm-transfer with a short summary for human escalation
3737

38-
See: [Silent transfers](/squads/silent-transfers).
39-
4038
## 3. Implement
4139

4240
<Tabs>

fern/squads/examples/multilingual-support.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Provide structured multilingual support using a Squad: present a short language
1212
**Squad Capabilities:**
1313
* Explicit language choice for clarity
1414
* Language‑specific prompts and voices
15-
* Seamless transfers while preserving context
15+
* Seamless handoffs while preserving context
1616

1717
## 1. Define members
1818

fern/tools/handoff.mdx renamed to fern/squads/handoff.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Handoff Tool
33
subtitle: 'Transfer the call to another assistant.'
4-
slug: tools/handoff
4+
slug: squads/handoff
55
---
66

77
The handoff tool enables seamless call transfers between assistants in a multi-agent system. This guide covers all configuration patterns and use cases.

fern/squads/silent-transfers.mdx renamed to fern/squads/silent-handoffs.mdx

Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
---
2-
title: Silent Transfers
3-
slug: squads/silent-transfers
2+
title: Silent Handoffs
3+
slug: squads/silent-handoffs
44
---
5-
- **The Problem**: In traditional AI call flows, when transferring from one agent to another, announcing the transfer verbally can confuse or annoy callers and disrupt the conversation's flow.
6-
- **The Solution**: Silent transfers keep the call experience _uninterrupted_, so the user doesn’t know multiple assistants are involved. The conversation flows more naturally, boosting customer satisfaction.
5+
- **The Problem**: In traditional AI call flows, when handing off from one agent to another, announcing the handoff verbally can confuse or annoy callers and disrupt the conversation's flow.
6+
- **The Solution**: Silent handoffs keep the call experience _uninterrupted_, so the user doesn’t know multiple assistants are involved. The conversation flows more naturally, boosting customer satisfaction.
77

88
If you want to allow your call flow to move seamlessly from one assistant to another _without_ the caller hearing `Please hold while we transfer you` here’s what to do:
99

1010
1. **Update the Destination Assistant’s First Message**
1111
- Set the assistant's `firstMessage` to an _empty string_.
1212
- Set the assistant's `firstMessageMode` to `assistant-speaks-first-with-model-generated-message`.
1313

14-
2. **Update the Squad's assistant destinations messages**
15-
- For every `members[*].assistantDestinations[*]`, set the `message` property to an _empty string_.
14+
2. **Update the Squad's handoff messages**
15+
- For every `members[*].model.tools/toolIds`, unset the `messages` property.
1616

1717
3. **Trigger the Transfer from the Source Assistant**
1818

19-
- In that assistant’s prompt, include a line instructing it to transfer to the desired assistant:
19+
- In that assistant’s prompt, include a line instructing it to hand off to the desired assistant:
2020

2121
```json
22-
trigger the transferCall tool with 'assistantName' Assistant.
22+
trigger the 'handoff' tool with 'assistantName' Assistant.
2323
```
2424

2525
- Replace `'assistantName'` with the exact name of the next assistant.
@@ -32,49 +32,65 @@ If you want to allow your call flow to move seamlessly from one assistant to ano
3232

3333
- **HPMA (Main Assistant)** is talking to the customer. They confirm the order details and then quietly passes the conversation to **HPPA (Payment Assistant)**.
3434
- **HPPA** collects payment details without the customer ever hearing, `We’re now transferring you to the Payment Assistant.` It feels like one continuous conversation.
35-
- Once payment is done, **HPPA** transfers the call again—this time to **HPMA-SA (Main Sub Assistant)**—which takes over final shipping arrangements.
35+
- Once payment is done, **HPPA** hands off the call again—this time to **HPMA-SA (Main Sub Assistant)**—which takes over final shipping arrangements.
3636

3737
Everything happens smoothly behind the scenes!
3838

3939
## **Squad and Assistant Configurations**
4040

41-
Below are the key JSON examples you’ll need. These show how to structure your assistants and squads so they work together for silent transfers.
41+
Below are the key JSON examples you’ll need. These show how to structure your assistants and squads so they work together for silent handoffs.
4242

4343
### **HP Payment Squad With SubAgent**
4444

4545
<Warning>
46-
Make sure the `members[*].assistantDestinations[*].message` properties are set to an _empty string_.
46+
Make sure the `members[*].model.tools.messages` properties are set to null or empty array.
4747
</Warning>
4848

4949
```json
5050
{
5151
"members": [
5252
{
53-
"assistantId": "2d8e0d13-1b3c-4358-aa72-cf6204d6244e",
54-
"assistantDestinations": [
55-
{
56-
"message": " ",
57-
"description": "Transfer call to the payment agent",
58-
"type": "assistant",
59-
"assistantName": "HPPA"
60-
}
61-
]
53+
"name": "HPMA (Main Assistant)",
54+
"model": {
55+
"provider": "openai",
56+
"model": "gpt-4o",
57+
"tools": [
58+
{
59+
"type": "handoff",
60+
"destinations": [
61+
{
62+
"type": "assistant",
63+
"assistantName": "HPPA"
64+
}
65+
],
66+
"messages": [],
67+
}
68+
]
69+
},
70+
...
6271
},
6372
{
64-
"assistantId": "ad1c5347-bc32-4b31-8bb7-6ff5fcb131f4",
65-
"assistantDestinations": [
66-
{
67-
"message": " ",
68-
"description": "Transfer call to the main sub agent",
69-
"type": "assistant",
70-
"assistantName": "HPMA-SA"
71-
}
72-
]
73+
"name": "HPPA",
74+
"model": {
75+
"tools": [
76+
{
77+
"type": "handoff",
78+
"destinations": [
79+
{
80+
"type": "assistant",
81+
"assistantName": "HPMA-SA"
82+
}
83+
],
84+
"messages": null,
85+
}
86+
]
87+
},
88+
...
7389
},
7490
{
75-
"assistantId": "f1c258bc-4c8b-4c51-9b44-883ab5e40b2f",
76-
"assistantDestinations": []
77-
}
91+
"name": "HPMA-SA",
92+
...
93+
},
7894
],
7995
"name": "HP Payment Squad With SubAgent"
8096
}
@@ -160,7 +176,7 @@ Answer only questions related to the context.
160176
3.Ask how many widgets the customer would like to purchase.
161177
- Wait for the customer's response.
162178
4.Confirm the order details with the customer.
163-
- trigger the transferCall tool with Payment `HPPA` Assistant.
179+
- trigger the handoff tool with Payment `HPPA` Assistant.
164180
```
165181

166182
### **HPPA (Payment Assistant Prompt)**
@@ -200,7 +216,7 @@ any greetings or small talk.
200216
3. Ask for the CVV number.
201217
- Wait for the customer's response.
202218
4. Confirm that the payment has been processed successfully.
203-
- trigger the transferCall tool with Payment `HPMA-SA` Assistant.
219+
- trigger the handoff tool with Payment `HPMA-SA` Assistant.
204220
```
205221

206222
### **HPMA-SA (Main Sub Assistant Prompt)**
@@ -245,6 +261,6 @@ or small talk.
245261

246262
## **Conclusion**
247263

248-
By following these steps and examples, you can configure your call system to conduct **silent transfers** ensuring that callers experience a single, uninterrupted conversation. Each assistant does its job smoothly, whether it’s capturing payment, finalizing a shipping address, or collecting basic info.
264+
By following these steps and examples, you can configure your call system to conduct **silent handoffs** ensuring that callers experience a single, uninterrupted conversation. Each assistant does its job smoothly, whether it’s capturing payment, finalizing a shipping address, or collecting basic info.
249265

250-
Enjoy setting up your silent transfers!
266+
Enjoy setting up your silent handoffs!

0 commit comments

Comments
 (0)