Skip to main content

ReactOperator

Struct ReactOperator 

Source
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>

Source

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.

Source

pub fn with_planner(self, planner: Box<dyn ToolExecutionPlanner>) -> Self

Opt-in: set a custom tool execution planner.

Source

pub fn with_concurrency_decider( self, decider: Box<dyn ConcurrencyDecider>, ) -> Self

Opt-in: set a custom concurrency decider.

Source

pub fn with_metadata_concurrency(self) -> Self

Opt-in: use tool metadata to decide concurrency.

Source

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>

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,

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.