pub struct GraphHandler { /* private fields */ }Expand description
Runs graphs on behalf of a step.
Holds the filters those graphs are built from — a graph names its nodes, it does not carry their implementations — plus the cache they share.
Implementations§
Source§impl GraphHandler
impl GraphHandler
Sourcepub fn new(library: NodeCatalog) -> Self
pub fn new(library: NodeCatalog) -> Self
A handler over library, with an in-memory cache.
Without Self::with_step_runtime the sub-graphs it runs must be
purely computational; one that contains a step fails as an
EffectResult::Failed naming the missing runtime.
Sourcepub fn with_cache(self, cache: Arc<dyn CacheStore>) -> Self
pub fn with_cache(self, cache: Arc<dyn CacheStore>) -> Self
Share the caller’s cache, so a pipeline the agent runs hits the same entries the user’s own runs wrote.
Sourcepub fn with_step_runtime(
self,
handlers: Vec<Arc<dyn EffectHandler>>,
journal: EffectJournal,
) -> Self
pub fn with_step_runtime( self, handlers: Vec<Arc<dyn EffectHandler>>, journal: EffectJournal, ) -> Self
Let sub-graphs contain steps of their own: agent → pipeline → agent.
handlers are the sibling handlers the parent driver carries (llm,
tools, sleep — everything except graph handlers), and journal is
the parent’s journal, so an inner model call is journaled in the same
store as an outer one. Nesting is capped at MAX_GRAPH_DEPTH.
Sourcepub fn with_event_bus(self, bus: Arc<EventBus>) -> Self
pub fn with_event_bus(self, bus: Arc<EventBus>) -> Self
Forward the sub-graphs’ step events to this bus.
Only meaningful together with Self::with_step_runtime; without
one there is no inner driver to emit anything.
Sourcepub fn library(&self) -> &NodeCatalog
pub fn library(&self) -> &NodeCatalog
The filters available to graphs run through this handler.