feat: add llmcatelogid filter param (default t2t) to get_my_asynctasks API
This commit is contained in:
parent
90c93dbe07
commit
6bfa0cb27c
@ -1,4 +1,5 @@
|
|||||||
userid = await get_user()
|
userid = await get_user()
|
||||||
|
llmcatelogid = params_kw.get('llmcatelogid', 't2t')
|
||||||
tasks = await get_today_asynctask_list(userid)
|
tasks = await get_today_asynctask_list(userid)
|
||||||
|
|
||||||
async with get_sor_context(request._run_ns, 'llmage') as sor:
|
async with get_sor_context(request._run_ns, 'llmage') as sor:
|
||||||
@ -7,13 +8,16 @@ async with get_sor_context(request._run_ns, 'llmage') as sor:
|
|||||||
t.ioinfo = json.loads(bin.decode('utf-8'))
|
t.ioinfo = json.loads(bin.decode('utf-8'))
|
||||||
|
|
||||||
# 查询 llmcatelogid
|
# 查询 llmcatelogid
|
||||||
llmcatelogid = None
|
catid = None
|
||||||
if hasattr(t, 'llmid') and t.llmid:
|
if hasattr(t, 'llmid') and t.llmid:
|
||||||
sql = '''select m.llmcatelogid from llm_api_map m where m.llmid = ${llmid}$ limit 1'''
|
sql = '''select m.llmcatelogid from llm_api_map m where m.llmid = ${llmid}$ limit 1'''
|
||||||
recs = await sor.sqlExe(sql, {'llmid': t.llmid})
|
recs = await sor.sqlExe(sql, {'llmid': t.llmid})
|
||||||
if recs:
|
if recs:
|
||||||
llmcatelogid = recs[0].llmcatelogid
|
catid = recs[0].llmcatelogid
|
||||||
t.llmcatelogid = llmcatelogid
|
t.llmcatelogid = catid
|
||||||
|
|
||||||
|
# 按 llmcatelogid 过滤
|
||||||
|
tasks = [t for t in tasks if t.llmcatelogid == llmcatelogid]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'status': 'ok',
|
'status': 'ok',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user