跳到主要内容

Live Voice Call

The hosted web app has a Ligar (Call) button next to the composer. It opens a real-time, two-way voice call: you talk, the assistant answers out loud, and you can interrupt it mid-sentence. This is different from the waveform button, which records a message, sends it, waits, and speaks the reply back.

The voice is Gemini Live. For anything that needs action — WhatsApp, files, the web, skills — the voice hands the request to the real Ailiv agent in the background, and then speaks the result. Each call becomes a session titled Ligação HH:MM in the sidebar, with the delegated work as its history.

Setup​

Put a Gemini API key in the container environment (never in config.yaml):

GEMINI_API_KEY=your-key # GOOGLE_API_KEY is also accepted

The button appears once the server reports calls as available (GET /api/live/config). With no key, or with live.enabled: false, it stays hidden.

Configuration​

All keys live under live: in config.yaml; every one is optional.

KeyDefaultMeaning
enabledtrueTurn calls off for a profile.
modelgemini-3.1-flash-live-previewThe Gemini Live model. The flash tier keeps cost down.
voiceKoreGemini prebuilt voice.
max_seconds600Hard cap per call. Every open call is a paid audio stream.
idle_seconds120Hang up after this long with nobody speaking. Agent work does not count as silence.
max_concurrent2Simultaneous calls per backend.
tool_timeout_seconds180Longest a delegated request may run before it is stopped.
tool_schedulingINTERRUPTHow a finished task is announced: INTERRUPT, WHEN_IDLE or SILENT.
persona""Extra instructions for the voice.
save_transcripttrueKeep what was said as a session titled Transcrição da ligação HH:MM.
finish_tasks_after_hanguptrueA request already handed to an agent keeps running after the person hangs up; its result lands in that agent's session. Off: hanging up stops it.
background_seconds900How long such a task may keep running after the hang-up before it is stopped.

Talking to other agents​

The voice takes on the agent the call is with (its name and description) and every request goes to that agent. To reach a different agent, say its name: "peça ao Whats Fabio para avisar o Tiago". The voice forwards the request to that agent, in its own session inside the call, and the call screen shows Trabalhando com Whats Fabio… while it works.

An agent is only honoured if the person actually said its name. The voice model tends to pick an agent by topic ("my WhatsApp" → the WhatsApp agent) even when told not to, so the server checks the call transcript (accent- and case-insensitive, and tolerant of a name glued into one word) and otherwise keeps the request with the call's own agent.

Hanging up while an agent works​

If you hand something to an agent and hang up ("deixa o Whats Fabio rodando, vou desligar"), the request keeps running on the server and the result is saved in that agent's session (open it from the sessions list). It is stopped if it outlives background_seconds. No new request starts after the hang-up, and approvals the agent asks for are still denied, since nobody is there to answer. With finish_tasks_after_hangup: false, hanging up interrupts the task instead, and the voice says so when asked.

How it stays safe​

  • The key never reaches the browser. The page streams microphone audio to the Ailiv backend over an authenticated WebSocket (/api/live/call, single-use ticket), and the backend holds the Gemini connection.
  • Nobody can click an approval during a call. A dangerous action the agent asks to run is denied, and the voice tells you to approve it in the chat. A clarifying question from the agent is answered with an instruction to pick the sensible default and say what was assumed.
  • Cost is bounded by max_seconds, idle_seconds and max_concurrent.
  • Audio is not stored. The server logs only the call's duration, how it ended, token totals and the number of delegated tasks — never what was said.
  • With save_transcript on, the conversation is written as a session (Transcrição da ligação HH:MM) in the same store as the profile's chats, so it can be read later; turn it off for profiles that must not keep it.

Notes​

The default model is a preview release, so Google may change it without notice; pin another with live.model if needed. Microphone access requires HTTPS.