*** id: 59a7b21a-5b44-40bc-878e-906773a5dfc3 title: Receptionist sidebar-title: Receptionist slug: /python/guides/receptionist max-toc-depth: 3 ---------------- ## Receptionist ReceptionistAgent greets callers, collects their information, and transfers them to the appropriate department based on their needs. ### Basic Usage ```python from signalwire_agents.prefabs import ReceptionistAgent agent = ReceptionistAgent( departments=[ { "name": "sales", "description": "Product inquiries, pricing, and purchasing", "number": "+15551234567" }, { "name": "support", "description": "Technical help and troubleshooting", "number": "+15551234568" }, { "name": "billing", "description": "Payment questions and account issues", "number": "+15551234569" } ] ) if __name__ == "__main__": agent.run() ``` ### Department Format | Field | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------------- | | `name` | string | Yes | Department identifier (e.g., "sales") | | `description` | string | Yes | What the department handles | | `number` | string | Yes | Phone number for transfer | ### Constructor Parameters ```python ReceptionistAgent( departments=[...], # List of department dicts (required) name="receptionist", # Agent name route="/receptionist", # HTTP route greeting="Thank you for calling. How can I help you today?", voice="rime.spore", # Voice ID **kwargs # Additional AgentBase arguments ) ``` ### Built-in Functions ReceptionistAgent provides these SWAIG functions automatically: | Function | Description | | --------------------- | -------------------------------------------- | | `collect_caller_info` | Collect caller's name and reason for calling | | `transfer_call` | Transfer to a specific department | ### Call Flow Receptionist Flow. ### Complete Example ```python #!/usr/bin/env python3 ## company_receptionist.py - Custom receptionist agent from signalwire_agents.prefabs import ReceptionistAgent agent = ReceptionistAgent( departments=[ { "name": "sales", "description": "New orders, pricing, quotes, and product information", "number": "+15551001001" }, { "name": "support", "description": "Technical issues, troubleshooting, and product help", "number": "+15551001002" }, { "name": "billing", "description": "Invoices, payments, refunds, and account questions", "number": "+15551001003" }, { "name": "hr", "description": "Employment, careers, and benefits", "number": "+15551001004" } ], greeting="Thank you for calling Acme Corporation. How may I direct your call?", voice="rime.spore", name="acme-receptionist" ) ## Add custom prompt section agent.prompt_add_section( "Company", "You are the receptionist for Acme Corporation, a leading technology company." ) if __name__ == "__main__": 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