fix: get_llm_name case-insensitive match & refactor to accept optional backend param
This commit is contained in:
10
agentmain.py
10
agentmain.py
@@ -77,13 +77,13 @@ class GeneraticAgent:
|
|||||||
self.llmclient = self.llmclients[self.llm_no]
|
self.llmclient = self.llmclients[self.llm_no]
|
||||||
self.llmclient.backend.history = lastc.backend.history
|
self.llmclient.backend.history = lastc.backend.history
|
||||||
self.llmclient.last_tools = ''
|
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')
|
if 'glm' in name or 'minimax' in name or 'kimi' in name: load_tool_schema('_cn')
|
||||||
else: load_tool_schema()
|
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 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):
|
def get_llm_name(self, b=None):
|
||||||
b = self.llmclient
|
b = self.llmclient if b is None else b
|
||||||
return f"{type(b.backend).__name__}/{b.backend.name}"
|
return f"{type(b.backend).__name__}/{b.backend.name}" if not isinstance(b, dict) else "BADCONFIG_MIXIN"
|
||||||
|
|
||||||
def abort(self):
|
def abort(self):
|
||||||
if not self.is_running: return
|
if not self.is_running: return
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ L4: L4_raw_sessions/
|
|||||||
5. 进程: 禁无条件杀python(杀自己), 精确PID, 禁os.kill判活
|
5. 进程: 禁无条件杀python(杀自己), 精确PID, 禁os.kill判活
|
||||||
6. 窗口: GUI状态优先win32gui枚举标题
|
6. 窗口: GUI状态优先win32gui枚举标题
|
||||||
7. web JS: 输入用原生setter+事件链, 点击前检disabled, 注意引号转义; scan空/不全先稍等再scan, 禁首扫定论
|
7. web JS: 输入用原生setter+事件链, 点击前检disabled, 注意引号转义; scan空/不全先稍等再scan, 禁首扫定论
|
||||||
8. SOP: 读SOP禁凭印象,有utils必用 | 复杂长程/用户提及规划模式→读plan_sop
|
8. SOP: 读SOP禁凭印象,有utils必用 | 复杂超长程任务/用户明确提及规划模式→读plan_sop
|
||||||
|
|||||||
Reference in New Issue
Block a user