Reflection Config • Rust AI Agent SDK

ReflectionConfig: Configuration for self-reflection

ReflectionConfig

Defined in the config module.

Rust AI Agent SDK

Configuration for self-reflection

Fields

NameTypeDescription
enabledboolEnable reflection
min_iterationsusizeMinimum iterations
max_iterationsusizeMaximum iterations
llmOption<String>Reflection LLM (if different from main)
promptOption<String>Custom reflection prompt

Methods

new

rust
fn new() -> Self

Create a new reflection config

enabled

rust
fn enabled(mut self) -> Self

Enable reflection

min_iterations

rust
fn min_iterations(mut self, min: usize) -> Self

Set min iterations

Parameters:

NameType
minusize

max_iterations

rust
fn max_iterations(mut self, max: usize) -> Self

Set max iterations

Parameters:

NameType
maxusize

llm

rust
fn llm(mut self, llm: impl Into<String>) -> Self

Set reflection LLM

Parameters:

NameType
llmimpl Into&lt;String&gt;

prompt

rust
fn prompt(mut self, prompt: impl Into<String>) -> Self

Set custom prompt

Parameters:

NameType
promptimpl Into&lt;String&gt;

Source

View on GitHub

praisonai/src/config.rs at line 554


Related Documentation