Jidoka.Turn.Result (Jidoka v0.9.0)

Copy Markdown View Source

Final app-facing result of one Jidoka turn.

Summary

Functions

Projects finished turn state into the public result contract.

Builds a turn result from keyword or map attributes.

Builds a turn result and raises if the attributes are invalid.

Returns the Zoi schema for a completed turn result.

Types

t()

@type t() :: %Jidoka.Turn.Result{
  agent_state: term(),
  content: binary(),
  events: [term()],
  journal: term(),
  metadata: map(),
  parts: [term()],
  usage: map(),
  value: nil | nil | any()
}

Functions

from_turn_state!(state)

@spec from_turn_state!(Jidoka.Turn.State.t()) :: t()

Projects finished turn state into the public result contract.

new(attrs)

@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}

Builds a turn result from keyword or map attributes.

new!(attrs)

@spec new!(keyword() | map()) :: t()

Builds a turn result and raises if the attributes are invalid.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for a completed turn result.