ExAgent.Models.Test (ExAgent v0.1.0)

Copy Markdown View Source

A deterministic, in-process model for development and tests.

Drop-in replacement for a real provider: it never hits the network and returns scripted (or default) Message.Responses. This is the workhorse that lets the agent loop be developed and unit-tested offline.

Configuration:

  • %Test{} — always replies with a generic text response.
  • %Test{label: "x"} — replies with the fixed string "x" as text.
  • %Test{script: [...]} — returns each item in order; an item may be a Message.Response, a string (wrapped as a text part), a {:tool_calls, [ToolCall]} tuple, or a function fn messages, params -> item.

When the script is exhausted, it falls back to the default response.

Summary

Types

script_item()

t()

@type t() :: %ExAgent.Models.Test{
  index: non_neg_integer(),
  label: String.t() | nil,
  received: [term()],
  script: [script_item()]
}