WebexTools 允许智能体与 Cisco Webex 进行交互,从而能够发送消息和列出房间。
前置条件
以下示例需要 webexpythonsdk
库和一个 Webex 访问令牌,可以通过 Webex 开发者门户 获取。
开始使用 Webex:
-
创建 Webex Bot:
- 前往 开发者门户
- 导航至 My Webex Apps → Create a Bot
- 填写机器人详情并点击 Add Bot
-
获取您的访问令牌:
- 复制机器人创建后显示的令牌
- 或通过 My Webex Apps → Edit Bot 重新生成
- 将其设置为 WEBEX_ACCESS_TOKEN 环境变量
-
将机器人添加到 Webex:
pip install webexpythonsdk
export WEBEX_ACCESS_TOKEN=your_access_token_here
以下智能体将列出所有空间并使用 Webex 发送消息:
cookbook/tools/webex_tool.py
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
)
参数 | 类型 | 默认值 | 描述 |
---|
access_token | str | None | 用于身份验证的 Webex 访问令牌。如果未提供,则使用 WEBEX_ACCESS_TOKEN 环境变量。 |
send_message | bool | True | 启用向 Webex 空间发送消息。 |
list_rooms | bool | True | 启用列出 Webex 空间/房间。 |
函数 | 描述 |
---|
send_message | 向 Webex 房间发送消息。参数:目标房间的 room_id (str),消息的 text (str)。 |
list_rooms | 列出所有可用的 Webex 房间/空间及其详细信息,包括 ID、标题、类型和可见性设置。 |
开发者资源
Responses are generated using AI and may contain mistakes.