From 72239535e217d19260d7a5b9deb4f71d067d82fa Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 30 Mar 2026 16:07:52 +0800 Subject: [PATCH] bugfix --- llmage/accounting.py | 2 +- wwwroot/llmaccounting.dspy | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/llmage/accounting.py b/llmage/accounting.py index e01485a..73794b1 100644 --- a/llmage/accounting.py +++ b/llmage/accounting.py @@ -11,7 +11,7 @@ async def llm_charging(sor, ppid, llmusage): env = ServerEnv() prices = await env.pricing_program_charging(sor, ppid, llmusage.usage) if prices is None: - e = Exception(f'{ppid=}, {llmusage.usage=} env.pricing_program_charging() return None') + e = Exception(f'{ppid=}, {llmusage.usage=}{llmusage.id=} env.pricing_program_charging() return None') exception(f'{e}') raise e return None diff --git a/wwwroot/llmaccounting.dspy b/wwwroot/llmaccounting.dspy index de668cb..6584c7b 100644 --- a/wwwroot/llmaccounting.dspy +++ b/wwwroot/llmaccounting.dspy @@ -9,11 +9,10 @@ async with get_sor_context(env, 'llmage') as sor: e = Exception(f'{r.llmid=} not found in llm') exception(f'{e}') raise e - prices = await llm_charging(sor, llms[0].ppid, r) - if not prices: - e = Exception(f'{llms[0].ppid=}{r=} not price') - exception(f'{e}') - raise e + try: + prices = await llm_charging(sor, llms[0].ppid, r) + except: + continue r.amount = prices.amount r.cost = prices.cost