feat(translate): service.py 接 zhipu / config 加 zhipu_* / .env.example 加 ZHIPU 配置

配 zhipu.py(zhipu 模块)一起使用:
- service.py: 新增 _zhipu_translator(),引擎选择链路 spark → zhipu → tencent → maas → agnes → local
- config.py: 新增 zhipu_api_key / zhipu_base_url / zhipu_model / zhipu_interval_sec
- .env.example: 补 ZHIPU_* 字段说明

留空 zhipu_api_key = spark 不可用时直接降级 tencent(向后兼容)
This commit is contained in:
Mavis
2026-06-10 23:48:14 +08:00
parent b6fc1b322f
commit 3f183d14db
3 changed files with 49 additions and 11 deletions

View File

@@ -77,6 +77,13 @@ class Settings(BaseSettings):
spark_model: str = "lite"
spark_interval_sec: float = 1.0
# ===== 智谱 GLM(第二序位翻译;GLM-4-Flash 免费)=====
# 留空 = 不启用智谱(spark 不可用时直接降级到 tencent)
zhipu_api_key: str = ""
zhipu_base_url: str = "https://open.bigmodel.cn/api/paas/v4"
zhipu_model: str = "glm-4-flash"
zhipu_interval_sec: float = 1.0
@field_validator("tencent_tmt_quota_buffer")
@classmethod
def _check_buffer(cls, v: float) -> float: