fix: llm_create.dspy 补充 ownerid 自动注入(logined_userorgid 对自定义端点不生效)

This commit is contained in:
yumoqing 2026-07-14 18:22:11 +08:00
parent 3a2da1e636
commit 6ab53eca2b

View File

@ -3,6 +3,7 @@
result = {"widgettype":"Error","options":{"title":"操作失败","message":"Invalid request","cwidth":16,"cheight":9,"timeout":3}} result = {"widgettype":"Error","options":{"title":"操作失败","message":"Invalid request","cwidth":16,"cheight":9,"timeout":3}}
try: try:
env = request._run_ns
dbname = get_module_dbname('llmage') dbname = get_module_dbname('llmage')
async with DBPools().sqlorContext(dbname) as sor: async with DBPools().sqlorContext(dbname) as sor:
data = params_kw.copy() data = params_kw.copy()
@ -10,6 +11,7 @@ try:
data.pop('rows', None) data.pop('rows', None)
data.pop('data_filter', None) data.pop('data_filter', None)
data['id'] = getID() data['id'] = getID()
data['ownerid'] = data.get('ownerid') or await env.get_userorgid()
await sor.C('llm', data) await sor.C('llm', data)
result = {"widgettype":"Message","options":{"title":"创建成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}} result = {"widgettype":"Message","options":{"title":"创建成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}}
except Exception as e: except Exception as e: