> 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. # setPromptText > Set the agent's system prompt as a raw text string. [ai-prompt]: /docs/swml/reference/calling/ai/prompt [swml-prompt-reference]: /docs/swml/reference/calling/ai/prompt [ref-agentbase]: /docs/server-sdks/reference/typescript/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. > **Warning** > > Mixing raw text prompts with POM-based prompt sections (`promptAddSection()`) in the > same agent may produce unexpected results. Use one approach or the other for the main > prompt. Contexts can still be used alongside either approach. ## **Parameters** **`text`** `string` — required The complete system prompt text. Supports multi-line strings. --- ## **Returns** [`AgentBase`][ref-agentbase] -- Returns `this` for method chaining. ## **Example** ```typescript {4} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'support', route: '/support' }); agent.setPromptText(` You are a customer support agent for Acme Corp. You help customers with billing questions, order tracking, and returns. Always be polite and professional. `); await agent.serve(); ``` > Set the agent's system prompt as a raw text string.