-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* checkpoint. routes first pass done, schemas not working * progress * restore some changes * change outline * update hosted quickstart * create docs for getting number (#293) * update code snippets for getting-number * finish using-actions * Add configuring numbers page * updates * nit * retrieve call data draft * use new openapi schema * updates * polish * schemas tab * Add vector db docs * vector db updates * update voices and add multilingual docs * context injection docs * remove environment params * adds dashboard link --------- Co-authored-by: Kian <[email protected]> Co-authored-by: Hayden Housen <[email protected]> Co-authored-by: zaptrem <[email protected]>
- Loading branch information
1 parent
8ace1a6
commit c5a39b8
Showing
68 changed files
with
2,853 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: "Agents" | ||
description: "🚧 Under construction" | ||
--- | ||
|
||
# What are agents | ||
|
||
# How to configure an agent | ||
|
||
# API Schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/actions/create | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/actions/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/actions/list | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/actions/update | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/agents/create | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/agents/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/agents/list | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/agents/update | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/calls/create | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/calls/end | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/calls/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/calls/list | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/numbers/buy | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/numbers/cancel | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/numbers/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/numbers/list | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/numbers/update | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi-schema: ActionConfig | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi-schema: ActionType | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/usage/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/voices/create | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/voices/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/voices/list | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/voices/update | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/webhooks/create | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/webhooks/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: get /v1/webhooks/list | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/webhooks/update | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: "Call Object" | ||
description: "🚧 Under construction" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
--- | ||
title: "Configuring your number" | ||
description: "Learn how to configure your phone number with an agent." | ||
--- | ||
|
||
# Configuring Numbers | ||
|
||
Once you have purchased a number, you can configure it with an inbound agent to set its prompt, voice, and actions. | ||
|
||
## Pick your Number | ||
|
||
First, list your numbers and pick the number you want to configure. | ||
|
||
<CodeGroup> | ||
|
||
```python Python | ||
numbers = vocode_client.numbers.list_numbers() | ||
``` | ||
|
||
```javascript TypeScript | ||
const numbers = await vocode.numbers.listNumbers(); | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
## Changing the Prompt | ||
|
||
All phone numbers come with the default agent configuration. Let's change the | ||
prompt so the AI responds like Yoda. | ||
|
||
<CodeGroup> | ||
|
||
```python Python | ||
from vocode import AgentUpdateParams | ||
|
||
yoda_prompt = "I want you to act as Yoda. Respond as Yoda would." | ||
number = vocode_client.numbers.update_number( | ||
phone_number="YOUR_NUMBER", inbound_agent=AgentUpdateParams(prompt=yoda_prompt) | ||
) | ||
``` | ||
|
||
```javascript TypeScript | ||
const yoda_prompt = "I want you to act as Yoda. Respond as Yoda would."; | ||
const number = await vocode.numbers.updateNumber({ | ||
phoneNumber: "YOUR_NUMBER", | ||
inboundAgent: { prompt: yoda_prompt }, | ||
}); | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
## Changing the Voice | ||
|
||
Our prompt has been updated. Now let's use a voice provided by other API providers. | ||
|
||
### Rime | ||
|
||
<CodeGroup> | ||
|
||
```python Python | ||
from vocode import RimeVoiceParams, VoiceType | ||
|
||
rime_voice = RimeVoiceParams( | ||
type=VoiceType.VOICE_RIME, | ||
speaker="RIME_SPEAKER", | ||
) | ||
voice = vocode_client.voices.create_voice(request=rime_voice) | ||
``` | ||
|
||
```javascript TypeScript | ||
import { VoiceType } from "@vocode/vocode-api/api"; | ||
|
||
const rimeVoice = { | ||
type: VoiceType.VoiceRime, | ||
voiceId: "RIME_SPEAKER", | ||
}; | ||
const number = await vocode.voices.createVoice(rimeVoice); | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
### Play.ht | ||
|
||
<CodeGroup> | ||
|
||
```python Python | ||
from vocode import PlayHtVoiceParams, VoiceType | ||
|
||
play_ht_voice = PlayHtVoiceParams( | ||
type=VoiceType.VOICE_PLAY_HT, | ||
voice_id="PLAY_HT_VOICE_ID", | ||
api_user_id="PLAY_HT_USER_ID", | ||
api_key="PLAY_HT_API_KEY", | ||
) | ||
voice = vocode_client.voices.create_voice(request=play_ht_voice) | ||
``` | ||
|
||
```javascript TypeScript | ||
import { VoiceType } from "@vocode/vocode-api/api"; | ||
|
||
const playHtVoice = { | ||
type: VoiceType.VoicePlayHt, | ||
voiceId: "PLAY_HT_VOICE_ID", | ||
apiUserId: "PLAY_HT_USER_ID", | ||
apiKey: "PLAY_HT_API_KEY, | ||
}; | ||
const number = await vocode.voices.createVoice(playHtVoice); | ||
``` | ||
</CodeGroup> | ||
### ElevenLabs | ||
We will use the `rachel` voice from ElevenLabs. Instead of updating our existing agent directly, | ||
we'll create a new voice config and set the agent to use it. | ||
<CodeGroup> | ||
```python Python | ||
from vocode import ElevenLabsVoiceParams, VoiceType | ||
elevenlabs_voice = ElevenLabsVoiceParams( | ||
type=VoiceType.VOICE_ELEVEN_LABS, | ||
voice_id="ELEVEN_LABS_VOICE_ID", | ||
api_key="ELEVEN_LABS_API_KEY", | ||
) | ||
voice = vocode_client.voices.create_voice(request=elevenlabs_voice) | ||
``` | ||
```javascript TypeScript | ||
import { VoiceType } from "@vocode/vocode-api/api"; | ||
const elevenlabsVoice = { | ||
type: VoiceType.VoiceElevenLabs, | ||
voiceId: "ELEVEN_LABS_VOICE_ID", | ||
apiKey: "ELEVEN_LABS_API_KEY", | ||
}; | ||
const number = await vocode.voices.createVoice(elevenlabsVoice); | ||
``` | ||
</CodeGroup> | ||
Now, we have our `voice_id` and can update our agent to use it. | ||
<CodeGroup> | ||
```python Python | ||
from vocode import AgentUpdateParams | ||
agent = vocode_client.agents.update_agent( | ||
id="AGENT_ID", | ||
request=AgentUpdateParams(voice="VOICE_ID"), | ||
) | ||
``` | ||
```javascript TypeScript | ||
const agent = await vocode.agents.updateAgent({ | ||
id: "AGENT_ID", | ||
body: { voice: "VOICE_ID" }, | ||
}); | ||
console.log(agent); | ||
``` | ||
</CodeGroup> | ||
## Adding an Initial Message | ||
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. | ||
<CodeGroup> | ||
```python Python | ||
from vocode import AgentUpdateParams | ||
number = vocode_client.numbers.update_number( | ||
phone_number="YOUR_NUMBER", inbound_agent=AgentUpdateParams(initial_message="Hello, I am Yoda.") | ||
) | ||
``` | ||
```javascript TypeScript | ||
import { VocodeClient } from "@vocode/vocode-api"; | ||
const number = await vocode.numbers.updateNumber({ | ||
phoneNumber: "YOUR_NUMBER", | ||
inboundAgent: { initialMessage: "Hello, I am Yoda." }, | ||
}); | ||
``` | ||
</CodeGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: "Getting a number" | ||
--- | ||
|
||
If you're on the Free plan, you'll have to head to the [dashboard](https://app.vocode.dev) to buy numbers. The Developer and | ||
Enterprise plans both come with numbers included in the subscription. For more info, see [Pricing](https://vocode.dev/pricing). | ||
|
||
<CodeGroup> | ||
|
||
```python Python | ||
phone_number = vocode_client.numbers.buy_number() | ||
``` | ||
|
||
```typescript TypeScript | ||
const phoneNumber = await vocode.numbers.buyNumber(); | ||
``` | ||
|
||
```bash cURL | ||
curl --request POST \ | ||
--url https://api.vocode.dev/v1/numbers/buy \ | ||
--header 'Content-Type: application/json' \ | ||
--header 'Authorization: Bearer <API_KEY>' | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
You'll get a response that looks like: | ||
|
||
```json | ||
{ | ||
"id": "***", | ||
"user_id": "***", | ||
"number": "11234567890", | ||
"inbound_agent": {...} | ||
} | ||
``` | ||
|
||
Your phone number is now active! Call the phone number and have a conversation with your AI. |
Oops, something went wrong.