voicebot@v1

AI agent.

Versionvoicebot@v1
Runs ininbound-call and your own branches

Parameters

NameTypeRequiredDefaultDescription
voiceda-DK-Christel, da-DK-Jeppe, de-AT-Ingrid… (54 values) or stringSee Voices & Audio
accepts ${{ }}
languageaf-ZA, am-ET, ar-AE… (140 values)Language for Speech Recognition and Text-to-Speech. See Voices & Audio
accepts ${{ }}
engineobjectyes
engine.name"OpenAI"yes
engine.authstring1..255 characters
engine.modelstringyes1..255 characters
engine.urlstring
engine.paramsobject
engine.params.temperaturenumber0.20..2 · accepts ${{ }}
engine.params.maxCompletionTokensinteger00.. · accepts ${{ }}
pleaseWaitobject
pleaseWait.enabledbooleanfalseaccepts ${{ }}
pleaseWait.delaynumber40..30 · accepts ${{ }}
pleaseWait.sentencesarray of string1..10 items · accepts ${{ }}
stopSpeakingobject
stopSpeaking.enabledbooleanyestrueaccepts ${{ }}
stopSpeaking.minWordsinteger31..10 · accepts ${{ }}
initialMessagesarray of objectyes1..32 items · accepts ${{ }}
initialMessages[].rolesystem, developer, assistant, useryes
initialMessages[].contentstringyes1..65536 characters
toolsarray of object0..10 items
tools[].namestringyes1..32 characters
tools[].type"url"
tools[].urlstringyesaccepts ${{ }}
tools[].methodGET, POST, PUT, DELETE, PATCH"GET"
tools[].headersobject
tools[].descriptionstringyes1..1024 characters
tools[].paramsarray of object0..10 items
tools[].params[].namestringyes1..32 characters
tools[].params[].typestring, number, boolean, object, array, nullyes
tools[].params[].descriptionstringyes1..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 key

There are three built-in tools (functions)

  • dial(phone_number): to ask the bot to transfer the call to a human
  • hangup: to ask the bot to hang up the call
  • set_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@v1

Full 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: $bot

Result

Set result: $myVariable to keep it. Result of voicebot@v1

FieldTypeDescription
okbooleantrue when the bot ended the conversation with a tool (exitTool)
timeoutbooleantrue when the conversation did not end in time
errorstringOnly present on error: hangup when the caller hung up, canceled, or the error message
exitTooldial, hangupBuiltin tool the bot called to end the conversation
payloadstringArgument of the exit tool: the phone number for dial, the reason for hangup
messagesarray of objectHistory of the conversation
valuesobjectValues saved by the bot with the builtin tool set_value(name, value)
totalTokensintegerNumber 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
}

Did this page help you?