Files
bigwo/coze_api/README.md
2026-03-12 12:47:56 +08:00

29 lines
613 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Coze 智能体 API 调用
## 使用说明
### 1. 安装依赖
```bash
pip install -r requirements.txt
```
### 2. 配置环境变量
复制 `.env.example``.env`,填写你的 Coze API 凭证:
```bash
cp .env.example .env
```
需要填写:
- `COZE_API_TOKEN` - Coze 平台的 API Token在 Coze 平台 → 个人设置 → API Token 获取)
- `COZE_BOT_ID` - Bot ID在 Bot 发布后获取)
### 3. 运行测试
```bash
python test_coze_api.py
```
## 文件说明
- `coze_client.py` - Coze API 封装客户端
- `test_coze_api.py` - 测试调用脚本
- `.env.example` - 环境变量模板