This commit is contained in:
yumoqing 2026-03-30 16:07:52 +08:00
parent 46259314f0
commit 72239535e2
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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
try:
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
except:
continue
r.amount = prices.amount
r.cost = prices.cost