前提条件
下面的示例需要来自 SerperApi 的 API 密钥。示例
下面的 agent 将搜索 Google 的查询:“美国正在发生什么事”,并分享结果。cookbook/tools/serper_tools.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
export SERPER_API_KEY=***
from agno.agent import Agent
from agno.tools.serper import SerperTools
agent = Agent(tools=[SerperTools(location="us")], show_tool_calls=True)
agent.print_response("Whats happening in the USA?", markdown=True)
| 参数名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
api_key | str | - | 用于身份验证目的的 API 密钥。 |
location | str | "us" | 要搜索的地点。 |
| 函数名 | 描述 |
|---|---|
search_google | 此函数搜索 Google 的查询。 |