stop
Stop the agent execution immediately. This halts the AI from processing further and can be used to interrupt the current speech flow.
Parameters
None.
Returns
FunctionResult — self, for chaining.
Stop the agent execution immediately. This halts the AI from processing further and can be used to interrupt the current speech flow.
None.
FunctionResult — self, for chaining.
1 from signalwire import AgentBase 2 from signalwire import FunctionResult 3 4 agent = AgentBase(name="my-agent", route="/agent") 5 agent.set_prompt_text("You are a helpful assistant.") 6 7 @agent.tool(name="interrupt_and_restart", description="Interrupt and restart the conversation") 8 def interrupt_and_restart(args, raw_data): 9 return ( 10 FunctionResult() 11 .stop() 12 .say("Let me start over.") 13 ) 14 15 agent.serve()