Jidoka.Agent.Spec (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Canonical immutable definition of a Jidoka agent.

Summary

Types

t()

@type t() :: %Jidoka.Agent.Spec{
  context_schema: nil | nil | any(),
  controls: term(),
  generation: term(),
  id: binary(),
  instructions: binary(),
  memory: nil | nil | term(),
  metadata: map(),
  model: term(),
  operations: [term()],
  result: nil | nil | term(),
  runtime_defaults: map()
}

Functions

from_input(spec)

@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()

schema()

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

validate_context(spec, context)

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

validate_operation_policies(spec)

@spec validate_operation_policies(t()) :: :ok | {:error, term()}

validate_operation_policy(spec, operation)

@spec validate_operation_policy(t(), Jidoka.Agent.Spec.Operation.t()) ::
  :ok | {:error, term()}

validate_result(spec, value)

@spec validate_result(t(), term()) :: {:ok, term()} | {:error, term()}