Skip to content

Commit 07d1e93

Browse files
authored
Merge branch 'main' into update-openapi-spec-2025-08-22T00-26-07-644Z
2 parents 06f3c94 + f36d019 commit 07d1e93

35 files changed

Lines changed: 5140 additions & 286 deletions

fern/apis/api/openapi.json

Lines changed: 634 additions & 67 deletions
Large diffs are not rendered by default.

fern/assets/styles.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
border: 1px solid #C7D2FE;
3232
}
3333

34+
/* Optional: Squad badge (reuse assistant palette for now) */
35+
.vapi-badge-squad {
36+
background-color: #EEF2FF;
37+
color: #4338CA;
38+
border: 1px solid #C7D2FE;
39+
}
40+
3441
/* Dark mode adjustments */
3542
:is(.dark) .vapi-badge-assistant {
3643
background-color: #134E4A;
@@ -44,6 +51,12 @@
4451
border: 1px solid #6366F1;
4552
}
4653

54+
:is(.dark) .vapi-badge-squad {
55+
background-color: #312E81;
56+
color: #C7D2FE;
57+
border: 1px solid #6366F1;
58+
}
59+
4760
/* for a grid of videos */
4861

4962
.video-grid {
@@ -220,4 +233,4 @@ html.dark button[data-highlighted] .fern-api-property-meta {
220233

221234
.light .fern-theme-default.fern-container {
222235
background-color: #fff !important;
223-
}
236+
}

fern/assistants/assistant-hooks.mdx

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Supported events include:
1515
- `customer.speech.interrupted`: When the customer's speech is interrupted
1616
- `customer.speech.timeout`: When the customer doesn't speak within a specified time
1717

18-
You can combine actions and add filters to control when hooks trigger.
18+
You can combine actions and add filters to control when hooks trigger. Multiple `customer.speech.timeout` hooks can be attached to an assistant with staggered trigger delay to support different actions at different timing in the conversation.
1919

2020
## How hooks work
2121

@@ -145,6 +145,10 @@ Perform multiple actions—say a message, call a function, and transfer the call
145145
}]
146146
}
147147
```
148+
149+
<Note>
150+
Use `"oneOf": ["pipeline-error"]` as a catch-all filter for any pipeline-related error reason.
151+
</Note>
148152

149153
## Example: Handle speech interruptions
150154

@@ -205,9 +209,73 @@ The `customer.speech.timeout` hook supports special options:
205209
- `triggerResetMode`: Whether to reset the trigger count when user speaks (default: "never")
206210
</Note>
207211

208-
<Note>
209-
Use `"oneOf": ["pipeline-error"]` as a catch-all filter for any pipeline-related error reason.
210-
</Note>
212+
## Example: End call if user hasn't spoken for 30s
213+
214+
Assistant checks with the user at the 10 and 20s mark from when the user is silent, and ends the call after 30s of silence.
215+
216+
```json
217+
{
218+
"hooks": [
219+
{
220+
"hooks": [
221+
{
222+
"on": "customer.speech.timeout",
223+
"options": {
224+
"timeoutSeconds": 10,
225+
"triggerMaxCount": 3,
226+
"triggerResetMode": "onUserSpeech"
227+
},
228+
"do": [
229+
{
230+
"type": "say",
231+
"exact": "Are you still there? Please let me know how I can help you."
232+
}
233+
]
234+
},
235+
{
236+
"on": "customer.speech.timeout",
237+
"options": {
238+
"timeoutSeconds": 20,
239+
"triggerMaxCount": 3,
240+
"triggerResetMode": "onUserSpeech"
241+
},
242+
"do": [
243+
{
244+
"type": "say",
245+
"prompt": "The user has not responded in 20s. Based on the above conversation in {{transcript}} ask the user if they need help or if not you will be ending the call"
246+
}
247+
]
248+
}
249+
]
250+
},
251+
{
252+
"hooks": [
253+
{
254+
"on": "customer.speech.timeout",
255+
"options": {
256+
"timeoutSeconds": 30,
257+
"triggerMaxCount": 3,
258+
"triggerResetMode": "onUserSpeech"
259+
},
260+
"do": [
261+
{
262+
"type" : "say",
263+
"exact" : "I'll be ending the call now, please feel free to call back at any time."
264+
},
265+
{
266+
"type": "tool",
267+
"tool": {
268+
"type": "endCall"
269+
}
270+
}
271+
]
272+
}
273+
]
274+
}
275+
]
276+
}
277+
```
278+
211279

212280
## Common use cases
213281

0 commit comments

Comments
 (0)