> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reflection Config • Rust AI Agent SDK

> ReflectionConfig: Configuration for self-reflection

# ReflectionConfig

> Defined in the [**config**](../modules/config) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Configuration for self-reflection

## Fields

| Name             | Type                   | Description                             |
| ---------------- | ---------------------- | --------------------------------------- |
| `enabled`        | `bool`                 | Enable reflection                       |
| `min_iterations` | `usize`                | Minimum iterations                      |
| `max_iterations` | `usize`                | Maximum iterations                      |
| `llm`            | `Option&lt;String&gt;` | Reflection LLM (if different from main) |
| `prompt`         | `Option&lt;String&gt;` | Custom reflection prompt                |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new() -> Self
```

Create a new reflection config

### `enabled`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn enabled(mut self) -> Self
```

Enable reflection

### `min_iterations`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn min_iterations(mut self, min: usize) -> Self
```

Set min iterations

**Parameters:**

| Name  | Type    |
| ----- | ------- |
| `min` | `usize` |

### `max_iterations`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn max_iterations(mut self, max: usize) -> Self
```

Set max iterations

**Parameters:**

| Name  | Type    |
| ----- | ------- |
| `max` | `usize` |

### `llm`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn llm(mut self, llm: impl Into<String>) -> Self
```

Set reflection LLM

**Parameters:**

| Name  | Type                      |
| ----- | ------------------------- |
| `llm` | `impl Into&lt;String&gt;` |

### `prompt`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn prompt(mut self, prompt: impl Into<String>) -> Self
```

Set custom prompt

**Parameters:**

| Name     | Type                      |
| -------- | ------------------------- |
| `prompt` | `impl Into&lt;String&gt;` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/config.rs#L554">
  `praisonai/src/config.rs` at line 554
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />

  <Card title="Rust Reflection" icon="mirror" href="/docs/rust/reflection" />

  <Card title="Rust Self-Reflection" icon="brain" href="/docs/rust/self-reflection" />
</CardGroup>
