Proposal
Proposal reads a change back to the caller and gates the tool that carries it out on
the caller’s yes. It takes two tools:
- A proposing tool returns
propose(). The change is recorded inglobal_data.semantic_state, and the agent says the read-back word for word, then waits for the caller. - The confirm tool gets the three semantic gates from
confirm_gates(), judged on the proposal’s dialogue. It runs only when the caller answered, the answer is a yes, and what they answered was a read-back of this change. Its handler returnscomplete().
When a gate fails, the model is told why, with the proposal quoted, and tool chaining
is turned off with back_to_back_functions(False) so the model answers
in words. Because that setting lasts for the call, propose(), ask_again(), and
complete() turn chaining back on with back_to_back_functions("forever"). An agent
that sets back_to_back_functions itself should allow for this.
Parameters
confirm_tool
The name of the tool that carries out the change.
decline_tool
Keyword-only. The tool that a no or a requested change goes to. It’s named in what the model is told when the caller doesn’t say yes.
threshold
Keyword-only. Each gate’s threshold. A yes/no gate wants about 0.8; with unclear,
about 0.6.
unclear
Keyword-only. True lets the gates answer unclear as well, which asks the caller
again. See unclear on SemanticGate.
Methods
To read the proposal a request carries, use current().
Example
The gates judge the proposal’s dialogue on their own, so the agent doesn’t need
set_semantic_gates(dialogue="proposal") for them.