feat: cockpit 会话传 pipeline_id,支持产线缺省模型
This commit is contained in:
parent
ebcb89da56
commit
f68755edf8
@ -49,7 +49,7 @@ if action == 'send_message':
|
|||||||
uid = 'user-01' # 测试兼容
|
uid = 'user-01' # 测试兼容
|
||||||
|
|
||||||
# ── 加载上下文 ──
|
# ── 加载上下文 ──
|
||||||
ctx = {'pid': '', 'name': ''}
|
ctx = {'pid': '', 'name': '', 'pipeline_id': ''}
|
||||||
async with DBPools().sqlorContext(dbname) as sor:
|
async with DBPools().sqlorContext(dbname) as sor:
|
||||||
recs = await sor.sqlExe(
|
recs = await sor.sqlExe(
|
||||||
"SELECT current_project_id FROM pipeline_agent_settings WHERE user_id=${u}$",
|
"SELECT current_project_id FROM pipeline_agent_settings WHERE user_id=${u}$",
|
||||||
@ -58,15 +58,16 @@ if action == 'send_message':
|
|||||||
ctx['pid'] = getattr(recs[0], 'current_project_id', '') or ''
|
ctx['pid'] = getattr(recs[0], 'current_project_id', '') or ''
|
||||||
if ctx['pid']:
|
if ctx['pid']:
|
||||||
proj_recs = await sor.sqlExe(
|
proj_recs = await sor.sqlExe(
|
||||||
"SELECT name FROM sd_projects WHERE id=${p}$", {"p": ctx['pid']})
|
"SELECT name, pipeline_id FROM sd_projects WHERE id=${p}$", {"p": ctx['pid']})
|
||||||
if proj_recs:
|
if proj_recs:
|
||||||
ctx['name'] = getattr(proj_recs[0], 'name', '')
|
ctx['name'] = getattr(proj_recs[0], 'name', '')
|
||||||
|
ctx['pipeline_id'] = getattr(proj_recs[0], 'pipeline_id', '') or ''
|
||||||
|
|
||||||
# ── 加载 v2 引擎 ──
|
# ── 加载 v2 引擎 ──
|
||||||
from pipeline_core.agent_config import load_agent_config
|
from pipeline_core.agent_config import load_agent_config
|
||||||
from pipeline_service.agent_loop_v2 import AgentExecutor
|
from pipeline_service.agent_loop_v2 import AgentExecutor
|
||||||
|
|
||||||
config = await load_agent_config(project_id=ctx['pid'])
|
config = await load_agent_config(pipeline_id=ctx['pipeline_id'], project_id=ctx['pid'])
|
||||||
executor = AgentExecutor(
|
executor = AgentExecutor(
|
||||||
config=config,
|
config=config,
|
||||||
project_id=ctx['pid'],
|
project_id=ctx['pid'],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user