Jidoka.Instructions behaviour (Jidoka v0.9.0)

Copy Markdown View Source

Resolves instructions for one agent request.

Agent specifications keep stable, data-only instructions. A caller can pass instructions: at run time to replace them for one request. The value can be a non-empty string, a two-argument function, or a module that implements this behaviour.

A provider receives the base instructions and a public Jidoka.Context. The context contains request data and metadata. It does not contain trusted runtime data or internal request objects.

Summary

Types

provider()

@type provider() ::
  String.t() | (String.t(), Jidoka.Context.t() -> result()) | module()

result()

@type result() :: String.t() | {:ok, String.t()} | {:error, term()}

Callbacks

resolve(base_instructions, context)

@callback resolve(base_instructions :: String.t(), context :: Jidoka.Context.t()) ::
  result()