***

title: set_prompt_text
slug: /reference/python/agents/agent-base/set-prompt-text
description: Set the agent's system prompt as a raw text string.
max-toc-depth: 3
---------------------

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

[ai-prompt]: /docs/swml/reference/ai/prompt

[swml-prompt-reference]: /docs/swml/reference/ai/prompt

[ref-agentbase]: /docs/server-sdks/reference/python/agents/agent-base

Set the agent's system prompt as a raw text string. This is the simplest way to
configure what the AI knows and how it behaves.

<Info>
  This sets the SWML [`ai.prompt`][ai-prompt] field. See the
  [SWML prompt reference][swml-prompt-reference] for details on prompt behavior.
</Info>

<Warning>
  Cannot be mixed with POM-based prompt sections (`prompt_add_section()`) in the same
  agent. Use one approach or the other for the main prompt. Contexts can still be used
  alongside either approach.
</Warning>

## **Parameters**

<ParamField path="text" type="str" required={true} toc={true}>
  The complete system prompt text. Supports multi-line strings.
</ParamField>

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns self for method chaining.

## **Example**

```python {4}
from signalwire import AgentBase

agent = AgentBase(name="support", route="/support")
agent.set_prompt_text("""
You are a customer support agent for Acme Corp.
You help customers with billing questions, order tracking, and returns.
Always be polite and professional.
""")
agent.serve()
```