Files
bytedance/README.md
T
2026-08-05 18:19:57 +08:00

63 lines
1.1 KiB
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.
# bytedance
字节跳动安全通信 SDK,为豆包等字节系 API 提供加密通信通道。以 namespace package 组织,包含多个子模块。
---
## 安装
```
uv pip install -e utils/bytedance
```
---
## 子模块
| 模块 | 说明 |
| --- | --- |
| bytedance.volcengine_aicc_sdk | 火山引擎 AICC 安全通信 SDK(SecureHttpClient, AICCConfig) |
| bytedance.tks | TKS 安全通信组件 |
| bytedance.jeddak_secure_channel | Jeddak 安全通道 |
---
## 使用示例
```
from bytedance.volcengine_aicc_sdk.secure_http_client import (
AICCConfig,
AsyncSecureHttpClient,
)
config = AICCConfig(
access_key="your-access-key",
secret_key="your-secret-key",
)
client = AsyncSecureHttpClient(config)
```
---
## 在豆包插件中的应用
src/plugins/doubao/__init__.py 根据配置决定是否启用 AICC 安全通道:
```
if is_aicc:
from bytedance.volcengine_aicc_sdk.secure_http_client import (
AICCConfig, AsyncSecureHttpClient,
)
```
---
## 依赖
- requests — HTTP 客户端
- pyjwt — JWT 处理
- pymerkle — Merkle 树验证
- jwcrypto — JWE/JWS 加密
- loguru — 日志
- wget — 文件下载