Skip to navigation

complete

View as MarkdownOpen in Claude

Record that the change was carried out, in place of the proposal. The result sets global_data.semantic_state to {"done": summary}, and its first action turns tool chaining back on with back_to_back_functions("forever").

Write what was done rather than clearing the state: a state that changes starts the next proposal dialogue there, and the model and the gates see what’s settled.

Parameters

summary
strRequired

What was done, such as "Order 4471 is placed". Without result, it’s also the tool result the model gets.

result
FunctionResult | NoneDefaults to None

The confirm tool’s result, to add to.

Returns

FunctionResult — The confirm tool’s result.

Example

from signalwire import FunctionResult
from signalwire.patterns import Proposal
order = Proposal("place_order", decline_tool="review_order")
def place_order(args, raw_data):
return order.complete("Order 4471 is placed",
FunctionResult("Order 4471 is placed.").swml_change_step("done"))
{"response": "Order 4471 is placed.",
"action": [{"back_to_back_functions": "forever"},
{"change_step": "done"},
{"set_global_data": {"semantic_state": {"done": "Order 4471 is placed"}}}]}