Skip to content

Commit

Permalink
remove unused files
Browse files Browse the repository at this point in the history
  • Loading branch information
Kian1354 committed Apr 20, 2024
1 parent aa8ded6 commit 3f97e39
Show file tree
Hide file tree
Showing 10 changed files with 270 additions and 54 deletions.
16 changes: 11 additions & 5 deletions docs/phrase-triggers.mdx → docs/action-triggers.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: "[Beta] Phrase Triggers"
description: "Configure Vocode actions to run based on spoken phrases by the agent"
title: "Action Triggers"
description: "Configure Vocode actions to run based on different triggers"
---

# Phrase Triggers

Phrase triggers allow users to more explicitly control the behavior of their agents by configuring actions to run only once a bot has spoken a particular phrase. For example, you can configure an agent to transfer a call to a human agent only after the bot has said "I will transfer now".

# Creating a phrase trigger
## Creating a phrase trigger

You can create a phrase trigger as follows:

Expand Down Expand Up @@ -36,7 +38,7 @@ In this example, the action that this phrase trigger is attached to will fire on

`"phrase_condition_type_contains"` is the only condition type supported at this time, and does not match case, so in the above example, if the bot said "Okay, you can speak to a human now", the phrase trigger would still fire.

# Configuring your action
## Configuring your action

```python
from vocode import (
Expand All @@ -57,7 +59,11 @@ vocode_client.agents.update_agent(
)
```

To switch back to the default behavior, use a `FunctionCallActionTrigger`.
# [Default] Function Call Triggers

To switch back to the default behavior, use a `FunctionCallActionTrigger`. These are open ended, meaning the
Agent will decide when to use the action based on its prompting. Note that is is primarily achieved via the [Prompt](/prompts)
but for [External Actions](/external-actions), it is also dependent on the description field.

```python
from vocode import FunctionCallActionTrigger
Expand Down
219 changes: 217 additions & 2 deletions docs/actions.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,221 @@
---
title: "Actions"
description: "🚧 Under construction"
description: "Give your agents the ability to execute actions"
---

#
Vocode agents can decide to take actions synchronously during calls. There are two ways to configure actions:

1. Phrase Triggers
2. Function Call Triggers (default)

See [Action Triggers](/action-triggers) for information on how to configure triggers. Below is the list of actions that an agent can perform:

#### EndConversation

`EndConversation` allows the agent to end the call, e.g. if the user says "Goodbye!"

<CodeGroup>

```python Python
vocode_client.actions.create_action(
request={
"type": "action_end_conversation",
}
)
```

```typescript TypeScript
const number = await vocode.actions.createAction({
type: "action_end_conversation",
});
```

```bash cURL
curl --request POST \
--url https://api.vocode.dev/v1/actions/create \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>'
--data '{
"type": "action_end_conversation"
}'
```

</CodeGroup>

#### DTMF

`DTMF` allows the agent to hit dial tones during a call, e.g. navigating a phone tree

<CodeGroup>

```python Python
vocode_client.actions.create_action(
request={
"type":"action_dtmf",
}
)
```

```typescript TypeScript
const number = await vocode.actions.createAction({
type: "action_dtmf",
});
```

```bash cURL
curl --request POST \
--url https://api.vocode.dev/v1/actions/create \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>'
--data '{
"type": "action_dtmf"
}'
```

</CodeGroup>

#### TransferCall

`TransferCall` allows the agent to transfer the call to another phone number

<CodeGroup>

```python Python
vocode_client.actions.create_action(
request={
"type":"action_transfer_call",
"config":{
"phone_number":"11234567890"
}
}
)
```

```typescript TypeScript
const number = await vocode.actions.createAction({
type: "action_transfer_call",
config: {
phoneNumber: "11234567890",
},
});
```

```bash cURL
curl --request POST \
--url https://api.vocode.dev/v1/actions/create \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>'
--data '{
"type": "action_transfer_call",
"config": {
"phone_number": "11234567890"
}
}'
```

</CodeGroup>

You can attach these as IDs to your phone number agent as follows:

<CodeGroup>

```python Python
from vocode import AgentUpdateParams

vocode_client.numbers.update_number(
phone_number="11234567890",
inbound_agent=AgentUpdateParams(
actions=["<ACTION UUID>"]
)
)
```

```typescript TypeScript
vocode.numbers.updateNumber({
phoneNumber: "11234567890",
inboundAgent: {
actions: ["<ACTION UUID>"],
},
});
```

```bash cURL
curl --request POST \
--url https://api.vocode.dev/v1/numbers/update?phone_number=11234567890 \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>'
--data '{
"inbound_agent": {
"actions": ["<ACTION UUID>"]
}
}'
```

</CodeGroup>

You can also add these as actions as raw payloads as follows:

<CodeGroup>

```python Python
from vocode import AgentUpdateParams, TransferCallActionUpdateParams

vocode_client.numbers.update_number(
phone_number="11234567890",
inbound_agent=AgentUpdateParams(
actions=[TransferCallActionUpdateParams(
type="action_transfer_call",
config={
"phone_number":"11234567890"
}
)]
)
)
```

```typescript TypeScript
vocode.numbers.updateNumber({
phoneNumber: "11234567890",
inboundAgent: {
actions: [
{
type: "action_transfer_call",
config: {
phoneNumber: "11234567890",
},
},
],
},
});
```

```bash cURL
curl --request POST \
--url https://api.vocode.dev/v1/numbers/update?phone_number=11234567890 \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>'
--data '{
"inbound_agent": {
"actions": [{
"type": "action_transfer_call",
"config": {
"phone_number": "11234567890"
}
}]
}
}'
```

</CodeGroup>

#### [Beta] ExternalAction

`ExternalAction` allows your agent communicate with an External API and include the response as context in the conversation.

See [External Actions](/external-actions).

#### [Beta] Warm Transfer

Allows your agent to conference in another party into the call.

See [Warm Transfer](/warm-transfer).
8 changes: 2 additions & 6 deletions docs/agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,5 @@ agent behavior:
- `initial_message` controls the agents first utterance.
- `initial_message_delay` adds a delay to the initial message from when the call begins
- `ask_if_human_present_on_idle` allows the agent to speak when there is more than 4s of silence on the call
- `llm_temperature` controls the behavior of the underlying language model. Values can range from X to Y, with higher
values leading to more consistent replies.

# Example: creating an agent

# Example: updating an agent
- `llm_temperature` controls the behavior of the underlying language model. Values can range from 0 to 1, with higher
values leading to more diverse and creative results. Lower values generate more consistent outputs.
4 changes: 0 additions & 4 deletions docs/call-object.mdx

This file was deleted.

8 changes: 0 additions & 8 deletions docs/inbound-calls.mdx

This file was deleted.

4 changes: 2 additions & 2 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@
"voices",
"webhooks",
"actions",
"action-triggers",
"conversational-dials",
"retrieve-call-data",
"phrase-triggers",
"warm-transfer",
"machine-detection",
"do-not-call-detection",
"bring-your-own-telephony",
Expand All @@ -206,6 +205,7 @@
"group": "Beta Features",
"pages": [
"external-actions",
"warm-transfer",
"multilingual",
"injecting-context",
"ivr-navigation",
Expand Down
4 changes: 0 additions & 4 deletions docs/outbound-calls.mdx

This file was deleted.

18 changes: 2 additions & 16 deletions docs/setting-up-webhook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,7 @@ update_response = vocode_client.agents.update_agent(
## Sample webhook server

In order to process the result of our webhook, we can set up a simple endpoint to receive
webhook messages from Vocode. In this example, our webhook server will listen for `PHONE_CALL_ENDED`
events and send notifications.

The webhook event body looks like this

```python
{
call_id: CALL_ID,
event:
}
```

```python
def process_webhook(event):
send_notification(event.call_id)
```
webhook messages from Vocode. [Webhook.site](https://webhook.site) makes it very easy to set up
a sample endpoint.

For a full list of webhook events and other capabilities, check out our guide on [Webhooks](/webhooks).
Loading

0 comments on commit 3f97e39

Please sign in to comment.