Skip to main content

ExpandResult

Defined in the Specialized Agents module.
Rust AI Agent SDK Result of prompt expansion

Fields

NameTypeDescription
original_promptStringOriginal prompt
expanded_promptStringExpanded prompt
strategy_usedExpandStrategyStrategy used for expansion
metadataHashMap<StringAdditional metadata
serde_json:Value>Additional metadata

Methods

new

fn new(
        original: impl Into<String>,
        expanded: impl Into<String>,
        strategy: ExpandStrategy,
    ) -> Self
Create a new expand result Parameters:
NameType
originalimpl Into&lt;String&gt;
expandedimpl Into&lt;String&gt;
strategyExpandStrategy

with_metadata

fn with_metadata(mut self, key: impl Into<String>, value: impl Into<serde_json::Value>) -> Self
Add metadata Parameters:
NameType
keyimpl Into&lt;String&gt;
valueimpl Into&lt;serde_json::Value&gt;

expansion_ratio

fn expansion_ratio(&self) -> f64
Get expansion ratio (expanded length / original length)

Source

View on GitHub

praisonai/src/specialized_agents.rs at line 83