Skip to main content

Module callbacks

Module callbacks 

Source
Expand description

Callback type aliases used by the runtime middleware pipeline.

The public middleware registration APIs accept boxed or shared closures with the signatures defined in this module. These aliases centralize those signatures so the runtime can compose tool and LLM middleware consistently across bindings.

Type Aliasesยง

EventSubscriberFn
Consume runtime lifecycle events after they are emitted.
LlmCollectorFn
Per-chunk collector used by the streaming LLM runtime.
LlmConditionalFn
Decide whether an LLM call is allowed to continue.
LlmExecutionFn
Wrap or replace non-streaming LLM execution.
LlmExecutionNextFn
Continuation type invoked by non-streaming LLM execution intercepts.
LlmFinalizerFn
Finalizer used to synthesize the aggregate streaming response payload.
LlmJsonStream
Stream of JSON chunks produced by the managed streaming LLM pipeline.
LlmRequestInterceptFn
Rewrite or annotate an LLM request before execution.
LlmSanitizeRequestFn
Sanitize an LLM request before the runtime records it.
LlmSanitizeResponseFn
Sanitize an LLM response before the runtime records it.
LlmStreamExecutionFn
Wrap or replace streaming LLM execution.
LlmStreamExecutionNextFn
Continuation type invoked by streaming LLM execution intercepts.
LlmStreamExecutionRegistryRef
Scope-local registry references passed into streaming execution-chain builders.
LlmStreamExecutionRegistryRefs
Slice of scope-local streaming execution registries.
ToolConditionalFn
Decide whether a tool call is allowed to continue.
ToolExecutionFn
Wrap or replace tool execution.
ToolExecutionNextFn
Continuation type invoked by tool execution intercepts.
ToolInterceptFn
Rewrite tool arguments before execution.
ToolSanitizeFn
Sanitize a tool request payload before the runtime records it.