This commit is contained in:
yumoqing 2025-08-31 12:14:17 +08:00
parent 0929e59d0d
commit 0f8875f799
2 changed files with 17 additions and 12 deletions

View File

@ -27,18 +27,24 @@ async def get_llm(llmid):
db = DBPools() db = DBPools()
dbname = get_serverenv('get_module_dbname')('llmage') dbname = get_serverenv('get_module_dbname')('llmage')
async with db.sqlorContext(dbname) as sor: async with db.sqlorContext(dbname) as sor:
sql = """select a.*, sql = """select x.*,
d.input_fields, z.input_fields,
d.input_view, z.input_view,
d.output_view, z.output_view,
c.system_message, y.system_message,
c.user_message, y.user_message,
c.assisant_message y.assisant_message
from llm a, llmcatelog b from (
left join historyformat c on b.hfid = c.id select a.*, b.hfid, e.ioid
left join uapiio d on b.ioid = d.id from llm a, llmcatelog b,upapp c, uapiset d, uapi e
where a.llmcatelogid = b.id 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}) recs = await sor.sqlExe(sql, {'llmid': llmid})
if len(recs) > 0: if len(recs) > 0:

View File

@ -15,7 +15,6 @@
"llmid":"{{llm.id}}", "llmid":"{{llm.id}}",
"llmcatelogid":"{{llm.llmcatelogid}}", "llmcatelogid":"{{llm.llmcatelogid}}",
"output_view":{{llm.output_view}}, "output_view":{{llm.output_view}},
"input_from":"userinput",
"system_message_format":{{llm.system_message or default_sysmessage()}}, "system_message_format":{{llm.system_message or default_sysmessage()}},
"user_message_format":{{llm.user_message or default_usrmessage()}}, "user_message_format":{{llm.user_message or default_usrmessage()}},
"llm_message_format":{{llm.assisant_message or default_llmmessage()}}, "llm_message_format":{{llm.assisant_message or default_llmmessage()}},