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

# DuckDuckGo

**DuckDuckGo** 使 Agent 能够搜索网络信息。

## 前提条件

下面的示例需要 `duckduckgo-search` 库。要安装 DuckDuckGo，请运行以下命令：

```shell theme={null}
pip install -U duckduckgo-search
```

## 示例

```python cookbook/tools/duckduckgo.py theme={null}
from agno.agent import Agent
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(tools=[DuckDuckGoTools()], show_tool_calls=True)
agent.print_response("Whats happening in France?", markdown=True)
```

## Toolkit 参数

| 参数                  | 类型     | 默认值    | 描述                                           |
| ------------------- | ------ | ------ | -------------------------------------------- |
| `search`            | `bool` | `True` | 启用 `duckduckgo_search` 函数来搜索 DuckDuckGo 的查询。 |
| `news`              | `bool` | `True` | 启用 `duckduckgo_news` 函数通过 DuckDuckGo 获取最新新闻。 |
| `fixed_max_results` | `int`  | -      | 设置返回结果的最大固定数量。不提供默认值，如果使用则必须指定。              |
| `headers`           | `Any`  | -      | 接受发送 HTTP 请求的任何类型的标头值。                       |
| `proxy`             | `str`  | -      | 指定一个单独的代理地址（字符串）用于 HTTP 请求。                  |
| `proxies`           | `Any`  | -      | 接受一个代理字典用于 HTTP 请求。                          |
| `timeout`           | `int`  | `10`   | 设置 HTTP 请求的超时时间（秒）。                          |

## Toolkit 函数

| 函数                  | 描述                        |
| ------------------- | ------------------------- |
| `duckduckgo_search` | 使用此函数来搜索 DuckDuckGo 的查询。  |
| `duckduckgo_news`   | 使用此函数从 DuckDuckGo 获取最新新闻。 |

## 开发者资源

* 查看 [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/duckduckgo.py)
* 查看 [Cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/tools/duckduckgo_tools.py)
