Skip to content

Commit 8999c93

Browse files
committed
undo
1 parent 890728c commit 8999c93

19 files changed

+440
-232
lines changed

docs/actions.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Actions"
3+
description: "🚧 Under construction"
4+
---
5+
6+
#

docs/agents.mdx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
11
---
22
title: "Agents"
3-
description: "🚧 Under construction"
3+
description: "Powerful AI assistants that you can control"
44
---
55

66
# What are agents
77

8+
Vocode Agents are the core component of the Vocode API. Agents can be deployed to receive
9+
phone calls by attaching them to [Numbers](/numbers). Agents can also be used to make outbound calls
10+
via the `calls/create` endpoint.
11+
12+
At its core, the agent is an amalgamation of everything you need to build powerful AI assistants for
13+
your use cases:
14+
15+
- [Prompts](/prompts) – instructions given to the agent that control its behavior.
16+
- [Voices](/voices) – the synthetic voice given to your agent.
17+
- [Webhooks](/webhooks) – mechanism by which you can subscribe to agent events.
18+
- [Conversational Dials](/conversational-dials) – controls for how the agent communicates, like its interruption sensitivity.
19+
- [Actions](/actions) – tools available to your agent, like endint the conversation or transferring the call.
20+
821
# How to configure an agent
922

10-
# API Schema
23+
Agents can be configured via our [Dashboard](/dashboard) or via API. As with all of our API objects, Agents have
24+
`list`, `get`, `create`, and `update` endpoints that allow you to manipulate them as you see fit.
25+
26+
In addition to the other API objects enumerated above, agents have other reference fields that can be used to control
27+
agent behavior:
28+
29+
- `language` sets the agent language (for more context see [Multilingual Agents](/multilingual))
30+
- `initial_message` controls the agents first utterance.
31+
- `initial_message_delay` adds a delay to the initial message from when the call begins
32+
- `ask_if_human_present_on_idle` allows the agent to speak when there is more than 4s of silence on the call
33+
- `llm_temperature` controls the behavior of the underlying language model. Values can range from X to Y, with higher
34+
values leading to more consistent replies.
35+
36+
# Example: creating an agent
37+
38+
# Example: updating an agent

docs/configuring-number.mdx

Lines changed: 92 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,184 +1,138 @@
11
---
22
title: "Configuring your number"
3-
description: "Learn how to configure your phone number with an agent."
3+
description: "Setting up our agent to function as a receptionist"
44
---
55

6-
# Configuring Numbers
6+
Now that we have a number set up on Vocode, our agent is ready to start accepting calls. Vocode [Agents](/agents)
7+
have several different parameters we can use to control its behavior. We're going to be setting up our receptionist
8+
by modifying:
79

8-
Once you have purchased a number, you can configure it with an inbound agent to set its prompt, voice, and actions.
10+
1. Voice -> this is the voice of our agent
11+
2. Prompt -> the prompt is the instruction we give our agent that controls its behavior
12+
3. Actions -> actions are things that the agent **_can do_** like end the conversation or
13+
make an API request to an external service (like a calendar booking software)
914

10-
## Pick your Number
15+
## Setting up our receptionist
1116

12-
First, list your numbers and pick the number you want to configure.
17+
### Voice
1318

14-
<CodeGroup>
19+
First, let's create a new voice via [ElevenLabs]("https://elevenlabs.io) and grab the voice ID.
1520

16-
```python Python
17-
numbers = vocode_client.numbers.list_numbers()
1821
```
22+
voice = vocode_client.voices.create_voice(
23+
request={
24+
"type": "voice_eleven_labs",
25+
"voice_id": "06oPEcZqPWhZ2IeTcOJc",
26+
"stability": ".2",
27+
"similarity_boost": ".75",
28+
"model_id": "eleven_turbo_v2",
29+
"optimize_streaming_latency": "4",
30+
}
31+
)
1932
20-
```javascript TypeScript
21-
const numbers = await vocode.numbers.listNumbers();
33+
voice_id = voice.id
2234
```
2335

24-
</CodeGroup>
25-
26-
## Changing the Prompt
36+
For other voice options curated by Vocode, check out our page on [Voices](/voices). Voice clones are also available on demand
37+
for enterprise accounts.
2738

28-
All phone numbers come with the default agent configuration. Let's change the
29-
prompt so the AI responds like Yoda.
39+
### Prompt
3040

31-
<CodeGroup>
41+
The prompt is how our agent will know what instructions to follow on the call. We're going to set up a prompt suitable for a
42+
receptionist agent and create a prompt object in the API:
3243

33-
```python Python
34-
from vocode import AgentUpdateParams, PromptUpdateParams
35-
36-
yoda_prompt = PromptUpdateParams(content="I want you to act as Yoda. Respond as Yoda would.")
37-
number = vocode_client.numbers.update_number(
38-
phone_number="YOUR_NUMBER", inbound_agent=AgentUpdateParams(prompt=yoda_prompt)
39-
)
4044
```
45+
PROMPT = """
46+
sample prompt
47+
"""
4148
42-
```javascript TypeScript
43-
const yoda_prompt = "I want you to act as Yoda. Respond as Yoda would.";
44-
const number = await vocode.numbers.updateNumber({
45-
phoneNumber: "YOUR_NUMBER",
46-
inboundAgent: { prompt: { content: yoda_prompt } },
47-
});
49+
prompt = vocode_client.prompts.create_prompt(request={"content": PROMPT})
50+
prompt_id = prompt.id
4851
```
4952

50-
</CodeGroup>
53+
For more guidance on how prompts work check out our guide on [Prompt Objects](/prompts) and [Prompt Engineering](/prompt-engineering).
5154

52-
## Changing the Voice
55+
### Actions
5356

54-
Our prompt has been updated. Now let's use a voice provided by other API providers.
57+
Finally, for our receptionist to be complete, we're going to want to give it the ability to actually do two things:
5558

56-
### Rime
59+
1. End the conversation
60+
2. Make an API call to our calendar software to book calendar appointments.
5761

58-
<CodeGroup>
62+
Let's set up both of these actions using the API:
5963

60-
```python Python
61-
from vocode import RimeVoiceParams
64+
```python
6265

63-
rime_voice = RimeVoiceParams(
64-
type="voice_rime",
65-
speaker="RIME_SPEAKER",
66+
# This action ends the conversation
67+
end_conversation_action = vocode_client.actions.create_action(
68+
request=ActionParamsRequest(type="action_end_conversation", config={})
6669
)
67-
voice = vocode_client.voices.create_voice(request=rime_voice)
68-
```
69-
70-
```javascript TypeScript
71-
const rimeVoice = {
72-
type: "voice_rime",
73-
voiceId: "RIME_SPEAKER",
74-
};
75-
const number = await vocode.voices.createVoice(rimeVoice);
76-
```
77-
78-
</CodeGroup>
7970

80-
### Play.ht
81-
82-
<CodeGroup>
83-
84-
```python Python
85-
from vocode import PlayHtVoiceParams
86-
87-
play_ht_voice = PlayHtVoiceParams(
88-
type="voice_play_ht",
89-
voice_id="PLAY_HT_VOICE_ID",
90-
api_user_id="PLAY_HT_USER_ID",
91-
api_key="PLAY_HT_API_KEY",
71+
# This action makes an API call to our calendar endpoint
72+
calendar_action = vocode_client.actions.create_action(
73+
request={
74+
"type": "action_external",
75+
"config": {
76+
"name": "Meeting_Booking_Assistant",
77+
"description": ("Book a meeting for a 30 minute or 1 hour call."),
78+
"url": "http://example.com/booking",
79+
"speak_on_send": True,
80+
"speak_on_receive": True,
81+
"input_schema": {
82+
"type": "object",
83+
"properties": {
84+
"length": {
85+
"type": "string",
86+
"enum": ["30m", "1hr"],
87+
},
88+
"time": {
89+
"type": "string",
90+
"pattern": "^\d{2}:\d0[ap]m$",
91+
},
92+
},
93+
},
94+
},
95+
},
9296
)
93-
voice = vocode_client.voices.create_voice(request=play_ht_voice)
9497
```
9598

96-
```javascript TypeScript
97-
const playHtVoice = {
98-
type: "voice_play_ht",
99-
voiceId: "PLAY_HT_VOICE_ID",
100-
apiUserId: "PLAY_HT_USER_ID",
101-
apiKey: "PLAY_HT_API_KEY,
102-
};
103-
const number = await vocode.voices.createVoice(playHtVoice);
104-
```
99+
For more information on how to set up actions, check out our [Actions](/actions) guide and our new beta feature
100+
[External Actions](/external-actions) which we are using here to make the calendar API call.
105101

106-
</CodeGroup>
102+
## Updating our agent
107103

108-
### ElevenLabs
104+
Now that we've created our voice, prompt, and actions, we can run a query to update our agent as follows. We'll
105+
also add an `initial_message` to our agent to greet people who call in.
109106

110-
We will use the `rachel` voice from ElevenLabs. Instead of updating our existing agent directly,
111-
we'll create a new voice config and set the agent to use it.
107+
We'll have to first grab the `agent_id` in order to make the `agent/update` request. Here's how we can grab it from our
108+
phone number:
112109

113-
<CodeGroup>
114-
115-
```python Python
116-
from vocode import ElevenLabsVoiceParams
117-
118-
elevenlabs_voice = ElevenLabsVoiceParams(
119-
type="voice_eleven_labs",
120-
voice_id="ELEVEN_LABS_VOICE_ID",
121-
api_key="ELEVEN_LABS_API_KEY",
122-
)
123-
voice = vocode_client.voices.create_voice(request=elevenlabs_voice)
110+
```python
111+
number = vocode_client.numbers.get(phone_number="1123456789")
112+
agent_id = number.agent_id
113+
print(agent_id)
124114
```
125115

126-
```javascript TypeScript
127-
const elevenlabsVoice = {
128-
type: "voice_eleven_labs",
129-
voiceId: "ELEVEN_LABS_VOICE_ID",
130-
apiKey: "ELEVEN_LABS_API_KEY",
131-
};
132-
const number = await vocode.voices.createVoice(elevenlabsVoice);
133-
```
134-
135-
</CodeGroup>
136-
137-
Now, we have our `voice_id` and can update our agent to use it.
138-
139-
<CodeGroup>
116+
Which should output a UUID for our agent.
140117

141-
```python Python
142-
from vocode import AgentUpdateParams
143-
144-
agent = vocode_client.agents.update_agent(
145-
id="AGENT_ID",
146-
request=AgentUpdateParams(voice="VOICE_ID"),
147-
)
148118
```
149-
150-
```javascript TypeScript
151-
const agent = await vocode.agents.updateAgent({
152-
id: "AGENT_ID",
153-
body: { voice: "VOICE_ID" },
154-
});
155-
console.log(agent);
119+
ad1d802e-12ab-41c7-8726-14e119d6c92c
156120
```
157121

158-
</CodeGroup>
122+
And now we can use the `agent_id` in our update request as follows:
159123

160-
## Adding an Initial Message
124+
```python
125+
INITIAL_MESSAGE = "Hi, this is a Vocode scheduling agent, how can I help you?"
161126

162-
The initial message will be spoken as soon as the call starts before the user says anything. Let's make our agent say "Hello, I am Yoda" when the call starts.
163-
164-
<CodeGroup>
165-
166-
```python Python
167-
from vocode import AgentUpdateParams
168-
169-
number = vocode_client.numbers.update_number(
170-
phone_number="YOUR_NUMBER", inbound_agent=AgentUpdateParams(initial_message="Hello, I am Yoda.")
127+
update_response = vocode_client.agents.update_agent(
128+
id=agent_id,
129+
request=AgentUpdateParams(
130+
initial_message=INITIAL_MESSAGE,
131+
prompt=prompt_id,
132+
voice=voice_id,
133+
actions=[end_conversation_action_id, external_action_id],
134+
),
171135
)
172-
173-
```
174-
175-
```javascript TypeScript
176-
import { VocodeClient } from "@vocode/vocode-api";
177-
178-
const number = await vocode.numbers.updateNumber({
179-
phoneNumber: "YOUR_NUMBER",
180-
inboundAgent: { initialMessage: "Hello, I am Yoda." },
181-
});
182136
```
183137

184-
</CodeGroup>
138+
Now our agent is ready to be a receptionist! Check it out by giving it a call.

docs/do-not-call-detection.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "[Beta] Do Not Call detection"
2+
title: "Do Not Call Detection"
33
description: "Configure whether or not to run automatic estimated Do Not Call analysis"
44
---
55

docs/getting-number.mdx

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/hipaa-compliance.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "HIPAA Compliance"
2+
title: "[Beta] HIPAA Compliance"
33
---
44

55
The `hipaa_compliant` flag in the Vocode outbound calls API configures the system to not

docs/machine-detection.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Answering machine detection"
2+
title: "Answering Machine Detection"
33
description: "Define the behavior of the bot when no one answers the phone"
44
---
55

0 commit comments

Comments
 (0)