A scriptable Agentix.Provider for deterministic tests — no API key, no network.
Enqueue response specs with script/1; each stream/3 call pops the next one
(FIFO) and records the request. Build specs with Agentix.Test.completion/2 (a
successful turn, optionally carrying a structured :object) or Agentix.Test.error/2
/ Agentix.Test.transport_error/1 (a failed stream/3 returning {:error, reason}).
Sequencing a list — script([error(503), error(503), completion("ok")]) — drives the
fail-N-then-succeed scenarios the retry path needs.
Process-based and globally named, so drive it from a single test process and run
those tests async: false. Start it with start_supervised!(Agentix.Test.MockProvider)
(or Agentix.Test.install_mock_provider/0).
Summary
Functions
Returns a specification to start this module under a supervisor.
The requests received so far, oldest first.
Clear scripts and recorded requests.
Enqueue one response spec (a map from Agentix.Test.completion/2) or a list of
them, consumed FIFO by stream/3.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec requests() :: [map()]
The requests received so far, oldest first.
@spec reset() :: :ok
Clear scripts and recorded requests.
Enqueue one response spec (a map from Agentix.Test.completion/2) or a list of
them, consumed FIFO by stream/3.
@spec start_link(keyword()) :: Agent.on_start()