ReqManagedAgents.Outcome (ReqManagedAgents v0.8.0)

Copy Markdown View Source

A graded-session goal: a natural-language description of what to achieve and a rubric the provider grades the result against, optionally bounded by max_iterations revise cycles.

Pass it as the :outcome option to ReqManagedAgents.Session.run/2 (or start_link/2) to kick off a user.define_outcome graded session instead of a plain :prompt. A map with the same atom keys is accepted interchangeably.

Summary

Functions

Coerce a map or an existing %Outcome{} into a validated %Outcome{}.

Types

t()

@type t() :: %ReqManagedAgents.Outcome{
  description: String.t(),
  max_iterations: pos_integer() | nil,
  rubric: String.t()
}

Functions

new(outcome)

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

Coerce a map or an existing %Outcome{} into a validated %Outcome{}.

The single shape gate for the :outcome option: description and rubric must be binaries under atom keys; max_iterations is optional. Anything else returns {:error, :invalid_outcome}.