> ## 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.

# Brave Search 工具

## 代码

```python cookbook/tools/bravesearch_tools.py theme={null}
from agno.agent import Agent
from agno.tools.bravesearch import BraveSearchTools

agent = Agent(
    tools=[BraveSearchTools()],
    description="你是一个新闻助手，帮助用户查找最新新闻。",
    instructions=[
        "根据用户提供的主题，回应该主题的 4 条最新新闻。"
    ],
    show_tool_calls=True,
)
agent.print_response("AI Agents", markdown=True)
```

## 用法

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

  <Step title="设置你的 API 凭证">
    ```bash theme={null}
    export BRAVE_API_KEY=xxx
    ```
  </Step>

  <Step title="安装库">
    ```bash theme={null}
    pip install -U brave-search openai agno
    ```
  </Step>

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

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