Skip to content

API Reference parrot.bots.search

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.bots.search

View source

WebSearchAgent implementation for the ai-parrot framework.

Alias AIMessage

Re-exported from parrot.models.responses.AIMessage.

Alias BasicAgent

Re-exported from parrot.bots.agent.BasicAgent.

Attribute DEFAULT_COMPETITOR_TRANSFORM_PROMPT

Attribute DEFAULT_CONTRASTIVE_PROMPT

Attribute DEFAULT_SYNTHESIZE_PROMPT

Alias PromptMiddleware

Re-exported from parrot.bots.middleware.PromptMiddleware.

Alias PromptPipeline

Re-exported from parrot.bots.middleware.PromptPipeline.

Class WebSearchAgent

An agent specialized in performing web searches.

By default, it is equipped with several search tools:

  • GoogleSearchTool
  • GoogleSiteSearchTool
  • DdgSearchTool
  • BingSearchTool
  • SerpApiSearchTool

If use_builtin_search is True, it will fallback to using Gemini's built-in Google Search functionality via tool_type='builtin_tools'.

If contrastive_search is True, performs a two-step search: first the original query, then a contrastive analysis of competitors/alternatives based on the initial results.

If synthesize is True, an additional LLM call (with use_tools=False) analyzes and synthesizes the search results using a synthesis prompt.

Parameter Type Default Description
name str 'WebSearchAgent'
agent_id str 'web_search_agent'
use_llm str 'google'
llm str 'google:gemini-3-flash'
tools Optional[List[Any]] None
use_builtin_search bool False
contrastive_search bool False
contrastive_prompt Optional[str] None
synthesize bool False
synthesize_prompt Optional[str] None
competitor_search bool False
competitor_prompt Optional[str] None
**kwargs {}

Method WebSearchAgent.ask

Override ask to support contrastive search and synthesis.

Flow:

  1. If contrastive_search is False: normal search via _do_search. If True: two-step search (initial + contrastive analysis).
  2. If synthesize is True: additional LLM call (no tools) to synthesize the results.

ask(question: str, **kwargs) -> AIMessage

Parameter Type Default Description
question str
**kwargs {}

Returns: AIMessage

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally