feat: 将智谱模型设为默认首要选择
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m29s
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m29s
This commit is contained in:
@@ -51,7 +51,7 @@ class LLMFactory:
|
|||||||
|
|
||||||
# 模型创建器映射
|
# 模型创建器映射
|
||||||
CREATORS = {
|
CREATORS = {
|
||||||
|
"zhipu": create_zhipu,
|
||||||
"local": create_local,
|
"local": create_local,
|
||||||
"deepseek": create_deepseek,
|
"deepseek": create_deepseek,
|
||||||
"zhipu": create_zhipu,
|
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ class AIAgentService:
|
|||||||
raise RuntimeError("没有可用的模型")
|
raise RuntimeError("没有可用的模型")
|
||||||
return self
|
return self
|
||||||
|
|
||||||
async def process_message(self, message: str, thread_id: str, model: str = "local", user_id: str = "default_user") -> dict:
|
async def process_message(self, message: str, thread_id: str, model: str = "zhipu", user_id: str = "default_user") -> dict:
|
||||||
"""处理用户消息,返回包含回复、token统计和耗时的字典"""
|
"""处理用户消息,返回包含回复、token统计和耗时的字典"""
|
||||||
if model not in self.graphs:
|
if model not in self.graphs:
|
||||||
# 回退到第一个可用模型
|
# 回退到第一个可用模型
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class FrontendConfig:
|
|||||||
layout: str = "wide"
|
layout: str = "wide"
|
||||||
|
|
||||||
# ==================== 模型配置(固定值,无需环境变量) ====================
|
# ==================== 模型配置(固定值,无需环境变量) ====================
|
||||||
default_model: str = "local"
|
default_model: str = "zhipu"
|
||||||
model_options: Optional[dict] = None
|
model_options: Optional[dict] = None
|
||||||
|
|
||||||
# ==================== 用户配置(固定值,无需环境变量) ====================
|
# ==================== 用户配置(固定值,无需环境变量) ====================
|
||||||
@@ -72,9 +72,9 @@ class FrontendConfig:
|
|||||||
"""初始化后处理 - 设置默认值和加载环境变量"""
|
"""初始化后处理 - 设置默认值和加载环境变量"""
|
||||||
if self.model_options is None:
|
if self.model_options is None:
|
||||||
self.model_options = {
|
self.model_options = {
|
||||||
|
"zhipu": "智谱 GLM-4.7-Flash(在线)",
|
||||||
"local": "本地 llama.cpp(Gemma-4)",
|
"local": "本地 llama.cpp(Gemma-4)",
|
||||||
"deepseek": "DeepSeek V3.2(在线)",
|
"deepseek": "DeepSeek V3.2(在线)"
|
||||||
"zhipu": "智谱 GLM-4.7-Flash(在线)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 从环境变量加载配置(优先级最高)
|
# 从环境变量加载配置(优先级最高)
|
||||||
|
|||||||
Reference in New Issue
Block a user