docs/Runner

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.

run.py
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()
runner.listen_phone(agent_a, os.environ["GUAVA_AGENT_NUMBER"])
runner.listen_webrtc(agent_b)
runner.run()

Methods

ParameterTypeDefaultDescription
listen_phone(agent, agent_number)RunnerRegister an agent to receive inbound calls on the given phone number. Returns self for chaining.
listen_webrtc(agent, webrtc_code=None)RunnerRegister 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)RunnerRegister an agent to receive inbound SIP calls on the given SIP code. Returns self for chaining.
attach_campaign(agent, campaign)RunnerAttach an outbound campaign to an agent. Returns self for chaining.
run()NoneStart all registered channels in daemon threads and block until they all exit.

Questions? hi@goguava.ai