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

# Confluence

**ConfluenceTools** 允许 Agent 在 Confluence 中检索、创建和更新页面。它们还允许您探索空间和页面详细信息。

## 前提条件

下面的示例需要 `atlassian-python-api` 库和 Confluence 凭据。您可以通过[此处](https://id.atlassian.com/manage-profile/security)获取 API 令牌。

```shell theme={null}
pip install atlassian-python-api
```

```shell theme={null}
export CONFLUENCE_URL="https://your-confluence-instance"
export CONFLUENCE_USERNAME="your-username"
export CONFLUENCE_PASSWORD="your-password"
# or
export CONFLUENCE_API_KEY="your-api-key"
```

## 示例

下面的 Agent 将检索空间数量及其名称。

```python theme={null}
from agno.agent import Agent
from agno.tools.confluence import ConfluenceTools

agent = Agent(
    name="Confluence agent",
    tools=[ConfluenceTools()],
    show_tool_calls=True,
    markdown=True,
)

agent.print_response("How many spaces are there and what are their names?")
```

## Toolkit Functions

| Parameter    | Type   | Default | Description                                                                     |
| ------------ | ------ | ------- | ------------------------------------------------------------------------------- |
| `username`   | `str`  | -       | Confluence 用户名。也可以通过环境变量 CONFLUENCE\_USERNAME 设置。                               |
| `password`   | `str`  | -       | Confluence 密码或 API 密钥。也可以通过环境变量 CONFLUENCE\_API\_KEY 或 CONFLUENCE\_PASSWORD 设置。 |
| `url`        | `str`  | -       | Confluence 实例 URL。也可以通过环境变量 CONFLUENCE\_URL 设置。                                 |
| `api_key`    | `str`  | -       | Confluence API 密钥（密码的替代选项）。                                                     |
| `ssl_verify` | `bool` | `True`  | 如果为 True，则验证 SSL 证书。                                                            |

## Toolkit Functions

| Function                  | Description                   |
| ------------------------- | ----------------------------- |
| `get_page_content`        | 获取指定页面的内容。                    |
| `get_all_space_detail`    | 获取所有 Confluence 空间 的详细信息。     |
| `get_space_key`           | 获取指定空间的 Confluence 键。         |
| `get_all_page_from_space` | 获取指定空间的所有页面详情。                |
| `create_page`             | 使用提供的标题和正文创建新的 Confluence 页面。 |
| `update_page`             | 更新现有的 Confluence 页面。          |

## Developer Resources

* View [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/confluence.py)
* View [Cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/tools/confluence.py)
