Skip to main content

as_step_hook

Function
This function is defined in the middleware module.
Adapt a plain on_step callback into an after_model middleware hook. HooksConfig(on_step=...) advertises “called once per agent step”. An agent step is one model call, so the callback is routed onto the existing after_model middleware slot: it is invoked with the :class:ModelResponse for the step and its return value is ignored (the response passes through unchanged, so an observer can never corrupt the run).

Signature

Parameters

Callable
required
No description available.

Returns

AfterModelFn
The result of the operation.

Source

View on GitHub

praisonaiagents/hooks/middleware.py at line 318

Hooks Concept

Hook Events

Callbacks