1. Tasks
  2. Voice Command

Tasks

Voice Command

Sends a command to a live voice call. Useful for answering the caller, giving the assistant context or new instructions, muting the caller, and hanging up.

The command param picks what happens on the call. The call is started with Start Voice Chat, and reports back to the stub with the _update_from_voice feedback action.

command What it does
commentary The assistant says the content aloud, close to word for word
thinking Silent context the assistant can use later. Nothing is said aloud
instructions Trusted instructions that steer the assistant, may interrupt what it is saying
mute The assistant stops hearing the caller
unmute The assistant hears the caller again
hangup Ends the call once the assistant has finished speaking

The same commands are available as a voice notification, with the same params.

Basic usage

Answer a request the assistant handed to the stub, eg on the action that receives the GPT Chat Task's answer:

loading...

Common parameters

command
required
string

One of the commands below.


voice_session_uuid
optional
string

The voice call to send the command to. It must belong to this stub. The stub's latest call is in stub.data._com_platforms.voice.voice_session_uuid.

Default: the stub's live voice call


When the stub has no live voice call, or the call is already ending, the command fails and nothing happens on the call. After another stub took the call over with Voice Session Transfer, commands from this stub fail too: only the stub that has the call steers it.

Commands

commentary

Something for the assistant to say aloud, close to word for word, in its own voice. Commentary is the usual way to answer a request the assistant handed to the stub.

content
required
string

What the assistant should say. Long content is split into several parts automatically.

delegation_id
optional
string

Ties the content to a request the assistant handed to the stub. Use the delegation_id from the _update_from_voice that asked for it, eg {{stub.data._incoming_voice_data.delegation_id}}.

Without it, or when the id is empty or unknown, the content is context for the whole call.


thinking

Silent context the assistant keeps in mind and uses when it becomes relevant, eg facts it may need later. Nothing is said aloud.

content
required
string

The context to give the assistant. Long content is split into several parts automatically.

delegation_id
optional
string

Ties the content to a request the assistant handed to the stub, the same as for commentary.


instructions

Instructions that steer the assistant, eg to change what it may discuss or how it should behave. They're trusted, like the instructions the call started with, and the assistant acts on them straight away. They may interrupt what it is saying.

content
required
string

The instructions for the assistant. Long content is split into several parts automatically.

delegation_id
optional
string

Ties the content to a request the assistant handed to the stub, the same as for commentary.


mute

Mutes the caller, so the assistant stops hearing them, eg to put the caller on hold while the stub does something. The call stays up and the assistant can still speak. The caller stays muted until unmute.

The caller's channel can also mute the caller, eg with a mute button.


unmute

Unmutes the caller, so the assistant hears them again.


hangup

Ends the call once the assistant has finished speaking: when it has been quiet for a moment, or after 15 seconds at most. If the caller hasn't joined yet, the call ends straight away.

The task returns as soon as the hangup is accepted, not when the call has ended. The stub gets a final _update_from_voice with event: "session_ended" and reason: "stub_hangup" once it has.

content
optional
string

Instructions for the assistant before the call ends, eg "Say goodbye briefly."

Result

The task returns as soon as the command is sent. It doesn't wait for the assistant to act on it.

loading...
command message
commentary, thinking or instructions commentary appended, thinking appended or instructions appended
mute or unmute input muted or input unmuted
hangup hangup accepted, with payload.status: "hanging_up" until the call has ended

Properties

payload.voice_session_uuid
string

The voice call the command was sent to.


payload.event_ids
string[]

commentary, thinking and instructions only. One id per part the content was sent in.

Errors

message Meaning
unknown_voice_command command is missing or not one of the commands. error.details.commands lists them
content is required content is missing or empty, for commentary, thinking or instructions
no_active_voice_session The stub has no live voice call, or voice_session_uuid doesn't belong to this stub
voice_session_not_active The call is already ending
voice_session_transferred Another stub took the call over with Voice Session Transfer. error.details.stubref is the stub that has it now

Examples

Pass on caller details

loading...

Unlock a topic after verification

loading...

Put the caller on hold

Mute the caller while a slow lookup runs, and unmute them on the action that receives the result:

loading...

Say goodbye, then hang up

loading...