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

1from signalwire import AgentBase
2from signalwire import FunctionResult
3
4agent = AgentBase(name="my-agent", route="/agent")
5agent.set_prompt_text("You are a helpful assistant.")
6
7@agent.tool(name="announce_status", description="Announce the order status")
8def announce_status(args, raw_data):
9 status = args.get("status")
10 return (
11 FunctionResult()
12 .say(f"Your order status is: {status}")
13 )
14
15agent.serve()