Public test helpers for deterministic Jido.AI ReAct tests.
expect_react/1 scripts the model boundary while the application still runs
its real ReAct runtime, tools, event projection, and assertions.
expect_react do
user "summarize README"
call "read", %{path: "README.md"}
answer "README says Hello."
endThe script is registered for the current test process tree and matched by the latest user prompt. For code that starts agents outside that tree, pass the returned script explicitly:
script =
expect_react do
user "summarize README"
answer "README says Hello."
end
MyAgent.ask_sync(pid, "summarize README", react_opts(script))
Summary
Functions
Adds the final scripted model answer.
Asserts that a collected ReAct result or event list ended with expected.
Asserts that a ReAct trace has no terminal runtime failure or cancellation.
Asserts that the ReAct trace includes a model-requested tool call.
Adds a scripted model tool call.
Starts a deterministic ReAct script and registers it for the current test.
Adds a terminal scripted model failure.
Returns ReqLLM generation opts for an explicit script.
Returns ReAct runtime opts for an explicit script.
Clears scripts registered by the current test process tree.
Adds the expected initial user prompt for a ReAct test script.
Functions
Adds the final scripted model answer.
Asserts that a collected ReAct result or event list ended with expected.
Asserts that a ReAct trace has no terminal runtime failure or cancellation.
Asserts that the ReAct trace includes a model-requested tool call.
Adds a scripted model tool call.
Starts a deterministic ReAct script and registers it for the current test.
Adds a terminal scripted model failure.
@spec react_llm_opts(Jido.AI.Test.ReActScript.t()) :: keyword()
Returns ReqLLM generation opts for an explicit script.
@spec react_opts(Jido.AI.Test.ReActScript.t()) :: keyword()
Returns ReAct runtime opts for an explicit script.
@spec reset_react_scripts() :: :ok
Clears scripts registered by the current test process tree.
@spec user(term()) :: :ok
Adds the expected initial user prompt for a ReAct test script.