fix: llm_create.dspy 补充 ownerid 自动注入(logined_userorgid 对自定义端点不生效)
This commit is contained in:
parent
3a2da1e636
commit
6ab53eca2b
@ -3,6 +3,7 @@
|
||||
result = {"widgettype":"Error","options":{"title":"操作失败","message":"Invalid request","cwidth":16,"cheight":9,"timeout":3}}
|
||||
|
||||
try:
|
||||
env = request._run_ns
|
||||
dbname = get_module_dbname('llmage')
|
||||
async with DBPools().sqlorContext(dbname) as sor:
|
||||
data = params_kw.copy()
|
||||
@ -10,6 +11,7 @@ try:
|
||||
data.pop('rows', None)
|
||||
data.pop('data_filter', None)
|
||||
data['id'] = getID()
|
||||
data['ownerid'] = data.get('ownerid') or await env.get_userorgid()
|
||||
await sor.C('llm', data)
|
||||
result = {"widgettype":"Message","options":{"title":"创建成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}}
|
||||
except Exception as e:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user