gleamunison/llm_controls

Primitive controls shared by ambient/CLI provider configuration and retry composition. No provider registry or dependency on llm types.

Types

pub type EnvLookup =
  fn(String) -> Result(String, Nil)

Values

pub fn attempts(value: Int) -> Int
pub fn env_or(
  env: fn(String) -> Result(String, Nil),
  key: String,
  fallback: String,
) -> String
pub fn resolve(
  anthropic: Bool,
  env: fn(String) -> Result(String, Nil),
) -> Result(#(String, String, String, Int, Int, String), String)
pub fn retry_delay(base: Int, attempt: Int) -> Int
pub fn retryable(reason: BitArray) -> Bool
pub fn validate(
  anthropic: Bool,
  url: String,
  key: String,
  model: String,
  tokens: Int,
  timeout_ms: Int,
  effort: String,
) -> Result(Nil, String)
✨ Search Document