***

title: set_user_prompt
slug: /reference/python/agents/context-builder/context/set-user-prompt
description: Inject a user message when entering this context.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ref-context]: /docs/server-sdks/reference/python/agents/context-builder/context

Inject a user message when entering this context. Useful for triggering the AI to
speak first after a context switch.

## **Parameters**

<ParamField path="user_prompt" type="str" required={true} toc={true}>
  User message to inject.
</ParamField>

## **Returns**

[`Context`][ref-context] -- Self for method chaining.

## **Example**

```python {7}
from signalwire import AgentBase

agent = AgentBase(name="my-agent", route="/agent")

contexts = agent.define_contexts()
sales = contexts.add_context("default")
sales.set_user_prompt("I'd like to learn about your products.")
sales.add_step("pitch").set_text("Present our product lineup to the caller.")

agent.serve()
```