From 0f8875f7998091ac9ec4fe8eea8fa52fec41a81a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 31 Aug 2025 12:14:17 +0800 Subject: [PATCH] bugfix --- llmage/llmclient.py | 28 +++++++++++++++++----------- wwwroot/llm_dialog.ui | 1 - 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/llmage/llmclient.py b/llmage/llmclient.py index 2e9bec6..2573ba3 100644 --- a/llmage/llmclient.py +++ b/llmage/llmclient.py @@ -27,18 +27,24 @@ async def get_llm(llmid): db = DBPools() dbname = get_serverenv('get_module_dbname')('llmage') async with db.sqlorContext(dbname) as sor: - sql = """select a.*, -d.input_fields, -d.input_view, -d.output_view, -c.system_message, -c.user_message, -c.assisant_message -from llm a, llmcatelog b - left join historyformat c on b.hfid = c.id - left join uapiio d on b.ioid = d.id + sql = """select x.*, +z.input_fields, +z.input_view, +z.output_view, +y.system_message, +y.user_message, +y.assisant_message +from ( +select a.*, b.hfid, e.ioid +from llm a, llmcatelog b,upapp c, uapiset d, uapi e where a.llmcatelogid = b.id - and a.id = ${llmid}$ + and a.upappid = c.id + and c.apisetid = d.id + and e.apisetid = d.id + and a.apiname = e.name +) x left join historyformat y on x.hfid = y.id + left join uapiio z on x.ioid = z.id +where x.id = ${llmid}$ """ recs = await sor.sqlExe(sql, {'llmid': llmid}) if len(recs) > 0: diff --git a/wwwroot/llm_dialog.ui b/wwwroot/llm_dialog.ui index e48b9a4..f1a205d 100644 --- a/wwwroot/llm_dialog.ui +++ b/wwwroot/llm_dialog.ui @@ -15,7 +15,6 @@ "llmid":"{{llm.id}}", "llmcatelogid":"{{llm.llmcatelogid}}", "output_view":{{llm.output_view}}, - "input_from":"userinput", "system_message_format":{{llm.system_message or default_sysmessage()}}, "user_message_format":{{llm.user_message or default_usrmessage()}}, "llm_message_format":{{llm.assisant_message or default_llmmessage()}},