Jidoka.Effect.LLMDecision (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Typed model-side decision returned by an LLM effect.

The runtime uses a constrained decision protocol: a model either returns a final response or asks Jidoka to run one operation. Keeping that decision as a struct gives hibernate/resume a stable shape instead of relying on loose maps.

Summary

Types

decision_type()

@type decision_type() :: :final | :operation

t()

@type t() :: %Jidoka.Effect.LLMDecision{
  arguments: map(),
  content: nil | nil | binary(),
  metadata: map(),
  name: nil | nil | binary(),
  result: nil | nil | any(),
  type: (:final | :operation) | binary()
}

Functions

final(content, opts \\ [])

@spec final(
  String.t(),
  keyword()
) :: t()

from_input(decision)

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

new(attrs)

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

new!(attrs)

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

operation(name, arguments \\ %{}, opts \\ [])

@spec operation(String.t(), map(), keyword()) :: t()

schema()

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

to_payload(llm_decision)

@spec to_payload(t()) :: map()