This commit is contained in:
yumoqing 2026-03-30 16:04:54 +08:00
parent 74ab62a3b1
commit 46259314f0

View File

@ -10,10 +10,11 @@ from accounting.getaccount import getCustomerBalance
async def llm_charging(sor, ppid, llmusage): async def llm_charging(sor, ppid, llmusage):
env = ServerEnv() env = ServerEnv()
prices = await env.pricing_program_charging(sor, ppid, llmusage.usage) prices = await env.pricing_program_charging(sor, ppid, llmusage.usage)
if len(prices) == 0: if prices is None:
d = DictObject() e = Exception(f'{ppid=}, {llmusage.usage=} env.pricing_program_charging() return None')
d.original_amount = d.amount = d.cost = 0.00 exception(f'{e}')
return d raise e
return None
amount = 0 amount = 0
cost = 0 cost = 0
for p in prices: for p in prices: