Jidoka.Effect.Intent (Jidoka v0.9.0)

Copy Markdown View Source

Data description of an external effect the runtime may interpret.

Summary

Functions

Builds an effect intent from keyword or map attributes.

Builds a validated effect intent for a kind and payload.

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

Returns the Zoi schema for an effect intent.

Types

kind()

@type kind() :: :llm | :operation

t()

@type t() :: %Jidoka.Effect.Intent{
  id: binary(),
  idempotency: (((:pure | :idempotent) | :dedupe) | :reconcile) | :unsafe_once,
  idempotency_key: binary(),
  kind: :llm | :operation,
  metadata: map(),
  payload: map()
}

Functions

new(attrs)

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

Builds an effect intent from keyword or map attributes.

new(kind, payload, opts \\ [])

@spec new(kind(), map(), keyword()) :: t()

Builds a validated effect intent for a kind and payload.

new!(attrs)

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

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

schema()

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

Returns the Zoi schema for an effect intent.