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

## 代码

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

agent = Agent(
    name="Webex 助手",
    tools=[WebexTools()],
    description="你是一个 Webex 助手，可以发送消息和管理空间。",
    instructions=[
        "你可以通过以下方式帮助用户：",
        "- 列出可用的 Webex 空间",
        "- 向空间发送消息",
        "发送消息前，请务必确认空间存在。",
    ],
    show_tool_calls=True,
    markdown=True,
)

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

# 向 Webex 中的一个空间发送消息
agent.print_response(
    "向 Webex 的 Welcome 空间发送一条有趣的破冰消息", markdown=True
)
```

## 用法

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

  <Step title="设置 Webex 机器人">
    1. 前往 [Webex 开发者门户](https://developer.webex.com/)
    2. 创建一个机器人：
       * 导航到 我的 Webex 应用 → 创建机器人
       * 填写机器人详细信息并点击 添加机器人
    3. 获取你的访问令牌：
       * 复制创建机器人后显示的令牌
       * 或者通过 我的 Webex 应用 → 编辑机器人 重新生成
  </Step>

  <Step title="设置你的 API 密钥">
    ```bash theme={null}
    export WEBEX_ACCESS_TOKEN=xxx
    export OPENAI_API_KEY=xxx
    ```
  </Step>

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

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

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