feat: add workflow action outcomes and tracing

This commit is contained in:
Xin Wang
2026-08-01 11:21:31 +08:00
parent ad5ff061bb
commit b747144ff1
13 changed files with 558 additions and 32 deletions

View File

@@ -208,8 +208,9 @@ async def run_pipeline(
只要有 .input() / .output() / event_handler 即可。
cfg: 助手配置(随请求内联传入)。
"""
if cfg.type == "workflow":
vision_enabled = WorkflowEngine(cfg.graph).uses_vision()
workflow_engine = WorkflowEngine(cfg.graph) if cfg.type == "workflow" else None
if workflow_engine:
vision_enabled = workflow_engine.uses_vision()
logger.info(
f"启动管线: assistant={cfg.name} type={cfg.type} "
@@ -578,6 +579,7 @@ async def run_pipeline(
channel=channel,
runtime_mode=cfg.runtimeMode,
session_id=cfg.conversation_id or None,
extra=(workflow_engine.session_metadata() if workflow_engine else None),
)
pipeline = Pipeline(
[
@@ -664,6 +666,7 @@ async def run_pipeline(
set_system_prompt=set_system_prompt,
set_tools=set_visible_tools,
call_end=call_end,
session_id=recorder.session_id if recorder else "",
client_tools=client_tools,
worker=worker,
context_aggregator=WorkflowAggregatorPair(