BeamAgent.Run.Builder (beam_agent v0.1.0)

Copy Markdown View Source

Converts internal execution state into a structured BeamAgent.Run representation, capturing the goal, answer, status, trace, and timestamps of the agent's execution.

Summary

Functions

Builds a Run for a state that failed before ever reaching a reply (a guardrail tripped, context couldn't be compressed, an unknown tool was called, ...). verification_status is :not_run since verification never gets a chance to run.

Builds a Run with verification_status: :passed from a finished state. Used as the verification candidate before BeamAgent.Verifier runs against it.

Builds a Run with verification_status: :failed and the given reason recorded as verification_error.

Functions

execution_failed(state, reason)

@spec execution_failed(BeamAgent.State.t(), term()) :: BeamAgent.Run.t()

Builds a Run for a state that failed before ever reaching a reply (a guardrail tripped, context couldn't be compressed, an unknown tool was called, ...). verification_status is :not_run since verification never gets a chance to run.

success(state)

@spec success(BeamAgent.State.t()) :: BeamAgent.Run.t()

Builds a Run with verification_status: :passed from a finished state. Used as the verification candidate before BeamAgent.Verifier runs against it.

verification_failed(state, reason)

@spec verification_failed(BeamAgent.State.t(), term()) :: BeamAgent.Run.t()

Builds a Run with verification_status: :failed and the given reason recorded as verification_error.