Receptionist

View as MarkdownOpen in Claude

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

Basic Usage

1from signalwire.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

Importing ReceptionistAgent

LanguageImport
Pythonfrom signalwire.prefabs import ReceptionistAgent
TypeScriptimport { ReceptionistAgent } from 'signalwire-agents'

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

Diagram showing the receptionist flow from greeting through caller info collection to department transfer.
Receptionist agent call flow.

Complete Example

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