set_post_process

View as MarkdownOpen in Claude

Enable or disable post-processing after construction. When post-processing is enabled, the AI speaks the response and takes one more conversational turn with the user before executing actions. This is useful for confirmation workflows.

Parameters

post_process
boolRequired

True to let the AI respond once more before executing actions. False to execute actions immediately.

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="transfer_with_confirmation", description="Transfer with confirmation")
8def transfer_with_confirmation(args, raw_data):
9 return (
10 FunctionResult("I'll transfer you to billing. Do you have any other questions first?")
11 .set_post_process(True)
12 .connect("+15551234567", final=True)
13 )
14
15agent.serve()