Skip to content

Commit

Permalink
merge staging docs (#367)
Browse files Browse the repository at this point in the history
* 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
4 people authored Aug 22, 2023
1 parent 8ace1a6 commit c5a39b8
Show file tree
Hide file tree
Showing 68 changed files with 2,853 additions and 67 deletions.
10 changes: 10 additions & 0 deletions docs/agents.mdx
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
3 changes: 3 additions & 0 deletions docs/api-reference/actions/create-action.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/actions/create
---
3 changes: 3 additions & 0 deletions docs/api-reference/actions/get-action.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/actions/
---
3 changes: 3 additions & 0 deletions docs/api-reference/actions/list-actions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/actions/list
---
3 changes: 3 additions & 0 deletions docs/api-reference/actions/update-action.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/actions/update
---
3 changes: 3 additions & 0 deletions docs/api-reference/agents/create-agent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/agents/create
---
3 changes: 3 additions & 0 deletions docs/api-reference/agents/get-agent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/agents/
---
3 changes: 3 additions & 0 deletions docs/api-reference/agents/list-agents.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/agents/list
---
3 changes: 3 additions & 0 deletions docs/api-reference/agents/update-agent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/agents/update
---
3 changes: 3 additions & 0 deletions docs/api-reference/calls/create-call.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/calls/create
---
3 changes: 3 additions & 0 deletions docs/api-reference/calls/end-call.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/calls/end
---
3 changes: 3 additions & 0 deletions docs/api-reference/calls/get-call.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/calls/
---
3 changes: 3 additions & 0 deletions docs/api-reference/calls/list-calls.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/calls/list
---
3 changes: 3 additions & 0 deletions docs/api-reference/numbers/buy-number.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/numbers/buy
---
3 changes: 3 additions & 0 deletions docs/api-reference/numbers/cancel-number.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/numbers/cancel
---
3 changes: 3 additions & 0 deletions docs/api-reference/numbers/get-number.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/numbers/
---
3 changes: 3 additions & 0 deletions docs/api-reference/numbers/list-numbers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/numbers/list
---
3 changes: 3 additions & 0 deletions docs/api-reference/numbers/update-number.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/numbers/update
---
3 changes: 3 additions & 0 deletions docs/api-reference/schemas/action-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi-schema: ActionConfig
---
3 changes: 3 additions & 0 deletions docs/api-reference/schemas/action-type.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi-schema: ActionType
---
3 changes: 3 additions & 0 deletions docs/api-reference/usage/get-usage.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/usage/
---
3 changes: 3 additions & 0 deletions docs/api-reference/voices/create-voice.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/voices/create
---
3 changes: 3 additions & 0 deletions docs/api-reference/voices/get-voice.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/voices/
---
3 changes: 3 additions & 0 deletions docs/api-reference/voices/list-voices.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/voices/list
---
3 changes: 3 additions & 0 deletions docs/api-reference/voices/update-voice.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/voices/update
---
3 changes: 3 additions & 0 deletions docs/api-reference/webhooks/create-webhook.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/webhooks/create
---
3 changes: 3 additions & 0 deletions docs/api-reference/webhooks/get-webhook.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/webhooks/
---
3 changes: 3 additions & 0 deletions docs/api-reference/webhooks/list-webhooks.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /v1/webhooks/list
---
3 changes: 3 additions & 0 deletions docs/api-reference/webhooks/update-webhook.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v1/webhooks/update
---
4 changes: 4 additions & 0 deletions docs/call-object.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Call Object"
description: "🚧 Under construction"
---
190 changes: 190 additions & 0 deletions docs/configuring-number.mdx
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>
38 changes: 38 additions & 0 deletions docs/getting-number.mdx
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.
Loading

0 comments on commit c5a39b8

Please sign in to comment.