2025-12-02 18:54:14 +08:00

17 lines
838 B
Markdown
Raw Permalink 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.

# 变更:修复 DashScope API Key 验证逻辑
## 原因
当前实现在初始化 `DashScopeService` 时立即检查 API key如果为空就抛出错误。这导致即使 API key 在 `config.yaml` 中设置为空字符串,应用程序也无法启动。应该允许 API key 为空,在实际调用 API 时才进行验证。
## 变更内容
- 修改 `DashScopeService.__init__` 方法,允许 API key 为空
- 在实际调用 API 方法时(`analyze_video`, `summarize_video`, `compare_videos`)才检查 API key
- 提供更友好的错误提示,指导用户在 `config.yaml` 中设置 API key
## 影响
- 受影响的文件:`app/services/dashscope_service.py`
- 应用程序可以在未设置 API key 的情况下启动
- 只有在实际使用视频分析功能时才会提示需要设置 API key
- 不影响其他功能