CodeAct-style module backed by Imp.Sandbox and explicit tool iterations.
Each step asks the underlying ProgramOfThought planner for either a safe
program expression to evaluate or a tool plus arguments to observe
before the next step.
Tool execution is policy-gated like ReAct and Agent:
Imp.code_act("question -> answer", [lookup],
tool_policy: [:lookup],
max_iters: 4
)Unknown, denied, or crashing tools return structured errors with the redacted trace accumulated so far.
A call may override the constructor's iteration budget with :max_iters or
"max_iters". The control value is validated and is never exposed as a task
input to the planner.
Summary
Functions
Builds a bounded CodeAct predictor with an allowlisted tool catalog.
Types
@type t() :: %Imp.Predict.CodeAct{ max_iters: non_neg_integer(), program_of_thought: Imp.Predict.ProgramOfThought.t(), tool_policy: term(), tools: map() }