> ## 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.

# Expand Result • Rust AI Agent SDK

> ExpandResult: Result of prompt expansion

# ExpandResult

> Defined in the [**Specialized Agents**](../modules/specialized_agents) module.

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

Result of prompt expansion

## Fields

| Name              | Type                | Description                 |
| ----------------- | ------------------- | --------------------------- |
| `original_prompt` | `String`            | Original prompt             |
| `expanded_prompt` | `String`            | Expanded prompt             |
| `strategy_used`   | `ExpandStrategy`    | Strategy used for expansion |
| `metadata`        | `HashMap&lt;String` | Additional metadata         |
| `serde_json`      | `:Value&gt;`        | Additional metadata         |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(
        original: impl Into<String>,
        expanded: impl Into<String>,
        strategy: ExpandStrategy,
    ) -> Self
```

Create a new expand result

**Parameters:**

| Name       | Type                      |
| ---------- | ------------------------- |
| `original` | `impl Into&lt;String&gt;` |
| `expanded` | `impl Into&lt;String&gt;` |
| `strategy` | `ExpandStrategy`          |

### `with_metadata`

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

Add metadata

**Parameters:**

| Name    | Type                                 |
| ------- | ------------------------------------ |
| `key`   | `impl Into&lt;String&gt;`            |
| `value` | `impl Into&lt;serde_json::Value&gt;` |

### `expansion_ratio`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn expansion_ratio(&self) -> f64
```

Get expansion ratio (expanded length / original length)

## Source

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