From 18d8fef1b93fa2dd45aa4ac2e95df26a0a5442ac Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 26 Feb 2026 17:45:59 +0800 Subject: [PATCH] bugfix --- wwwroot/llmcheck.dspy | 70 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 wwwroot/llmcheck.dspy diff --git a/wwwroot/llmcheck.dspy b/wwwroot/llmcheck.dspy new file mode 100644 index 0000000..45abee8 --- /dev/null +++ b/wwwroot/llmcheck.dspy @@ -0,0 +1,70 @@ +llmid = params_kw.llmid +today= params_kw.today +msgs = [] +async with get_sor_context(request._run_ns, 'llmage') as sor: + sql = "select * from llm where id=${llmid}$ and enabled_date <= ${today}$ and expired_date > ${today}$" + ns = {'llmid': llmid, 'today': today} + recs = await sor.sqlExe(sql, ns.copy()) + if recs: + msgs.append('llm read ok') + else: + msgs.append(f'llm not found: {llmid=}, {today=}') + return msgs + sql = """select a.* from llm a, upapp b +where a.id=${llmid}$ + and a.upappid = b.id + and a.enabled_date <= ${today}$ + and a.expired_date > ${today}$""" + recs = awaut sor.sqlExe(sql, ns.copy()) + if recs: + msgs.append('llm join upapp read ok') + else: + msgs.append('llm join upapp not found: {llmid=}, {today=}') + return msgs + sql = """select a.* from llm a, upapp b, uapiset c +where a.id=${llmid}$ + and a.upappid = b.id + and b.apisetid = c.id + and a.enabled_date <= ${today}$ + and a.expired_date > ${today}$""" + recs = awaut sor.sqlExe(sql, ns.copy()) + if recs: + msgs.append('llm join upapp read ok') + else: + msgs.append('llm join upapp not found: {llmid=}, {today=}') + return msgs + + sql = """select a.*, e.ioid, e.stream +from llm a, upapp c, uapiset d, uapi e +where a.upappid = c.id + and c.apisetid = d.id + and e.apisetid = d.id + and a.apiname = e.name + and a.id=${llmid}$ + and a.expired_date > ${today}$ + and a.enabled_date <= ${today}$""" + recs = awaut sor.sqlExe(sql, ns.copy()) + if recs: + msgs.append('llm join upapp join uapi read ok') + else: + msgs.append('llm join upapp join uapi not found: {llmid=}, {today=}') + return msgs + + sql = """select a.*, e.ioid, e.stream +from llm a, upapp c, uapiset d, uapi e, uapiio b +where a.upappid = c.id + and c.apisetid = d.id + and e.apisetid = d.id + and a.apiname = e.name + and e.ioid = b.id + and a.id=${llmid}$ + and a.expired_date > ${today}$ + and a.enabled_date <= ${today}$""" + recs = awaut sor.sqlExe(sql, ns.copy()) + if recs: + msgs.append('llm join upapp join uapi join uapiio read ok') + else: + msgs.append('llm join upapp join uapi join uapiio not found: {llmid=}, {today=}') + return msgs + return msgs +return msgs