> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# PersonalAssistantAgent

> Answers the phone for one person, screens the caller, and rings the person with a whisper so they can take the call.

[service-agent]: /docs/server-sdks/reference/python/agents/operations/service-agent

[operations]: /docs/server-sdks/reference/python/agents/operations/operations

[appointments]: /docs/server-sdks/reference/python/agents/operations/appointments

[messages]: /docs/server-sdks/reference/python/agents/operations/messages

[info-bot]: /docs/server-sdks/reference/python/agents/operations/info-bot-knowledge

[wording]: /docs/server-sdks/reference/python/agents/operations/wording

`PersonalAssistantAgent` answers the phone for one person, built on
[`ServiceAgent`][service-agent]. It asks who is calling and what it's about, then rings
the person. The caller hears ringing. When the person answers, they hear a whisper
("Bo is calling about the contract. Press 1 to take the call.") and press the accept
key to take it, and the calls are joined. When the joined call ends, the caller's call
ends too.

If the person doesn't answer or doesn't take the call, the assistant carries on with
the caller and offers a message or a time on the calendar, from `messages` and
`appointments`. In a chat, nobody is put through.

```python
from signalwire.prefabs import PersonalAssistantAgent
```

## Parameters

**`name`** `str` — default: assistant

The agent's name.

---

**`role`** `str` — required

Keyword-only, as are all the parameters below. Who the agent is and how it sounds.

---

**`owner`** `str` — required

The person's name, as the assistant says it.

---

**`reach`** `str` — required

Where the person's calls go: a phone number in E.164 form, or a SIP address.

---

**`available`** `Callable[[CallContext], bool] | None` — default: None

`available(call)` returns whether the person is taking calls now. May be `async`.
When it returns false, the call isn't put through. `None` means always.

---

**`messages`** `Messages | None` — default: None

A [`Messages`][messages] pack, to take a message when the person doesn't take the
call.

---

**`appointments`** `Appointments | None` — default: None

An [`Appointments`][appointments] pack, for the person's calendar.

---

**`knowledge`** `InfoBotKnowledge | None` — default: None

An [`InfoBotKnowledge`][info-bot] to answer questions from.

---

**`caller_id`** `str | None` — default: None

The number the put-through call comes from. `None` shows the caller's own number to
the person.

---

**`ring_seconds`** `int` — default: 20

How long to ring the person.

---

**`answer_seconds`** `int` — default: 15

How long the person has, once they answer, to press the accept key.

---

**`whisper_voice`** `str | None` — default: None

The voice of the whisper. The platform's default when `None`.

---

**`whisper_language`** `str | None` — default: None

The whisper's language code, such as `"en-US"`. The platform's default when `None`.

---

**`accept_key`** `str` — default: 1

The keypad key the person presses to take the call: one of `0`-`9`, `*`, or `#`.
Anything else raises `ValueError`. Any other key, or none, ends the person's leg.

---

**`tool`** `str` — default: put_through

The put-through tool's name.

---

**`assistant_wording`** `Mapping[str, str] | None` — default: None

Replacements for the assistant's own words, keyed like
`PersonalAssistantAgent.WORDING`. See [wording][wording].

---

**`**kwargs`** `Any`

`ServiceAgent`'s arguments: every [`Operations`][operations] keyword argument and
every `AgentBase` argument.

---

## Example

```python
from signalwire.operations import Messages
from signalwire.prefabs import PersonalAssistantAgent

assistant = PersonalAssistantAgent(
    role="You answer Ann Lee's phone. You are friendly and brief.",
    owner="Ann",
    reach="+15550100002",
    messages=Messages(save=lambda call, message: print(message)),
)

if __name__ == "__main__":
    assistant.run()
```