say

View as MarkdownOpen in Claude

Make the AI agent speak specific text immediately, bypassing the normal LLM response flow. The text is spoken in the agent’s configured voice.

Parameters

text
strRequired

Text for the agent to speak.

Returns

FunctionResult — self, for chaining.

Example

from signalwire import AgentBase
from signalwire import FunctionResult
agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")
@agent.tool(name="announce_status", description="Announce the order status")
def announce_status(args, raw_data):
status = args.get("status")
return (
FunctionResult()
.say(f"Your order status is: {status}")
)
agent.serve()