bugfix
This commit is contained in:
parent
46259314f0
commit
72239535e2
@ -11,7 +11,7 @@ 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 prices is None:
|
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}')
|
exception(f'{e}')
|
||||||
raise e
|
raise e
|
||||||
return None
|
return None
|
||||||
|
|||||||
@ -9,11 +9,10 @@ async with get_sor_context(env, 'llmage') as sor:
|
|||||||
e = Exception(f'{r.llmid=} not found in llm')
|
e = Exception(f'{r.llmid=} not found in llm')
|
||||||
exception(f'{e}')
|
exception(f'{e}')
|
||||||
raise e
|
raise e
|
||||||
prices = await llm_charging(sor, llms[0].ppid, r)
|
try:
|
||||||
if not prices:
|
prices = await llm_charging(sor, llms[0].ppid, r)
|
||||||
e = Exception(f'{llms[0].ppid=}{r=} not price')
|
except:
|
||||||
exception(f'{e}')
|
continue
|
||||||
raise e
|
|
||||||
|
|
||||||
r.amount = prices.amount
|
r.amount = prices.amount
|
||||||
r.cost = prices.cost
|
r.cost = prices.cost
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user