feat(workflow): support single-node execution and MCP Streamable HTTP protocol

- Add `run_single_node` method in workflow service for isolated node execution
- Refactor MCP client to support Streamable HTTP protocol (2025-03-26) with session ID handling, SSE/JSON response parsing, and proper initialized notification
- Update iteration node to conditionally initialize stream writer based on stream flag
- Improve cycle graph node invocation with checkpoint config passing
This commit is contained in:
Timebomb2018
2026-05-07 17:18:21 +08:00
parent 595c3517e3
commit 8d3da2fd0e
7 changed files with 302 additions and 28 deletions

View File

@@ -703,6 +703,24 @@ class ModelCompareItem(BaseModel):
)
class NodeRunRequest(BaseModel):
"""单节点试运行请求"""
# 扁平格式,支持:
# 节点变量: {"node_id.var_name": value}
# 系统变量: {"sys.message": "hello", "sys.files": [...]}
inputs: Dict[str, Any] = Field(
default_factory=dict,
description="节点输入变量,格式: {'node_id.var_name': value} 或 {'sys.message': 'hello'}",
examples=[{
"sys.message": "帮我写一首诗",
"sys.user_id": "user-123",
"sys.files": [],
"llm_node_abc.output": "上游输出内容",
}]
)
stream: bool = Field(default=False, description="是否流式返回")
class DraftRunCompareRequest(BaseModel):
"""多模型对比试运行请求"""
message: str = Field(..., description="用户消息")