llmage/wwwroot/llmaccounting.dspy
2026-03-30 15:49:37 +08:00

10 lines
324 B
Plaintext

env = request._run_ns
async with get_sor_context(env, 'llmage') as sor:
sql = "select * from llmusage where status='SUCCEEDED' and accounting_status != 'accounted'"
recs = sor.sqlExe(sql, {})
for r in recs:
try:
x = await llm_accounting(request, r)
except Exception as e:
exception(f'{r.id=} accounting error')