Jido.Agent.Strategy.InstructionTracking (Jido v2.3.0)

Copy Markdown View Source

Shared instruction-thread tracking helpers for strategy implementations.

Appends :instruction_start / :instruction_end entries when a thread is present in the agent state and provides a consistent payload shape.

Summary

Functions

Append an :instruction_end thread entry.

Append an :instruction_start thread entry.

Conditionally append :instruction_end when thread tracking is enabled.

Conditionally append :instruction_start when thread tracking is enabled.

Functions

append_instruction_end(agent, instruction, status)

@spec append_instruction_end(Jido.Agent.t(), Jido.Instruction.t(), atom()) ::
  Jido.Agent.t()

Append an :instruction_end thread entry.

append_instruction_start(agent, instruction)

@spec append_instruction_start(Jido.Agent.t(), Jido.Instruction.t()) :: Jido.Agent.t()

Append an :instruction_start thread entry.

maybe_append_instruction_end(agent, instruction, status)

@spec maybe_append_instruction_end(Jido.Agent.t(), Jido.Instruction.t() | nil, atom()) ::
  Jido.Agent.t()

Conditionally append :instruction_end when thread tracking is enabled.

maybe_append_instruction_start(agent, instruction)

@spec maybe_append_instruction_start(Jido.Agent.t(), Jido.Instruction.t()) ::
  Jido.Agent.t()

Conditionally append :instruction_start when thread tracking is enabled.