Skip to content

Commit 31fce6c

Browse files
replace forwardingPhoneNumber with Tools
1 parent 37df17f commit 31fce6c

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

fern/examples/inbound-support.mdx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,29 @@ As a bonus, we also want the assistant to remember by the phone number of the ca
2929
"role": "system",
3030
"content": "You're a technical support assistant. You're helping a customer troubleshoot their Apple device. You can ask the customer questions, and you can use the following troubleshooting guides to help the customer solve their issue: ..."
3131
}
32-
]
32+
],
33+
"tools": [
34+
{
35+
"type": "transferCall",
36+
"destinations": [
37+
{
38+
"type": "number",
39+
"number": "+16054440129",
40+
"message": "I am forwarding your call to Department A. Please stay on the line."
41+
}
42+
]
43+
}
44+
]
3345
},
34-
"forwardingPhoneNumber": "+16054440129",
3546
"firstMessage": "Hey, I'm an A.I. assistant for Apple. I can help you troubleshoot your Apple device. What's the issue?",
3647
"recordingEnabled": true,
3748
}
3849
```
3950
<Card title="Let's break this down">
4051
- `transcriber` - We're defining this to make sure the transcriber picks up the custom words related to our devices.
4152
- `model` - We're using the OpenAI GPT-3.5-turbo model. It's much faster and preferred if we don't need GPT-4.
53+
- `transferCall` tool in `model.tools` - Since we've added this, the assistant will be provided the [transferCall](/assistants#transfer-call) function to use if the caller asks to be transferred to a person.
4254
- `messages` - We're defining the assistant's instructions for how to run the call.
43-
- `forwardingPhoneNumber` - Since we've added this, the assistant will be provided the [transferCall](/assistants#transfer-call) function to use if the caller asks to be transferred to a person.
4455
- `firstMessage` - This is the first message the assistant will say when the user picks up.
4556
- `recordingEnabled` - We're recording the call so we can hear the conversation later.
4657

fern/examples/outbound-sales.mdx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ We want this agent to be able to call a list of leads and schedule appointments.
2828
"content": "You're a sales agent for a Bicky Realty. You're calling a list of leads to schedule appointments to show them houses..."
2929
}
3030
],
31-
"functions": [
32-
{
31+
"tools": [
32+
{
3333
"name": "bookAppointment",
3434
"description": "Used to book the appointment.",
3535
"parameters": {
@@ -41,14 +41,23 @@ We want this agent to be able to call a list of leads and schedule appointments.
4141
}
4242
}
4343
}
44-
}
45-
]
44+
}
45+
{
46+
"type": "transferCall",
47+
"destinations": [
48+
{
49+
"type": "number",
50+
"number": "+16054440129",
51+
"message": "I am forwarding your call. Please stay on the line."
52+
}
53+
]
54+
}
55+
]
4656
},
4757
"voice": {
4858
"provider": "openai",
4959
"voiceId": "onyx"
5060
},
51-
"forwardingPhoneNumber": "+16054440129",
5261
"voicemailMessage": "Hi, this is Jennifer from Bicky Realty. We were just calling to let you know...",
5362
"firstMessage": "Hi, this Jennifer from Bicky Realty. We're calling to schedule an appointment to show you a house. When would be a good time for you?",
5463
"endCallMessage": "Thanks for your time.",
@@ -60,9 +69,9 @@ We want this agent to be able to call a list of leads and schedule appointments.
6069
- `transcriber` - We're defining this to make sure the transcriber picks up the custom word "Bicky"
6170
- `model` - We're using the OpenAI GPT-4 model, which is better at function calling.
6271
- `messages` - We're defining the assistant's instructions for how to run the call.
63-
- `functions` - We're providing a bookAppointment function with a datetime parameter. The assistant can call this during the conversation to book the appointment.
72+
- `bookAppointment` in `model.tools` - We're providing a bookAppointment function with a datetime parameter. The assistant can call this during the conversation to book the appointment.
73+
- `transferCall` in `model.tools` - Since we've added this, the assistant will be provided the [transferCall](/assistants#transfer-call) function to use.
6474
- `voice` - We're using the Onyx voice from OpenAI.
65-
- `forwardingPhoneNumber` - Since we've added this, the assistant will be provided the [transferCall](/assistants#transfer-call) function to use.
6675
- `voicemailMessage` - If the call goes to voicemail, this message will be played.
6776
- `firstMessage` - This is the first message the assistant will say when the user picks up.
6877
- `endCallMessage` - This is the message the assistant will deciding to hang up.
@@ -141,7 +150,7 @@ We want this agent to be able to call a list of leads and schedule appointments.
141150
}
142151
```
143152

144-
Since we also defined a `forwardingPhoneNumber`, when the user asks to speak to a human, the assistant will transfer the call to that number automatically.
153+
Since we also defined a `transferCall` tool, when the user asks to speak to a human, the assistant will transfer the call to that number automatically.
145154

146155
We can then check the [Dashboard](https://dashboard.vapi.ai) to see the call logs and read the transcripts.
147156

0 commit comments

Comments
 (0)