Canonical structured result contract for Tree-of-Thoughts executions.
This module builds a stable result payload from machine state that is safe for SDK consumers and CLI projections.
Summary
Functions
Extracts the best answer string from a structured ToT result.
Builds a structured ToT result from machine state.
Returns ranked candidates from a structured ToT result.
Types
@type termination() :: %{ reason: atom() | nil, status: Jido.AI.Reasoning.TreeOfThoughts.Machine.external_status() | String.t() | nil, depth_reached: non_neg_integer(), node_count: non_neg_integer(), duration_ms: non_neg_integer() }
@type tree() :: %{ node_count: non_neg_integer(), frontier_size: non_neg_integer(), traversal_strategy: Jido.AI.Reasoning.TreeOfThoughts.Machine.traversal_strategy() | atom(), max_depth: pos_integer(), branching_factor: pos_integer() }
Functions
Extracts the best answer string from a structured ToT result.
@spec build( Jido.AI.Reasoning.TreeOfThoughts.Machine.t(), keyword() ) :: t()
Builds a structured ToT result from machine state.
@spec top_candidates(map() | nil, pos_integer()) :: [candidate()]
Returns ranked candidates from a structured ToT result.