feat: align subtitles from first 10 seconds audio
This commit is contained in:
1 parent
93e06ca40a
commit
5228765473
11 files changed
+248
-22
No files matched your search
@@ -14,6 +14,7 @@ class DeepSeekConfig:
|
||||
api_key: str
|
||||
base_url: str
|
||||
model: str
|
||||
audio_model: str
|
||||
|
||||
|
||||
def read_env_file(path: Path = ENV_PATH) -> dict[str, str]:
|
||||
@@ -36,10 +37,14 @@ def get_config_value(key: str, default: str = "") -> str:
|
||||
|
||||
|
||||
def load_deepseek_config() -> DeepSeekConfig:
|
||||
api_key = get_config_value("AI_API_KEY") or get_config_value("DEEPSEEK_API_KEY")
|
||||
base_url = get_config_value("AI_BASE_URL") or get_config_value("DEEPSEEK_BASE_URL", "https://api.deepseek.com")
|
||||
model = get_config_value("AI_TEXT_MODEL") or get_config_value("DEEPSEEK_MODEL", "deepseek-chat")
|
||||
return DeepSeekConfig(
|
||||
api_key=get_config_value("DEEPSEEK_API_KEY"),
|
||||
base_url=get_config_value("DEEPSEEK_BASE_URL", "https://api.deepseek.com").rstrip("/"),
|
||||
model=get_config_value("DEEPSEEK_MODEL", "deepseek-chat"),
|
||||
api_key=api_key,
|
||||
base_url=base_url.rstrip("/"),
|
||||
model=model,
|
||||
audio_model=get_config_value("AI_AUDIO_MODEL") or model,
|
||||
)
|
||||
|
||||
|
||||
@@ -50,7 +55,7 @@ def get_ai_status() -> dict[str, object]:
|
||||
"configured": False,
|
||||
"provider": "deepseek",
|
||||
"model": config.model,
|
||||
"message": "未配置 DEEPSEEK_API_KEY,请在 .env 或环境变量中填写。",
|
||||
"message": "未配置 AI_API_KEY,请在 .env 中填写。旧配置 DEEPSEEK_API_KEY 也兼容。",
|
||||
}
|
||||
return {
|
||||
"configured": True,
|
||||
|
||||
Reference in new issue
Block a user