pub struct ReactOperator<P: Provider> { /* private fields */ }Expand description
A full-featured Operator implementation with a ReAct loop.
Generic over P: Provider (not object-safe). The object-safe boundary
is layer0::Operator, which ReactOperator<P> implements via #[async_trait].
Implementations§
Source§impl<P: Provider> ReactOperator<P>
impl<P: Provider> ReactOperator<P>
Sourcepub fn new(
provider: P,
tools: ToolRegistry,
context_strategy: Box<dyn ContextStrategy>,
hooks: HookRegistry,
state_reader: Arc<dyn StateReader>,
config: ReactConfig,
) -> Self
pub fn new( provider: P, tools: ToolRegistry, context_strategy: Box<dyn ContextStrategy>, hooks: HookRegistry, state_reader: Arc<dyn StateReader>, config: ReactConfig, ) -> Self
Create a new ReactOperator with all dependencies.
Sourcepub fn with_planner(self, planner: Box<dyn ToolExecutionPlanner>) -> Self
pub fn with_planner(self, planner: Box<dyn ToolExecutionPlanner>) -> Self
Opt-in: set a custom tool execution planner.
Sourcepub fn with_concurrency_decider(
self,
decider: Box<dyn ConcurrencyDecider>,
) -> Self
pub fn with_concurrency_decider( self, decider: Box<dyn ConcurrencyDecider>, ) -> Self
Opt-in: set a custom concurrency decider.
Sourcepub fn with_metadata_concurrency(self) -> Self
pub fn with_metadata_concurrency(self) -> Self
Opt-in: use tool metadata to decide concurrency.
Sourcepub fn with_steering(self, s: Arc<dyn SteeringSource>) -> Self
pub fn with_steering(self, s: Arc<dyn SteeringSource>) -> Self
Opt-in: attach a steering source.
Trait Implementations§
Source§impl<P: Provider + 'static> Operator for ReactOperator<P>
impl<P: Provider + 'static> Operator for ReactOperator<P>
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
input: OperatorInput,
) -> Pin<Box<dyn Future<Output = Result<OperatorOutput, OperatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
input: OperatorInput,
) -> Pin<Box<dyn Future<Output = Result<OperatorOutput, OperatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a single operator invocation. Read more
Auto Trait Implementations§
impl<P> Freeze for ReactOperator<P>where
P: Freeze,
impl<P> !RefUnwindSafe for ReactOperator<P>
impl<P> Send for ReactOperator<P>
impl<P> Sync for ReactOperator<P>
impl<P> Unpin for ReactOperator<P>where
P: Unpin,
impl<P> UnsafeUnpin for ReactOperator<P>where
P: UnsafeUnpin,
impl<P> !UnwindSafe for ReactOperator<P>
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
Mutably borrows from an owned value. Read more