Jido.AI.Reasoning.ReAct.RequestTransformer behaviour
(Jido AI v2.1.0)
View Source
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
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() }
@type request() :: %{ messages: [map()], llm_opts: keyword(), tools: Jido.AI.Reasoning.ReAct.ToolSelection.tools_input() }
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.