llmage/wwwroot/grap_task_status.dspy
2026-03-30 12:04:24 +08:00

19 lines
591 B
Plaintext

taskid = params_kw.taskid
async with get_sor_context(request._run_ns, 'llmage') as sor:
recs = await sor.R('llmusage', {'taskid': taskid})
if len(recs) == 0:
e = Exception(f'{taskid=} not found in llmusage')
exception(f'{e}')
raise e
llmusage = recs[0]
recs = await sor.R('llm', {'id': llmusage.llmid})
if len(recs) == 0:
e = Exception(f'{llmusage.llmid=} not found in llm')
exception(f'{e}')
raise e
llm = recs[0]
userid = await sor_get_callerid(sor, llm.ownerid)
x = await query_task_status(request, llm.upappid, llm.query_apiname,
llmusage.id, userid, taskid)