fix: 修正 AI 服务配置说明

- 明确使用 OneAPI/OneInAll 等中转服务商,不直连 AI 厂商
- 创建 CONVENTIONS.md 记录项目约定,避免误解

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Your Name 2026-02-09 12:52:13 +08:00
parent 37ac749071
commit 3deaa7dcaa
2 changed files with 34 additions and 4 deletions

29
CONVENTIONS.md Normal file
View File

@ -0,0 +1,29 @@
# 项目约定与设计决策
本文档记录容易被误解的设计决策,确保开发一致性。
---
## AI 服务配置
**重要:系统使用 AI 中转服务商,不直连 AI 厂商!**
- 使用 OneAPI / OneInAll / OpenRouter 等中转服务商
- 中转服务商统一了不同 AI 厂商豆包、通义、DeepSeek 等)的接口
- 只需配置中转服务商的 API Key 和 Base URL
- 具体使用哪个底层模型,由中转服务商的模型名称决定
```python
# 正确 ✓
AI_PROVIDER = "oneapi"
AI_API_BASE_URL = "https://api.oneinall.ai/v1"
# 错误 ✗ - 不直接配置 AI 厂商
AI_PROVIDER = "doubao"
```
---
## 其他约定
(后续添加)

View File

@ -21,10 +21,11 @@ class Settings(BaseSettings):
ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
# AI 服务
AI_PROVIDER: str = "doubao" # doubao | qwen | deepseek
AI_API_KEY: str = ""
AI_API_BASE_URL: str = ""
# AI 服务(使用 OneAPI/OneInAll 等中转服务商,不直连厂商)
# 中转服务商统一了不同 AI 厂商的接口,只需配置中转商的 API
AI_PROVIDER: str = "oneapi" # oneapi | oneinall | openrouter 等中转服务商
AI_API_KEY: str = "" # 中转服务商的 API Key
AI_API_BASE_URL: str = "" # 中转服务商的 Base URL如 https://api.oneinall.ai/v1
class Config:
env_file = ".env"