Behavior for advanced per-turn ReAct request shaping.
A request transformer can inspect the current runtime state and tool context before each LLM turn, then return request overrides.
This is intended for patterns such as:
- request-scoped tool gating
- dynamic structured-output schemas
- provider-specific
llm_optsbased on tool results - custom message projection beyond the default context rendering
- per-turn model selection — returning
model:in the overrides swaps which provider handles the next LLM turn.llm_opts.provider_optionsoverrides are re-validated against the selected model's provider schema, so xAI-only keys (e.g.xai_api) can be added on xAI turns without breaking Fireworks turns on the same agent.
The runtime always regenerates llm_opts[:tools] from the returned tools
field so the exposed LLM tools and execution registry stay aligned.
Summary
Functions
Fingerprint a validated transformer for checkpoint compatibility.
Validate a request transformer module.
Types
@type overrides() :: %{ optional(:messages) => [map()], optional(:llm_opts) => keyword() | map(), optional(:tools) => Jido.AI.Reasoning.ReAct.ToolSelection.tools_input(), optional(:model) => term() }
@type request() :: %{ messages: [map()], llm_opts: keyword(), tools: Jido.AI.Reasoning.ReAct.ToolSelection.tools_input(), model: term() }
Callbacks
@callback transform_request( request(), Jido.AI.Reasoning.ReAct.State.t(), Jido.AI.Reasoning.ReAct.Config.t(), map() ) :: {:ok, overrides()} | {:error, term()}
Functions
Fingerprint a validated transformer for checkpoint compatibility.
@spec validate(module() | nil) :: {:ok, module() | nil} | {:error, :invalid_request_transformer} | {:error, {:request_transformer_not_loaded, module()}} | {:error, {:request_transformer_missing_callback, module()}}
Validate a request transformer module.