gleamunison/generation_loop

Bounded generation over the one admitted publication path. Providers propose candidates; SAP, tests, evidence, and the branch decide.

Types

pub type Attempt {
  Attempt(
    prompt: String,
    number: Int,
    previous_error: option.Option(String),
  )
}

Constructors

  • Attempt(
      prompt: String,
      number: Int,
      previous_error: option.Option(String),
    )
pub type Outcome {
  Outcome(
    attempts: Int,
    prompt_ref: String,
    rendered_prompt: String,
    publication: agent_publish.Publication,
    dependents: List(String),
    target: option.Option(String),
  )
}

Constructors

pub type Plan {
  Plan(
    template: String,
    variables: List(#(String, String)),
    signature: ast.Type,
    max_attempts: Int,
    target: option.Option(String),
  )
}

Constructors

  • Plan(
      template: String,
      variables: List(#(String, String)),
      signature: ast.Type,
      max_attempts: Int,
      target: option.Option(String),
    )
pub type Provider =
  fn(Attempt) -> Result(String, String)

Values

pub fn generate_with_provider(
  adapter: storage.StorageAdapter,
  log_directory: String,
  branch: String,
  untrusted: Bool,
  plan: Plan,
  provider: fn(Attempt) -> Result(String, String),
) -> Result(Outcome, String)
pub fn json(outcome: Outcome) -> String
✨ Search Document