runner.md

import os
from guava import Agent, Runner

agent_a = Agent(name="Grace", purpose="You are a helpful voice agent.")
agent_b = Agent(name="Jordan", purpose="You are a helpful voice agent.")

runner = Runner()
runnner.listen_phone(agent_a, os.environ["GUAVA_AGENT_NUMBER"])
runnner.listen_webrtc(agent_b)
runnner.run()

Runner

guava.Runner lets you serve multiple agents in a single process. Each agent can be attached to any number of channels — phone, WebRTC, SIP, or outbound campaigns. Call run() to start everything and block until all channels exit.

Methods

Name Type Description
listen_phone(agent, agent_number) Runner Register an agent to receive inbound calls on the given phone number. Returns self for chaining.
listen_webrtc(agent, webrtc_code=None) Runner Register an agent to accept WebRTC connections. A new code is generated if webrtc_code is omitted. Returns self for chaining.
listen_sip(agent, sip_code) Runner Register an agent to receive inbound SIP calls on the given SIP code. Returns self for chaining.
attach_campaign(agent, campaign) Runner Attach an outbound campaign to an agent. Returns self for chaining.
run() None Start all registered channels in daemon threads and block until they all exit.

on_action_request() / on_action()