pub struct ProtocolExecutor { /* private fields */ }Expand description
Protocol executor
Implementations§
Source§impl ProtocolExecutor
impl ProtocolExecutor
Sourcepub fn with_config(config: ExecutorConfig) -> Result<Self>
pub fn with_config(config: ExecutorConfig) -> Result<Self>
Create executor with custom configuration
Sourcepub fn registry(&self) -> &ProtocolRegistry
pub fn registry(&self) -> &ProtocolRegistry
Get the protocol registry
Sourcepub fn registry_mut(&mut self) -> &mut ProtocolRegistry
pub fn registry_mut(&mut self) -> &mut ProtocolRegistry
Get mutable registry
Sourcepub fn profiles(&self) -> &ProfileRegistry
pub fn profiles(&self) -> &ProfileRegistry
Get profile registry
Sourcepub async fn execute(
&self,
protocol_id: &str,
input: ProtocolInput,
) -> Result<ProtocolOutput>
pub async fn execute( &self, protocol_id: &str, input: ProtocolInput, ) -> Result<ProtocolOutput>
Execute a protocol
Sourcepub async fn execute_profile(
&self,
profile_id: &str,
input: ProtocolInput,
) -> Result<ProtocolOutput>
pub async fn execute_profile( &self, profile_id: &str, input: ProtocolInput, ) -> Result<ProtocolOutput>
Execute a reasoning profile (chain of protocols)
Sourcepub async fn execute_with_self_consistency(
&self,
profile_id: &str,
input: ProtocolInput,
sc_config: &SelfConsistencyConfig,
) -> Result<(ProtocolOutput, ConsistencyResult)>
pub async fn execute_with_self_consistency( &self, profile_id: &str, input: ProtocolInput, sc_config: &SelfConsistencyConfig, ) -> Result<(ProtocolOutput, ConsistencyResult)>
Execute a profile with Self-Consistency voting
This runs multiple independent reasoning paths and aggregates them via voting. Based on Wang et al. 2023 (arXiv:2203.11171) which showed +17.9% on GSM8K.
§Arguments
profile_id- Profile to execute (e.g., “balanced”, “deep”)input- Input data for the protocolsc_config- Self-Consistency configuration
§Returns
ProtocolOutput with voted answer and ConsistencyResult details
Sourcepub fn list_protocols(&self) -> Vec<&str>
pub fn list_protocols(&self) -> Vec<&str>
List available protocols
Sourcepub fn list_profiles(&self) -> Vec<&str>
pub fn list_profiles(&self) -> Vec<&str>
List available profiles
Sourcepub fn get_protocol(&self, id: &str) -> Option<&Protocol>
pub fn get_protocol(&self, id: &str) -> Option<&Protocol>
Get protocol info
Sourcepub fn get_profile(&self, id: &str) -> Option<&ReasoningProfile>
pub fn get_profile(&self, id: &str) -> Option<&ReasoningProfile>
Get profile info
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtocolExecutor
impl !RefUnwindSafe for ProtocolExecutor
impl Send for ProtocolExecutor
impl Sync for ProtocolExecutor
impl Unpin for ProtocolExecutor
impl !UnwindSafe for ProtocolExecutor
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
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>
Converts
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>
Converts
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