MiddlewareStack

org.llm4s.agent.graph.middleware.MiddlewareStack
See theMiddlewareStack companion object
final class MiddlewareStack

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
Source
MiddlewareStack.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete fields

Every middleware's contributed tools, in stack order.

Every middleware's contributed tools, in stack order.

Attributes

Source
MiddlewareStack.scala
val writes: Set[StateKey[_, _]]

The union of every middleware's writes.

The union of every middleware's writes.

Attributes

Source
MiddlewareStack.scala