Skip to content

Commit 6c3fab2

Browse files
cursoragentsahil
andcommitted
Add example of transferCall tool with rejection plan configuration
Co-authored-by: sahil <[email protected]>
1 parent c346328 commit 6c3fab2

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

fern/tools/tool-rejection-plan.mdx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,47 @@ Attach `rejectionPlan` directly on a tool in your assistant configuration (`mode
142142
}
143143
}
144144
```
145+
146+
### Another example: transferCall with rejection
147+
148+
```json
149+
{
150+
"model": {
151+
"provider": "openai",
152+
"model": "gpt-4o",
153+
"messages": [
154+
{ "role": "system", "content": "Transfer only if the user clearly asks to be connected." }
155+
],
156+
"tools": [
157+
{
158+
"type": "transferCall",
159+
"destinations": [
160+
{ "type": "number", "number": "+1234567890" }
161+
],
162+
"rejectionPlan": {
163+
"conditions": [
164+
{
165+
"type": "group",
166+
"operator": "OR",
167+
"conditions": [
168+
{ "type": "regex", "regex": "(?i)\\bconnect\\b", "target": { "role": "user" } },
169+
{ "type": "regex", "regex": "(?i)\\btransfer\\b", "target": { "role": "user" } }
170+
]
171+
},
172+
{
173+
"type": "regex",
174+
"regex": "\\?",
175+
"target": { "position": -1, "role": "user" },
176+
"negate": true
177+
}
178+
]
179+
}
180+
}
181+
]
182+
}
183+
}
184+
```
185+
145186
## Tips
146187

147188
- Escape backslashes in regex patterns: write `\\b` in JSON to mean `\b` in the regex engine.

0 commit comments

Comments
 (0)