Web
Browse and interact with websites
Agents can browse the web – search, read pages, and extract information.
Quick Start
- Simple Usage
typescript import { Agent } from 'praisonai'; const agent = new Agent({ instructions: 'You research topics online', tools: ['web_search'] }); await agent.chat('What are the latest AI developments?'); // Agent searches and summarizes findings - With Configuration
typescript const agent = new Agent({ tools: ['web_search', 'read_url'] }); await agent.chat('Summarize the article at example.com/news'); // Agent reads and summarizes the page
User Interaction Flow
Configuration Levels
// Level 1: Array - Enable web tools
const agent = new Agent({
tools: ['web_search']
});
// Level 2: String - Specify provider
const agent = new Agent({
tools: ['web_search'],
searchProvider: 'google' // or 'bing', 'duckduckgo'
});
// Level 3: Dict - Full options
const agent = new Agent({
web: {
search: true,
browse: true,
maxResults: 10,
timeout: 30000,
allowedDomains: ['*.wikipedia.org', '*.github.com']
}
});Web Tools
| Tool | Description |
|---|---|
web_search | Search the internet |
read_url | Read a specific webpage |
browse | Navigate and interact |
screenshot | Capture page images |
API Reference
WebConfigWeb configuration options
Best Practices
Limit search results
10 results is usually enough – more adds noise.
Set timeouts
Slow pages shouldn’t block the agent forever.
Filter domains
Restrict to trusted domains when possible.