pub struct ReflectionAgent<L: LlmProvider> { /* private fields */ }Expand description
Agent that analyzes performance and suggests genome improvements
Implementations§
Source§impl<L: LlmProvider> ReflectionAgent<L>
impl<L: LlmProvider> ReflectionAgent<L>
Sourcepub fn with_config(llm: Arc<L>, config: ReflectionConfig) -> Self
pub fn with_config(llm: Arc<L>, config: ReflectionConfig) -> Self
Create with custom config
Sourcepub async fn reflect(
&self,
agent: &Agent,
task: &str,
response: &str,
fitness: f64,
memory: &EvolutionMemory,
) -> ReflectionResult
pub async fn reflect( &self, agent: &Agent, task: &str, response: &str, fitness: f64, memory: &EvolutionMemory, ) -> ReflectionResult
Reflect on agent performance and suggest improvements
Uses both statistical analysis (from EvolutionMemory) and LLM-based reasoning to suggest trait adjustments.
Sourcepub async fn consolidate_memory(
&self,
experiments: &[GenomeExperiment],
) -> Result<Vec<OptimizationRule>, String>
pub async fn consolidate_memory( &self, experiments: &[GenomeExperiment], ) -> Result<Vec<OptimizationRule>, String>
Analyze a batch of experiments and extract semantic optimization rules
Auto Trait Implementations§
impl<L> Freeze for ReflectionAgent<L>
impl<L> RefUnwindSafe for ReflectionAgent<L>where
L: RefUnwindSafe,
impl<L> Send for ReflectionAgent<L>
impl<L> Sync for ReflectionAgent<L>
impl<L> Unpin for ReflectionAgent<L>
impl<L> UnwindSafe for ReflectionAgent<L>where
L: RefUnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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