From a4856cef48f628c49f37657b1ebc701d1d9bd4f9 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 22 Dec 2025 14:08:47 +0800 Subject: [PATCH] bugfix --- wwwroot/llmcost.dspy | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 wwwroot/llmcost.dspy diff --git a/wwwroot/llmcost.dspy b/wwwroot/llmcost.dspy new file mode 100644 index 0000000..6c7b7d5 --- /dev/null +++ b/wwwroot/llmcost.dspy @@ -0,0 +1,20 @@ +debug(f'{params_kw=}') +ns = params_kw.copy() +if not ns.page: + ns.page = 1 +ns.sort = "use_date desc" +if not ns.use_date: + ns.use_date = curDateString() + +async with get_sor_context(request._run_ns, 'llmage') as sor: + sql = """select a.id, a.llmid, a.usage, b.name, b.ppid +from llmusage a, llm b +where a.llmid = b.id + and use_date=${use_date}$ +""" + d = await sor.R('llmusage', ns) + for r in d['rows']: + if r.ppid: + r.amount = await pricing_program_charging(sor, r.ppid, r.usage) + return d +return None