Routes, retries, and falls back model calls at the LLM effect boundary.
Pass a policy with the model_policy: run option. A policy has an ordered
model list, an optional selector, and a retry policy. The selector receives
the model list and the trusted LLM context for each model call.
Model retries stay inside one LLM effect. They do not retry operation
effects. The winning decision and the effect result contain an ordered
:model_attempts list.
Summary
Functions
Returns the built-in failure class for a model error.
Builds a model policy from a keyword list or map.
Builds a model policy and raises if it is not valid.
Types
@type selector() :: ([LLMDB.Model.t()], Jidoka.Context.t() -> Jidoka.Config.model_spec() | [Jidoka.Config.model_spec()] | {:ok, term()} | {:error, term()}) | module() | nil
@type t() :: %Jidoka.ModelPolicy{ classify: classifier(), models: [LLMDB.Model.t()], retry: Jidoka.Workflow.RetryPolicy.t(), select: selector(), sleep: (non_neg_integer() -> term()) }
Callbacks
@callback classify(term()) :: :transient | :permanent
@callback select([LLMDB.Model.t()], Jidoka.Context.t()) :: Jidoka.Config.model_spec() | [Jidoka.Config.model_spec()] | {:ok, term()} | {:error, term()}
Functions
@spec classify(term()) :: :transient | :permanent
Returns the built-in failure class for a model error.
Builds a model policy from a keyword list or map.
Builds a model policy and raises if it is not valid.