添加长期存储,流式检查
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled

This commit is contained in:
2026-04-17 01:26:05 +08:00
parent 602d551fd1
commit 404efde282
37 changed files with 794 additions and 2095 deletions

View File

@@ -24,7 +24,7 @@ class FrontendConfig:
layout: str = "wide"
# ==================== 模型配置 ====================
default_model: str = "zhipu"
default_model: str = "local" # 更改为local作为默认模型
model_options: dict = None
# ==================== 用户配置 ====================
@@ -41,9 +41,9 @@ class FrontendConfig:
"""初始化后处理 - 设置默认值和加载环境变量"""
if self.model_options is None:
self.model_options = {
"zhipu": "智谱 GLM-4.7-Flash在线",
"deepseek": "DeepSeek V3.2(在线)",
"local": "本地 llama.cppGemma-4"
"local": "本地 llama.cppGemma-4", # 本地模型作为第一个
"deepseek": "DeepSeek V3.2(在线)", # DeepSeek 作为中间
"zhipu": "智谱 GLM-4.7-Flash在线" # GLM-4.7 作为最后一个
}
# 从环境变量加载配置
@@ -53,9 +53,9 @@ class FrontendConfig:
"""从环境变量加载配置(优先级最高)"""
# API 地址(移除 /chat 后缀)
# 优先级:环境变量 API_URL > 默认值
api_url = os.getenv("API_URL", "http://localhost:8083")
api_url = os.getenv("API_URL", "http://127.0.0.1:8083")
self.api_base = api_url.replace("/chat", "").rstrip("/")
# 全局配置实例(单例模式)
config = FrontendConfig()
config = FrontendConfig()