> ## 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 工具

## 代码

```python cookbook/tools/confluence_tools.py 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("有多少个空间以及它们的名字是什么？")
agent.print_response(
    "'LLM 空间' 中的页面内容是什么？"
)
agent.print_response("'LLM' 空间的所有页面名称是什么？")
agent.print_response("能在 'LLM' 空间创建一个名为 'TESTING' 的新页面吗？")
```

## 用法

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

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

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

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

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