Expand description
Middleware pipelines for agents, chat clients, and function invocation.
Rust equivalent of agent_framework._middleware. Middleware receives an
owned context and a Next continuation. Call next.run(ctx) to continue
the chain, mutate the context to observe/override results, or return the
context directly (optionally with terminate = true) to short-circuit.
Structs§
- Agent
Context - Context flowing through the agent middleware pipeline.
- Chat
Context - Context flowing through the chat middleware pipeline.
- FnMiddleware
- Adapter to build a
Middlewarefrom an async closure. - Function
Invocation Context - Context flowing through the function middleware pipeline.
- Live
Tool List - The live, mutable tool list of an in-flight agent run (progressive tool exposure).
- Middleware
Pipeline - A pipeline of middleware of a single category.
- Next
- The continuation passed to a
Middleware. CallingNext::runinvokes the remaining middleware and, finally, the terminal handler.
Traits§
- Middleware
- A middleware that transforms a context of type
C.
Type Aliases§
- Agent
Middleware - Convenience type aliases for each middleware category.
- Chat
Middleware - Chat middleware operates on a
ChatContext. - Function
Middleware - Function middleware operates on a
FunctionInvocationContext. - Terminal
- The terminal handler invoked at the end of a middleware chain.