bugfix
This commit is contained in:
parent
45afffafeb
commit
61896ec185
@ -12,7 +12,7 @@ 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.usages)
|
||||||
if prices is None:
|
if prices is None:
|
||||||
e = Exception(f'{ppid=}, {llmusage.usage=}{llmusage.id=} 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}')
|
||||||
|
|||||||
@ -199,7 +199,7 @@ async def query_task_status(request, upappid, apiname, luid, userid, taskid):
|
|||||||
await add_new_llmusage_output(luid, changed)
|
await add_new_llmusage_output(luid, changed)
|
||||||
return
|
return
|
||||||
if changed.status == 'SUCCEEDED':
|
if changed.status == 'SUCCEEDED':
|
||||||
llmusage.usage = changed.output.usage
|
llmusage.usages = changed.output.usage
|
||||||
if llm.ppid:
|
if llm.ppid:
|
||||||
try:
|
try:
|
||||||
charging = await llm_charging(sor,
|
charging = await llm_charging(sor,
|
||||||
|
|||||||
@ -48,7 +48,7 @@ async def sync_uapi_request(request, llm, sor, callerid, callerorgid, params_kw=
|
|||||||
llmusage.use_date = curDateString()
|
llmusage.use_date = curDateString()
|
||||||
llmusage.use_time = timestampstr()
|
llmusage.use_time = timestampstr()
|
||||||
llmusage.userid = callerid
|
llmusage.userid = callerid
|
||||||
llmusage.usage = json.dumps(usage, ensure_ascii=False)
|
llmusage.usages = json.dumps(usage, ensure_ascii=False)
|
||||||
llmusage.ioinfo = json.dumps({
|
llmusage.ioinfo = json.dumps({
|
||||||
"input": params_kw,
|
"input": params_kw,
|
||||||
"output": [d]
|
"output": [d]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user