Receptionist

View as MarkdownOpen in Claude

Receptionist

ReceptionistAgent greets callers, collects their information, and transfers them to the appropriate department based on their needs.

Basic Usage

1from signalwire_agents.prefabs import ReceptionistAgent
2
3agent = ReceptionistAgent(
4 departments=[
5 {
6 "name": "sales",
7 "description": "Product inquiries, pricing, and purchasing",
8 "number": "+15551234567"
9 },
10 {
11 "name": "support",
12 "description": "Technical help and troubleshooting",
13 "number": "+15551234568"
14 },
15 {
16 "name": "billing",
17 "description": "Payment questions and account issues",
18 "number": "+15551234569"
19 }
20 ]
21)
22
23if __name__ == "__main__":
24 agent.run()

Department Format

FieldTypeRequiredDescription
namestringYesDepartment identifier (e.g., “sales”)
descriptionstringYesWhat the department handles
numberstringYesPhone number for transfer

Constructor Parameters

1ReceptionistAgent(
2 departments=[...], # List of department dicts (required)
3 name="receptionist", # Agent name
4 route="/receptionist", # HTTP route
5 greeting="Thank you for calling. How can I help you today?",
6 voice="rime.spore", # Voice ID
7 **kwargs # Additional AgentBase arguments
8)

Built-in Functions

ReceptionistAgent provides these SWAIG functions automatically:

FunctionDescription
collect_caller_infoCollect caller’s name and reason for calling
transfer_callTransfer to a specific department

Call Flow

Receptionist Flow.
Receptionist Flow

Complete Example

1#!/usr/bin/env python3
2## company_receptionist.py - Custom receptionist agent
3from signalwire_agents.prefabs import ReceptionistAgent
4
5
6agent = ReceptionistAgent(
7 departments=[
8 {
9 "name": "sales",
10 "description": "New orders, pricing, quotes, and product information",
11 "number": "+15551001001"
12 },
13 {
14 "name": "support",
15 "description": "Technical issues, troubleshooting, and product help",
16 "number": "+15551001002"
17 },
18 {
19 "name": "billing",
20 "description": "Invoices, payments, refunds, and account questions",
21 "number": "+15551001003"
22 },
23 {
24 "name": "hr",
25 "description": "Employment, careers, and benefits",
26 "number": "+15551001004"
27 }
28 ],
29 greeting="Thank you for calling Acme Corporation. How may I direct your call?",
30 voice="rime.spore",
31 name="acme-receptionist"
32)
33
34## Add custom prompt section
35agent.prompt_add_section(
36 "Company",
37 "You are the receptionist for Acme Corporation, a leading technology company."
38)
39
40if __name__ == "__main__":
41 agent.run()

Best Practices

Departments

  • Use clear, distinct department names
  • Write descriptions that help AI route correctly
  • Include common reasons in descriptions
  • Verify transfer numbers are correct

Greeting

  • Keep greeting professional and welcoming
  • Include company name if appropriate
  • Ask how to help (prompts caller to state need)

Transfers

  • Always confirm before transferring
  • Use final=True for permanent transfers
  • Test all transfer numbers