AgentsAgentBase

get_prompt

View as MarkdownOpen in Claude

Retrieve the current prompt. Returns a string if set_prompt_text() was used, or a POM structure (list of dictionaries) if prompt sections were used. If neither was explicitly set, returns a default prompt: "You are {name}, a helpful AI assistant.".

Parameters

None.

Returns

str | list[dict[str, Any]] — The current prompt in whatever format was configured.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="support", route="/support")
4agent.set_prompt_text("You are a customer support agent for Acme Corp.")
5prompt = agent.get_prompt()
6print(prompt)