Enable agents to search the web and fetch page content
Web capabilities let agents search the internet and fetch page content to answer questions with up-to-date information.
from praisonaiagents import Agentagent = Agent( name="News Agent", instructions="Answer with up-to-date web results", web="duckduckgo", # search only — no API key)agent.start("What are today's AI headlines?")
from praisonaiagents import Agentagent = Agent( name="Web Agent", instructions="You search the web for information", web=True # Enable web search and fetch)agent.start("What are the latest AI news today?")
2
With Configuration
from praisonaiagents import Agent, WebConfigagent = Agent( name="Research Agent", instructions="You do thorough web research", web=WebConfig( search=True, # Enable search fetch=True, # Enable page fetch search_provider="duckduckgo", # Search provider max_results=10, # Results per search ))
from praisonaiagents import WebConfigconfig = WebConfig( search=True, # Enable web search fetch=True, # Enable page fetch search_provider="duckduckgo", # Search provider max_results=5, # Max results per search search_config={}, # Provider-specific config fetch_config={}, # Fetch-specific config)
Option
Type
Default
Description
search
bool
True
Enable web search
fetch
bool
True
Enable page fetch
search_provider
str
"duckduckgo"
Search provider
max_results
int
5
Results per search
search_config
dict
{}
Provider config
fetch_config
dict
{}
Fetch config
Provider preset strings disable fetch by default. Passing a provider name as a string (e.g. web="duckduckgo", web="tavily") enables search only so the tool set stays compatible with OpenAI models. Enable fetch explicitly with WebConfig(search=True, fetch=True, search_provider="duckduckgo") or use web=True for both.
agent = Agent( instructions="You answer using docs and web", knowledge=["docs/"], # Local documents web=True, # Web search fallback)# Agent checks local docs first, then searches web