> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Google 搜索工具

## 代码

```python cookbook/tools/googlesearch_tools.py theme={null}
from agno.agent import Agent
from agno.tools.googlesearch import GoogleSearchTools

agent = Agent(
    tools=[GoogleSearchTools()],
    show_tool_calls=True,
    markdown=True,
)
agent.print_response("AI 的最新进展是什么？")
```

## 用法

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="设置您的 API 凭证">
    ```bash theme={null}
    export GOOGLE_CSE_ID=xxx
    export GOOGLE_API_KEY=xxx
    export OPENAI_API_KEY=xxx 
    ```
  </Step>

  <Step title="安装库">
    ```bash theme={null}
    pip install -U google-api-python-client openai agno
    ```
  </Step>

  <Step title="运行 Agent">
    <CodeGroup>
      ```bash Mac theme={null}
      python cookbook/tools/googlesearch_tools.py
      ```

      ```bash Windows theme={null}
      python cookbook/tools/googlesearch_tools.py
      ```
    </CodeGroup>
  </Step>
</Steps>
