← all modules

Std.Ai.Agent

Std.Ai.Agent

Types
  type alias Input = { messages : List Message }
  type alias Output = { answer : String , usage : Provider.Usage }
  type alias Options
  type alias Journalled a = { response : a , facts : Provider.CallFacts }
  type alias ToolOutput = { answer : String }
  type Action
  type alias Parsed = { tool : Maybe String , args : Maybe String , answer : Maybe String }

Values
  defaultOptions : Options
      No tracing.
  inputCodec : Codec Input
  nativeToolLoop : String -> Provider -> String -> List Tool -> Int -> Durable.WorkflowDef Input ToolOutput
      Like `toolLoop`, but uses the provider's NATIVE function-calling API
  nativeToolLoopWith : Options -> String -> Provider -> String -> List Tool -> Int -> Durable.WorkflowDef Input ToolOutput
      `nativeToolLoop` with `Options` (tracing).
  oneShot : String -> Provider -> String -> Durable.WorkflowDef Input Output
      A one-shot durable agent: prepend `systemPrompt`, call `provider` once inside
  oneShotWith : Options -> String -> Provider -> String -> Durable.WorkflowDef Input Output
      `oneShot` with `Options` (tracing).
  outputCodec : Codec Output
  structuredToolLoop : Provider.ResponseShape a -> String -> Provider -> String -> List Tool -> Int -> Durable.WorkflowDef Input a
      `nativeToolLoop` whose final answer has a shape: each model turn asks for
  structuredToolLoopWith : Options -> Provider.ResponseShape a -> String -> Provider -> String -> List Tool -> Int -> Durable.WorkflowDef Input a
      `structuredToolLoop` with `Options` (tracing).
  toolLoop : String -> Provider -> String -> List Tool -> Int -> Durable.WorkflowDef Input ToolOutput
      A tool-calling agent as a durable workflow. The model is told the `tools` and
  toolLoopWith : Options -> String -> Provider -> String -> List Tool -> Int -> Durable.WorkflowDef Input ToolOutput
      `toolLoop` with `Options` (tracing).