bugfix
This commit is contained in:
parent
8b296c7475
commit
bd0cc6d5ad
@ -181,6 +181,7 @@ where a.llmid = b.id
|
||||
await sor.U('llmusage', {'id': llmusage.id, 'accounting_status': 'failed'})
|
||||
debug(f'{r.usages=} is None')
|
||||
continue
|
||||
d = None
|
||||
try:
|
||||
if isinstance(r.usages, str):
|
||||
r.usages = json.loads(r.usages)
|
||||
|
||||
12
wwwroot/test_llm_charging.dspy
Normal file
12
wwwroot/test_llm_charging.dspy
Normal file
@ -0,0 +1,12 @@
|
||||
luid=params_kw.luid
|
||||
env = ServerEnv()
|
||||
async with get_sor_context(env, 'llmage') as sor:
|
||||
sql = "select a.ppid, b.* from llm a, llmusage b where a.id=b.llmid and b.id=${id}$"
|
||||
recs = await sor.sqlExe(sql, {'id': luid})
|
||||
if recs:
|
||||
r = recs[0]
|
||||
x = await llm_charging(r.ppid, r.usages)
|
||||
return x
|
||||
return {'sql': sql, 'luid': luid, 'error': 'llm not found'}
|
||||
return {
|
||||
'error': 'error'}
|
||||
Loading…
x
Reference in New Issue
Block a user