Query Rewriter Agent Builder • Rust AI Agent SDK

QueryRewriterAgentBuilder: Builder for QueryRewriterAgent

QueryRewriterAgentBuilder

Defined in the Specialized Agents module.

Rust AI Agent SDK

Builder for QueryRewriterAgent

Diagram

Input Data

Agent: QueryRewriterAgentBuilder

Output Result

Fields

NameTypeDescription
configQueryRewriterConfig–

Methods

new

rust
fn new() -> Self

Create a new builder

name

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

Set agent name

Parameters:

NameType
nameimpl Into&lt;String&gt;

model

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

Set LLM model

Parameters:

NameType
modelimpl Into&lt;String&gt;

instructions

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

Set custom instructions

Parameters:

NameType
instructionsimpl Into&lt;String&gt;

verbose

rust
fn verbose(mut self) -> Self

Enable verbose output

max_queries

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

Set max queries

Parameters:

NameType
maxusize

abbreviation

rust
fn abbreviation(mut self, abbrev: impl Into<String>, expansion: impl Into<String>) -> Self

Add abbreviation expansion

Parameters:

NameType
abbrevimpl Into&lt;String&gt;
expansionimpl Into&lt;String&gt;

abbreviations

rust
fn abbreviations(mut self, abbrevs: HashMap<String, String>) -> Self

Set abbreviations map

Parameters:

NameType
abbrevsHashMap&lt;String

temperature

rust
fn temperature(mut self, temp: f32) -> Self

Set temperature

Parameters:

NameType
tempf32

max_tokens

rust
fn max_tokens(mut self, tokens: usize) -> Self

Set max tokens

Parameters:

NameType
tokensusize

build

rust
fn build(self) -> QueryRewriterAgent

Build the agent

Source

View on GitHub

praisonai/src/specialized_agents.rs at line 648


Related Documentation