AgentsPrefabs

ReceptionistAgent

View as MarkdownOpen in Claude

Greets callers, collects basic information about their needs, and transfers them to the appropriate department. Uses FunctionResult.connect() for call transfers.

1from signalwire.prefabs import ReceptionistAgent
departments
list[dict[str, str]]Required

List of departments. At least one department is required. Each dict must have:

departments[].name
strRequired

Department identifier (e.g., "sales"). Used in the transfer tool’s enum.

departments[].description
strRequired

Description of what the department handles. Guides the AI in routing decisions.

departments[].number
strRequired

Phone number for call transfer (e.g., "+15551234567").

greeting
strDefaults to Thank you for calling. How can I help you today?

Initial greeting spoken to the caller.

voice
strDefaults to rime.spore

Voice ID for the agent’s language configuration.

name
strDefaults to receptionist

Agent name for identification and logging.

route
strDefaults to /receptionist

HTTP route for this agent.

Built-in Tools

ToolDescriptionParameters
collect_caller_infoRecord the caller’s name and reason for callingname (str), reason (str)
transfer_callTransfer the caller to a departmentdepartment (str, one of the registered department names)

The transfer_call tool uses FunctionResult.connect() with final=True, which permanently transfers the call out of the agent. The AI speaks a goodbye message before the transfer executes.

Example

1from signalwire.prefabs import ReceptionistAgent
2
3agent = ReceptionistAgent(
4 departments=[
5 {"name": "sales", "description": "New orders, pricing, and product information", "number": "+15551001001"},
6 {"name": "support", "description": "Technical issues and troubleshooting", "number": "+15551001002"},
7 {"name": "billing", "description": "Invoices, payments, and refunds", "number": "+15551001003"},
8 {"name": "hr", "description": "Employment, careers, and benefits", "number": "+15551001004"}
9 ],
10 greeting="Thank you for calling Acme Corporation. How may I direct your call?",
11 voice="rime.spore",
12 name="acme-receptionist"
13)
14
15agent.prompt_add_section("Company", "You are the receptionist for Acme Corporation.")
16
17if __name__ == "__main__":
18 agent.run()