voicebot@v1
AI agent.
| Version | voicebot@v1 |
| Runs in | inbound-call and your own branches |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
voice | da-DK-Christel, da-DK-Jeppe, de-AT-Ingrid… (54 values) or string | See Voices & Audio accepts ${{ }} | ||
language | af-ZA, am-ET, ar-AE… (140 values) | Language for Speech Recognition and Text-to-Speech. See Voices & Audio accepts ${{ }} | ||
engine | object | yes | ||
engine.name | "OpenAI" | yes | ||
engine.auth | string | 1..255 characters | ||
engine.model | string | yes | 1..255 characters | |
engine.url | string | |||
engine.params | object | |||
engine.params.temperature | number | 0.2 | 0..2 · accepts ${{ }} | |
engine.params.maxCompletionTokens | integer | 0 | 0.. · accepts ${{ }} | |
pleaseWait | object | |||
pleaseWait.enabled | boolean | false | accepts ${{ }} | |
pleaseWait.delay | number | 4 | 0..30 · accepts ${{ }} | |
pleaseWait.sentences | array of string | 1..10 items · accepts ${{ }} | ||
stopSpeaking | object | |||
stopSpeaking.enabled | boolean | yes | true | accepts ${{ }} |
stopSpeaking.minWords | integer | 3 | 1..10 · accepts ${{ }} | |
initialMessages | array of object | yes | 1..32 items · accepts ${{ }} | |
initialMessages[].role | system, developer, assistant, user | yes | ||
initialMessages[].content | string | yes | 1..65536 characters | |
tools | array of object | 0..10 items | ||
tools[].name | string | yes | 1..32 characters | |
tools[].type | "url" | |||
tools[].url | string | yes | accepts ${{ }} | |
tools[].method | GET, POST, PUT, DELETE, PATCH | "GET" | ||
tools[].headers | object | |||
tools[].description | string | yes | 1..1024 characters | |
tools[].params | array of object | 0..10 items | ||
tools[].params[].name | string | yes | 1..32 characters | |
tools[].params[].type | string, number, boolean, object, array, null | yes | ||
tools[].params[].description | string | yes | 1..1024 characters |
Every parameter that accepts ${{ }} can be computed from an expression.
How it works
Voicebot is a powerful tool to create conversational flows.
You can also call external tools with URLs. The bot will call the URL with the parameters you specify. The URL should return a JSON object.
Examples
Short example
- action: voicebot@v1
params:
initialMessages:
- role: system
content: You are a smart AI agent on the phone. Make short replies
# all assistant initial messages will be said by the bot
- role: assistant
content: Hello there. How can I help?
engine:
name: OpenAI # the only supported engine for now
model: gpt-5.4-mini
auth: ${{ $openai_key }} # use your OpenAI keyThere are three built-in tools (functions)
dial(phone_number): to ask the bot to transfer the call to a humanhangup: to ask the bot to hang up the callset_value(name, value): to store a value and retrieve it in the result
Here is an example use of built-in tools:
- action: voicebot@v1
params:
initialMessages:
- role: system
content: You are a smart AI agent on the phone. Make short replies
- role: system
content: >
If the call wants to speak to a human, call the "dial" function with phone_number='+15559824200'.
If the user says goodbye or if the conversation is over, call the hangup function.
- role: assistant
content: Hello there. How can I help?
engine:
name: OpenAI
model: gpt-5.4-mini
auth: ${{ $openai_key }}
result: $bot
- if: $bot?.exitTool === 'dial'
then:
- action: dial@v2
params:
targets:
- number: ${{ $bot?.payload }}
timeout: 30
- if: $bot?.exitTool === 'hangup'
then:
- action: play@v3
params:
tts:
text: Thank you, goodbye!
- action: hangup@v1Full example with tools
variables:
$model: gpt-5.4
$openai_key: "your OpenAI key"
$url: "https://api.example.com"
branches:
inbound-call:
actions:
- action: voicebot@v1
params:
initialMessages:
- role: system
content: You are an AI agent on the phone. Make short replies
- role: system
content: >
If the call wants to speak to a human, call the "dial" function with phone_number='+15559824200'.
If the user says goodbye or if the conversation is over, call the hangup function.
- role: assistant
content: Hello there. How can I help?
engine:
name: OpenAI
model: ${{ $model }}
auth: ${{ $openai_key }}
params:
temperature: 0.2 # default value
maxCompletionTokens: 0 # default value
pleaseWait:
enabled: true
delay: 2.5
sentences:
- Please wait
tools:
- name: search_knowledge_base
url: ${{ $url }}/search_knowledge_base
description: >
Search into the knowledge base (RAG). Do not call this function when
looking for the next available slot.
method: GET # GET is the default if you do not specify a method
params: # parameters will be filled by the LLM
# in case of a GET, they will be sent as query args
- name: query
type: string
description: User query
- name: get_next_available_slot
url: ${{ $url }}/get_next_available_slot?from=${{ encodeURIComponent(call.fromNumber) }}
description: >
Returns the next available slot.
- name: book_slot
url: ${{ $url }}/book_slot
description: >
Books the slot.
method: POST
headers:
# you can specify custom HTTP headers
X-CallerID: ${{ call.fromNumber }}
Authorization: Bearer <token>
params:
# those parameters will be sent as a JSON body (because method != GET)
# and filled by the LLM
- name: name
type: string
description: Firstname and lastname
- name: object
type: string
description: Type of appointment
- name: slot
type: string
description: ISO 8601 date-time "YYYY-MM-DDTHH:MM:SSZ"
result: $botResult
Set result: $myVariable to keep it. Result of voicebot@v1
| Field | Type | Description |
|---|---|---|
ok | boolean | true when the bot ended the conversation with a tool (exitTool) |
timeout | boolean | true when the conversation did not end in time |
error | string | Only present on error: hangup when the caller hung up, canceled, or the error message |
exitTool | dial, hangup | Builtin tool the bot called to end the conversation |
payload | string | Argument of the exit tool: the phone number for dial, the reason for hangup |
messages | array of object | History of the conversation |
values | object | Values saved by the bot with the builtin tool set_value(name, value) |
totalTokens | integer | Number of tokens used |
{
"ok": true,
"timeout": false,
"exitTool": "dial",
"payload": "+33199004242",
"messages": [
{
"role": "assistant",
"content": "Hello, how can I help you?"
},
{
"role": "user",
"content": "I'd like to talk to sales"
}
],
"values": {
"topic": "sales"
},
"totalTokens": 1234
}Updated about 3 hours ago
Did this page help you?
