Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
from agno.agent import Agent from agno.tools.baidusearch import BaiduSearchTools agent = Agent( tools=[BaiduSearchTools()], description="你是一个搜索代理,可以帮助用户使用百度查找最相关的信息。", instructions=[ "根据用户提供的话题,回应关于该话题最相关的 3 条搜索结果。", "搜索 5 条结果,并选择最重要的 3 条不重复的条目。", "同时使用英语和中文进行搜索。", ], show_tool_calls=True, ) agent.print_response("人工智能最新进展是什么?", markdown=True)
创建虚拟环境
Terminal
python3 -m venv .venv source .venv/bin/activate
设置您的 API 密钥
export OPENAI_API_KEY=xxx
安装库
pip install -U openai agno
运行 Agent
python cookbook/tools/baidusearch_tools.py