Jidoka.Effect.Result (Jidoka v0.9.0)

Copy Markdown View Source

Normalized result of an interpreted effect.

Summary

Functions

Builds a failed result for an effect intent.

Builds an effect result from keyword or map attributes.

Builds an effect result and raises if the attributes are invalid.

Builds a successful result for an effect intent.

Returns the Zoi schema for an interpreted effect result.

Types

t()

@type t() :: %Jidoka.Effect.Result{
  intent_id: binary(),
  kind: :llm | :operation,
  metadata: map(),
  output: any(),
  status: :ok | :error
}

Functions

error(intent, output, opts \\ [])

@spec error(Jidoka.Effect.Intent.t(), term(), keyword()) :: t()

Builds a failed result for an effect intent.

new(attrs)

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

Builds an effect result from keyword or map attributes.

new!(attrs)

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

Builds an effect result and raises if the attributes are invalid.

ok(intent, output, opts \\ [])

@spec ok(Jidoka.Effect.Intent.t(), term(), keyword()) :: t()

Builds a successful result for an effect intent.

schema()

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

Returns the Zoi schema for an interpreted effect result.