org.llm4s.agent.graph.middleware.MiddlewareStack
See theMiddlewareStack companion object
Middleware in the order they run, built and checked whole by MiddlewareStack.of.
ordered(0) is the outermost wrapper: its next calls ordered(1)'s hook, and the last one's next calls the innermost function. beforeAgent runs in stack order and afterAgent in reverse; each stops at the first Left. Every hook invocation is guarded on its own: a throw becomes GraphError.MiddlewareFailed naming that middleware, and a thrown cancellation a CancelledError, restoring the interrupt flag at once, which each enclosing wrapper sees as its next's result. The innermost function is not guarded; its caller guards it.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article