[文档]:完成 README 中文化,包含项目说明、配置、验收命令和安全约束

This commit is contained in:
mkbk
2026-06-17 18:51:14 +08:00
parent 1b884ac6a9
commit 9729969915
+44 -6
View File
@@ -1,18 +1,56 @@
# Owner Voice Pet
# Owner 语音桌宠
Python desktop pet voice pipeline for the OpenSpec change `add-voice-pet-pipeline`.
这是 `add-voice-pet-pipeline` OpenSpec 变更交付的 Python 桌宠语音 Pipeline
The first implementation keeps secrets out of the repository. Configure runtime values with environment variables:
当前实现覆盖:
- “小杰小杰”唤醒词入口
- 本机音频 Transport 抽象和文件/内存回放测试通道
- VAD 人声端点检测
- 本地 STT Provider 边界和测试 Provider
- OpenAI/NewAPI 兼容 LLM Provider
- 本地 TTS Provider 边界和测试 TTS
- 桌宠状态映射、无 GUI fallback、透明 PNG 状态资产
- OpenSpec 主规范、自动化测试、CLI 验收和安全扫描
## 配置
密钥不得写入仓库。运行时通过环境变量配置:
- `OWNER_LLM_BASE_URL`
- `OWNER_LLM_API_KEY`
- `OWNER_LLM_MODEL`
- `OWNER_LLM_API_STYLE`
Validation commands used by the change:
默认配置面向当前 NewAPI
```bash
python3.11 -m compileall src tests
python3.11 -m unittest discover -s tests
OWNER_LLM_BASE_URL=https://newapi.mkbk.shop
OWNER_LLM_MODEL=gpt-5.4-mini
OWNER_LLM_API_STYLE=chat_completions
```
## 验收命令
```bash
PYTHONPATH=src python3.11 -m compileall src tests scripts
PYTHONPATH=src python3.11 -m unittest discover -s tests
PYTHONPATH=src python3.11 -m owner_voice_pet acceptance
PYTHONPATH=src python3.11 -m owner_voice_pet validate-assets
PYTHONPATH=src python3.11 -m owner_voice_pet security-check
openspec validate --all --strict
```
真实 NewAPI smoke 测试示例:
```bash
OWNER_LLM_API_KEY=你的临时Key \
PYTHONPATH=src python3.11 -m owner_voice_pet llm-smoke --no-stream --message '用一句中文回复:小杰在线。'
```
## 安全约束
- API key 只从环境变量读取。
- 仓库内不保存真实密钥。
- 默认不持久化原始麦克风音频。
- `security-check` 会扫描已跟踪文本文件中的 `sk-...` 形式密钥。