Skip to main content

rewrite

Method
This is a method of the QueryRewriterAgent class in the query_rewriter_agent module.
Rewrite a query using the specified strategy. All operations go through an internal Agent which automatically handles tool calling when tools are provided. The agent decides when to use tools based on the query context.

Signature

Parameters

str
required
The original user query
RewriteStrategy
default:"RewriteStrategy.AUTO"
Rewriting strategy to use
Optional
Previous conversation messages for contextual rewriting
Optional
Additional context about the knowledge base
int
Number of queries for multi-query strategy

Returns

RewriteResult
RewriteResult containing rewritten queries

Uses

  • debug

Used By

Source

View on GitHub

praisonaiagents/agent/query_rewriter_agent.py at line 345