Prerequisites
The following example requires thebaidusearch library. To install BaiduSearch, run the following command:
Example
cookbook/14_tools/baidusearch_tools.py
Toolkit Params
Toolkit Functions
Developer Resources
- View Tools
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
baidusearch library. To install BaiduSearch, run the following command:
uv pip install -U baidusearch
from agno.agent import Agent
from agno.tools.baidusearch import BaiduSearchTools
agent = Agent(
tools=[BaiduSearchTools()],
description="You are a search agent that helps users find the most relevant information using Baidu.",
instructions=[
"Given a topic by the user, respond with the 3 most relevant search results about that topic.",
"Search for 5 results and select the top 3 unique items.",
"Search in both English and Chinese.",
],
)
agent.print_response("What are the latest advancements in AI?", markdown=True)
| Parameter | Type | Default | Description |
|---|---|---|---|
fixed_max_results | int | - | Sets a fixed number of maximum results to return. No default is provided, must be specified if used. |
fixed_language | str | - | Set the fixed language for the results. |
headers | Any | - | Headers to be used in the search request. |
proxy | str | - | Specifies a single proxy address as a string to be used for the HTTP requests. |
timeout | int | 10 | Sets the timeout for HTTP requests, in seconds. |
enable_baidu_search | bool | True | Enable the baidu_search functionality. |
all | bool | False | Enable all functionality. |
| Function | Description |
|---|---|
baidu_search | Use this function to search Baidu for a query. |
Was this page helpful?