ServiceAgent
ServiceAgent is an AgentBase written as the operations it can do for
a caller. It owns an Operations service, available as agent.ops, and
installs it once, before the first SWML or tool request. On each SWML request it starts
the call’s record with the call’s medium and, when identify() has a prefill, the
caller already identified. FrontDeskAgent and
PersonalAssistantAgent are built on it.
Parameters
name
The agent’s name.
role
Who the agent is and how it sounds. Becomes the prompt’s Role section. Keyword-only.
**kwargs
Every Operations keyword argument (rules, wording,
confirm_gates, tool_fillers, gate_fillers, wrap, customize, namespace,
context, currency, money_format, medium), and every AgentBase argument
(route, host, port, and the rest).
Properties
ops
The service the agent owns.
Methods
These delegate to the owned service, with the same arguments as on
Operations: operation(), lookup(), identify(), writes_with(),
transfer_with(), offer(), phase(), and confirm_gates(). The methods that
return the service return the agent instead, so they chain.
compile
compile() installs the service on the agent once and returns the agent. It runs
before the first SWML or tool request, and is thread-safe, so concurrent first
requests wait for one install.
preview
preview() installs the service if needed and returns each generated step’s text and
tools, and the conscience, as plain text.