search runs a real DuckDuckGo query and raises when the backend fails, so missing dependencies and rate limits are visible instead of silent.
search needs the ddgs package at runtime. Install it with pip install ddgs.Quick Start
1
Search from an Agent
Give an agent the web search tool for research tasks.
2
Direct capability call
Call
search directly when you just need raw results.How It Works
search calls internet_search under the hood. Each result is a dict with title, url, and snippet keys.
Configuration Options
SearchResult fields: results (list of dicts), query, total, metadata.
Capabilities SDK Reference
Auto-generated reference for the capabilities module
Common Patterns
Handle a missing dependency gracefully:Best Practices
Install ddgs before using search
Install ddgs before using search
Run
pip install ddgs. Without it, search raises RuntimeError.Catch RuntimeError
Catch RuntimeError
Rate limits and missing dependencies surface as
RuntimeError. Wrap calls so your app degrades gracefully instead of crashing.Tune max_results
Tune max_results
Lower
max_results for faster, cheaper queries; raise it when you need broader coverage.Related
Web Search Tools
Search tools for agents
Capabilities Overview
All LiteLLM parity capabilities

