fix: get_llm_name case-insensitive match & refactor to accept optional backend param

This commit is contained in:
Liang Jiaqing
2026-04-18 14:46:05 +08:00
parent c529abce3c
commit 2632478d96
2 changed files with 6 additions and 6 deletions

View File

@@ -77,13 +77,13 @@ class GeneraticAgent:
self.llmclient = self.llmclients[self.llm_no]
self.llmclient.backend.history = lastc.backend.history
self.llmclient.last_tools = ''
name = self.get_llm_name()
name = self.get_llm_name().lower()
if 'glm' in name or 'minimax' in name or 'kimi' in name: load_tool_schema('_cn')
else: load_tool_schema()
def list_llms(self): return [(i, f"{type(b.backend).__name__}/{b.backend.name}", i == self.llm_no) for i, b in enumerate(self.llmclients)]
def get_llm_name(self):
b = self.llmclient
return f"{type(b.backend).__name__}/{b.backend.name}"
def list_llms(self): return [(i, self.get_llm_name(b), i == self.llm_no) for i, b in enumerate(self.llmclients)]
def get_llm_name(self, b=None):
b = self.llmclient if b is None else b
return f"{type(b.backend).__name__}/{b.backend.name}" if not isinstance(b, dict) else "BADCONFIG_MIXIN"
def abort(self):
if not self.is_running: return

View File

@@ -19,4 +19,4 @@ L4: L4_raw_sessions/
5. 进程: 禁无条件杀python(杀自己), 精确PID, 禁os.kill判活
6. 窗口: GUI状态优先win32gui枚举标题
7. web JS: 输入用原生setter+事件链, 点击前检disabled, 注意引号转义; scan空/不全先稍等再scan, 禁首扫定论
8. SOP: 读SOP禁凭印象,有utils必用 | 复杂长程/用户提及规划模式→读plan_sop
8. SOP: 读SOP禁凭印象,有utils必用 | 复杂长程任务/用户明确提及规划模式→读plan_sop