Skip to navigation
AgentsPrefabs

FrontDeskAgent

View as MarkdownOpen in Claude

FrontDeskAgent is a business’s front desk, built on ServiceAgent. It puts callers through to the department they ask for while that department takes calls, books appointments, takes messages, and answers from documents, each when you give it the matching part.

The departments become a transfer_to_human tool with a to argument listing the department names. The tool runs as soon as the caller names a department, without first asking whether they want a person. An open department is reached with a permanent connect transfer (final=True), so the call leaves the agent. A closed department, or a request from a chat, is refused, and the model offers a message when there’s a Messages pack.

from signalwire.prefabs import Department, FrontDeskAgent

Parameters

name
strDefaults to front_desk

The agent’s name.

role
strRequired

Keyword-only, as are all the parameters below. Who the agent is and how it sounds. Becomes the prompt’s Role section.

departments
Mapping[str, Department] | NoneDefaults to None

Where callers can be put through to, keyed by the name callers use for each.

appointments
Appointments | NoneDefaults to None

An Appointments pack, to book appointments.

messages
Messages | NoneDefaults to None

A Messages pack, to take messages and to offer one when a department isn’t taking calls.

knowledge
InfoBotKnowledge | NoneDefaults to None

An InfoBotKnowledge to answer from the business’s documents. Offered before the caller is identified.

caller_id
str | NoneDefaults to None

The number calls put through come from. The platform’s default when None.

desk_wording
Mapping[str, str] | NoneDefaults to None

Replacements for the desk’s own words, keyed like FrontDeskAgent.WORDING. See wording.

**kwargs
Any

ServiceAgent’s arguments: every Operations keyword argument (rules, wording, currency, medium, and the rest) and every AgentBase argument.

Department

Department(description, to, open=None) is a frozen dataclass for one place the desk puts callers through to.

Department.description
strRequired

What callers go to it for, as the model reads it: “questions about a bill”.

Department.to
strRequired

Where the call goes: a phone number in E.164 form, or a SIP address.

Department.open
Callable[[CallContext], bool] | NoneDefaults to None

open(call) returns whether the department takes calls now. May be async. None means always.

Example

from signalwire.operations import Messages
from signalwire.prefabs import Department, FrontDeskAgent
def billing_open(call):
return True # replace with your own business-hours check
desk = FrontDeskAgent(
role="You answer the phone for Bayside Dental. You are warm and brief.",
departments={
"billing": Department("questions about a bill", "+15550100001", open=billing_open),
},
messages=Messages(save=lambda call, message: print(message)),
)
if __name__ == "__main__":
desk.run()