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

# Webex

**WebexTools** 允许智能体与 Cisco Webex 进行交互，从而能够发送消息和列出房间。

## 前置条件

以下示例需要 `webexpythonsdk` 库和一个 Webex 访问令牌，可以通过 [Webex 开发者门户](https://developer.webex.com/docs/bots) 获取。

开始使用 Webex：

1. **创建 Webex Bot：**
   * 前往 [开发者门户](https://developer.webex.com/)
   * 导航至 My Webex Apps → Create a Bot
   * 填写机器人详情并点击 Add Bot

2. **获取您的访问令牌：**
   * 复制机器人创建后显示的令牌
   * 或通过 My Webex Apps → Edit Bot 重新生成
   * 将其设置为 WEBEX\_ACCESS\_TOKEN 环境变量

3. **将机器人添加到 Webex：**
   * 启动 Webex 并将机器人添加到某个空间
   * 使用机器人的电子邮件（例如 [test@webex.bot](mailto:test@webex.bot)）

```shell theme={null}
pip install webexpythonsdk
```

```shell theme={null}
export WEBEX_ACCESS_TOKEN=your_access_token_here
```

## 示例

以下智能体将列出所有空间并使用 Webex 发送消息：

```python cookbook/tools/webex_tool.py theme={null}
from agno.agent import Agent
from agno.tools.webex import WebexTools

agent = Agent(tools=[WebexTools()], show_tool_calls=True)

# 列出我们 Webex 中的所有空间
agent.print_response("List all space on our Webex", markdown=True)

# 向 Webex 中的一个空间发送消息
agent.print_response(
    "Send a funny ice-breaking message to the webex Welcome space", markdown=True
)
```

## Toolkit 参数

| 参数             | 类型     | 默认值    | 描述                                                      |
| -------------- | ------ | ------ | ------------------------------------------------------- |
| `access_token` | `str`  | `None` | 用于身份验证的 Webex 访问令牌。如果未提供，则使用 WEBEX\_ACCESS\_TOKEN 环境变量。 |
| `send_message` | `bool` | `True` | 启用向 Webex 空间发送消息。                                       |
| `list_rooms`   | `bool` | `True` | 启用列出 Webex 空间/房间。                                       |

## Toolkit 函数

| 函数             | 描述                                                        |
| -------------- | --------------------------------------------------------- |
| `send_message` | 向 Webex 房间发送消息。参数：目标房间的 `room_id` (str)，消息的 `text` (str)。 |
| `list_rooms`   | 列出所有可用的 Webex 房间/空间及其详细信息，包括 ID、标题、类型和可见性设置。              |

## 开发者资源

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