pub struct ReActLoop(/* private fields */);Expand description
The built-in async ReAct LoopDriver (DESIGN §6.2). Cheap to clone.
Implementations§
Source§impl ReActLoop
impl ReActLoop
Sourcepub fn new(
agent: AgentDef,
registry: Arc<ProviderRegistry>,
tools: Arc<dyn ToolProvider>,
policy: Arc<dyn RecoveryPolicySource>,
) -> Self
pub fn new( agent: AgentDef, registry: Arc<ProviderRegistry>, tools: Arc<dyn ToolProvider>, policy: Arc<dyn RecoveryPolicySource>, ) -> Self
Assembles the loop from an agent definition, a provider registry (slot targets resolve against it), the tool provider, and the declarative recovery-policy source consulted on soft failures.
Sourcepub fn with_config(
agent: AgentDef,
registry: Arc<ProviderRegistry>,
tools: Arc<dyn ToolProvider>,
policy: Arc<dyn RecoveryPolicySource>,
config: ReActConfig,
) -> Self
pub fn with_config( agent: AgentDef, registry: Arc<ProviderRegistry>, tools: Arc<dyn ToolProvider>, policy: Arc<dyn RecoveryPolicySource>, config: ReActConfig, ) -> Self
ReActLoop::new with explicit loop tuning. The evidence gate is
disabled (built-in behavior).
Sourcepub fn with_evidence_gate(
agent: AgentDef,
registry: Arc<ProviderRegistry>,
tools: Arc<dyn ToolProvider>,
policy: Arc<dyn RecoveryPolicySource>,
config: ReActConfig,
gate: EvidenceGateConfig,
) -> Self
pub fn with_evidence_gate( agent: AgentDef, registry: Arc<ProviderRegistry>, tools: Arc<dyn ToolProvider>, policy: Arc<dyn RecoveryPolicySource>, config: ReActConfig, gate: EvidenceGateConfig, ) -> Self
ReActLoop::with_config with an evidence gate mounted on
the stop path. A disabled EvidenceGateConfig behaves exactly
like ReActLoop::with_config.
Sourcepub fn with_hooks(
agent: AgentDef,
registry: Arc<ProviderRegistry>,
tools: Arc<dyn ToolProvider>,
policy: Arc<dyn RecoveryPolicySource>,
config: ReActConfig,
gate: EvidenceGateConfig,
hooks: Option<Arc<dyn HookPorts>>,
) -> Self
pub fn with_hooks( agent: AgentDef, registry: Arc<ProviderRegistry>, tools: Arc<dyn ToolProvider>, policy: Arc<dyn RecoveryPolicySource>, config: ReActConfig, gate: EvidenceGateConfig, hooks: Option<Arc<dyn HookPorts>>, ) -> Self
ReActLoop::with_evidence_gate plus the injected hook ports
(PLUGIN-SPEC §4): the bus instance assembly owns, consulted at
this loop’s five ReAct sites — turn/request, turn/response,
tool/pre, tool/post, recover/decided. None (every
legacy constructor) mounts no consultation at all.
Sourcepub fn with_hooks_and_guard(
agent: AgentDef,
registry: Arc<ProviderRegistry>,
tools: Arc<dyn ToolProvider>,
policy: Arc<dyn RecoveryPolicySource>,
config: ReActConfig,
gate: EvidenceGateConfig,
hooks: Option<Arc<dyn HookPorts>>,
set_guard: Option<Arc<dyn SessionSetGuard>>,
) -> Self
pub fn with_hooks_and_guard( agent: AgentDef, registry: Arc<ProviderRegistry>, tools: Arc<dyn ToolProvider>, policy: Arc<dyn RecoveryPolicySource>, config: ReActConfig, gate: EvidenceGateConfig, hooks: Option<Arc<dyn HookPorts>>, set_guard: Option<Arc<dyn SessionSetGuard>>, ) -> Self
ReActLoop::with_hooks plus the §9.2 session-set guard — the
assembly mounts both from the same bus instance. The guard runs
once per drive (the drain/claim boundary), before the first
iteration; the frame carries this drain’s session and epoch with
the honest floor binding (the loop holds no worker binding,
§7.3 — an unbound session resolves the server scope, §8.2).
Eight named arguments, same shape as the sibling constructors —
a bundle struct would only rename the same list.
pub fn config(&self) -> &ReActConfig
Sourcepub fn evidence_gate(&self) -> &EvidenceGateConfig
pub fn evidence_gate(&self) -> &EvidenceGateConfig
The mounted evidence-gate config. The shared verdict counters
inside are the metrics surface for GET /metrics (wired by the
assembly).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ReActLoop
impl !UnwindSafe for ReActLoop
impl Forget for ReActLoop
impl Freeze for ReActLoop
impl Move for ReActLoop
impl Send for ReActLoop
impl Sync for ReActLoop
impl Unpin for ReActLoop
impl UnsafeUnpin for ReActLoop
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more