Expand description
Global and scope-local middleware registration helpers. Middleware registry helpers for global and scope-local guardrails, intercepts, and subscribers.
Structs§
- Execution
Intercept - A priority-ordered execution intercept registration entry.
- Guardrail
Entry - A priority-ordered guardrail registration entry.
- Intercept
- A priority-ordered request intercept registration entry.
Functions§
- deregister_
llm_ conditional_ execution_ guardrail - Deregister a global LLM conditional-execution guardrail.
- deregister_
llm_ execution_ intercept - Deregister a global LLM execution intercept.
- deregister_
llm_ request_ intercept - Deregister a global LLM request intercept.
- deregister_
llm_ sanitize_ request_ guardrail - Deregister a global LLM sanitize-request guardrail.
- deregister_
llm_ sanitize_ response_ guardrail - Deregister a global LLM sanitize-response guardrail.
- deregister_
llm_ stream_ execution_ intercept - Deregister a global streaming LLM execution intercept.
- deregister_
tool_ conditional_ execution_ guardrail - Deregister a global tool conditional-execution guardrail.
- deregister_
tool_ execution_ intercept - Deregister a global tool execution intercept.
- deregister_
tool_ request_ intercept - Deregister a global tool request intercept.
- deregister_
tool_ sanitize_ request_ guardrail - Deregister a global tool sanitize-request guardrail.
- deregister_
tool_ sanitize_ response_ guardrail - Deregister a global tool sanitize-response guardrail.
- register_
llm_ conditional_ execution_ guardrail - Register a global LLM conditional-execution guardrail. The guardrail can block LLM execution before intercepts or the provider callback run.
- register_
llm_ execution_ intercept - Register a global LLM execution intercept. Execution intercepts can wrap or replace the non-streaming provider callback.
- register_
llm_ request_ intercept - Register a global LLM request intercept. Request intercepts can rewrite or annotate the outgoing LLM request.
- register_
llm_ sanitize_ request_ guardrail - Register a global LLM sanitize-request guardrail. The guardrail rewrites only the request payload recorded on emitted start events.
- register_
llm_ sanitize_ response_ guardrail - Register a global LLM sanitize-response guardrail. The guardrail rewrites only the response payload recorded on emitted end events.
- register_
llm_ stream_ execution_ intercept - Register a global streaming LLM execution intercept. Execution intercepts can wrap or replace the streaming provider callback.
- register_
tool_ conditional_ execution_ guardrail - Register a global tool conditional-execution guardrail. The guardrail can block tool execution before intercepts or the tool callback run.
- register_
tool_ execution_ intercept - Register a global tool execution intercept. Execution intercepts can wrap or replace the tool callback.
- register_
tool_ request_ intercept - Register a global tool request intercept. Request intercepts can rewrite tool arguments before execution.
- register_
tool_ sanitize_ request_ guardrail - Register a global tool sanitize-request guardrail. The guardrail rewrites only the tool input recorded on emitted start events.
- register_
tool_ sanitize_ response_ guardrail - Register a global tool sanitize-response guardrail. The guardrail rewrites only the tool output recorded on emitted end events.
- scope_
deregister_ llm_ conditional_ execution_ guardrail - Deregister a scope-local LLM conditional-execution guardrail.
- scope_
deregister_ llm_ execution_ intercept - Deregister a scope-local LLM execution intercept.
- scope_
deregister_ llm_ request_ intercept - Deregister a scope-local LLM request intercept.
- scope_
deregister_ llm_ sanitize_ request_ guardrail - Deregister a scope-local LLM sanitize-request guardrail.
- scope_
deregister_ llm_ sanitize_ response_ guardrail - Deregister a scope-local LLM sanitize-response guardrail.
- scope_
deregister_ llm_ stream_ execution_ intercept - Deregister a scope-local streaming LLM execution intercept.
- scope_
deregister_ tool_ conditional_ execution_ guardrail - Deregister a scope-local tool conditional-execution guardrail.
- scope_
deregister_ tool_ execution_ intercept - Deregister a scope-local tool execution intercept.
- scope_
deregister_ tool_ request_ intercept - Deregister a scope-local tool request intercept.
- scope_
deregister_ tool_ sanitize_ request_ guardrail - Deregister a scope-local tool sanitize-request guardrail.
- scope_
deregister_ tool_ sanitize_ response_ guardrail - Deregister a scope-local tool sanitize-response guardrail.
- scope_
register_ llm_ conditional_ execution_ guardrail - Register a scope-local LLM conditional-execution guardrail. The guardrail can block LLM execution inside the owning scope.
- scope_
register_ llm_ execution_ intercept - Register a scope-local LLM execution intercept. Execution intercepts can wrap or replace the non-streaming provider callback inside the owning scope.
- scope_
register_ llm_ request_ intercept - Register a scope-local LLM request intercept. Request intercepts can rewrite or annotate LLM requests inside the owning scope.
- scope_
register_ llm_ sanitize_ request_ guardrail - Register a scope-local LLM sanitize-request guardrail. The guardrail rewrites only request payloads emitted under the owning scope.
- scope_
register_ llm_ sanitize_ response_ guardrail - Register a scope-local LLM sanitize-response guardrail. The guardrail rewrites only response payloads emitted under the owning scope.
- scope_
register_ llm_ stream_ execution_ intercept - Register a scope-local streaming LLM execution intercept. Execution intercepts can wrap or replace the streaming provider callback inside the owning scope.
- scope_
register_ tool_ conditional_ execution_ guardrail - Register a scope-local tool conditional-execution guardrail. The guardrail can block tool execution inside the owning scope.
- scope_
register_ tool_ execution_ intercept - Register a scope-local tool execution intercept. Execution intercepts can wrap or replace the tool callback inside the owning scope.
- scope_
register_ tool_ request_ intercept - Register a scope-local tool request intercept. Request intercepts can rewrite tool arguments inside the owning scope.
- scope_
register_ tool_ sanitize_ request_ guardrail - Register a scope-local tool sanitize-request guardrail. The guardrail rewrites only tool input emitted under the owning scope.
- scope_
register_ tool_ sanitize_ response_ guardrail - Register a scope-local tool sanitize-response guardrail. The guardrail rewrites only tool output emitted under the owning scope.