View Source Agens.Job.Config (agens v0.2.0)

The Config struct defines the static shape of a Job.

Fields

  • :id - The unique identifier of the Job.
  • :description - An optional string added to the LM prompt that describes the goal of the Job.
  • :nodes - A map of node_id => Agens.Job.Node defining the workflow nodes.
  • :starting_node_id - The id of the Node that runs first when the Job is started.
  • :outputs - Optional output specification used when extracting structured data from the final Serving result.
  • :max_retries - Maximum retry attempts per Node before the Job errors out. Defaults to 3.

Summary

Functions

Builds a Agens.Job.Config from a JSON string.

Builds a Agens.Job.Config from a decoded map.

Validates a Agens.Job.Config. Raises ArgumentError on the first invariant violation. Currently enforces that every Node declares a non-nil :serving.

Types

@type t() :: %Agens.Job.Config{
  description: String.t() | nil,
  id: binary(),
  max_retries: non_neg_integer(),
  nodes: %{required(binary()) => Agens.Job.Node.t()},
  outputs: keyword() | nil,
  starting_node_id: binary()
}

Functions

@spec from_json(binary()) :: t()

Builds a Agens.Job.Config from a JSON string.

Delegates to from_map/1 after decoding with Jason.

@spec from_map(map()) :: t()

Builds a Agens.Job.Config from a decoded map.

String keys are expected. Each entry under "nodes" is converted via Agens.Job.Node.from_map/1.

@spec validate!(t()) :: t()

Validates a Agens.Job.Config. Raises ArgumentError on the first invariant violation. Currently enforces that every Node declares a non-nil :serving.