Jido.Agent.Strategy.Snapshot (Jido v2.0.0-rc.0)

View Source

Stable, cross-strategy execution snapshot.

Use this struct instead of inspecting agent.state.__strategy__ directly. This provides a stable interface that strategies can implement while freely evolving their internal state structures.

Fields

  • status - Coarse execution status (:idle, :running, :waiting, :success, :failure)
  • done? - Whether the strategy has reached a terminal state
  • result - The main output (if the strategy produces one)
  • details - Additional strategy-specific metadata

Summary

Functions

Returns true if the strategy is currently running.

Returns true if the strategy has reached a terminal state.

Types

t()

@type t() :: %Jido.Agent.Strategy.Snapshot{
  details: map(),
  done?: boolean(),
  result: term() | nil,
  status: Jido.Agent.Strategy.status()
}

Functions

running?(snapshot)

@spec running?(t()) :: boolean()

Returns true if the strategy is currently running.

terminal?(snapshot)

@spec terminal?(t()) :: boolean()

Returns true if the strategy has reached a terminal state.