Merge pull request #992 from wanxunyang/develop-wxy
fix(workflow): rectify error handling and bolster execution logging
This commit is contained in:
@@ -73,6 +73,7 @@ class CustomTool(BaseTool):
|
||||
# 添加通用参数(基于第一个操作的参数)
|
||||
if self._parsed_operations:
|
||||
first_operation = next(iter(self._parsed_operations.values()))
|
||||
# path/query 参数
|
||||
for param_name, param_info in first_operation.get("parameters", {}).items():
|
||||
params.append(ToolParameter(
|
||||
name=param_name,
|
||||
@@ -85,6 +86,23 @@ class CustomTool(BaseTool):
|
||||
maximum=param_info.get("maximum"),
|
||||
pattern=param_info.get("pattern")
|
||||
))
|
||||
# requestBody 参数 — 将 body 字段平铺为独立参数暴露给模型
|
||||
request_body = first_operation.get("request_body")
|
||||
if request_body:
|
||||
body_schema = request_body.get("properties", {})
|
||||
required_fields = request_body.get("required", [])
|
||||
for prop_name, prop_schema in body_schema.items():
|
||||
params.append(ToolParameter(
|
||||
name=prop_name,
|
||||
type=self._convert_openapi_type(prop_schema.get("type", "string")),
|
||||
description=prop_schema.get("description", ""),
|
||||
required=prop_name in required_fields,
|
||||
default=prop_schema.get("default"),
|
||||
enum=prop_schema.get("enum"),
|
||||
minimum=prop_schema.get("minimum"),
|
||||
maximum=prop_schema.get("maximum"),
|
||||
pattern=prop_schema.get("pattern")
|
||||
))
|
||||
|
||||
return params
|
||||
|
||||
|
||||
@@ -180,6 +180,9 @@ class IterationRuntime:
|
||||
"cycle_id": self.node_id,
|
||||
"cycle_idx": idx,
|
||||
"node_id": node_name,
|
||||
"node_type": node_type,
|
||||
"node_name": node_cfg.get("data", {}).get("label") if node_cfg else node_name,
|
||||
"status": result.get("node_outputs", {}).get(node_name, {}).get("status", "completed"),
|
||||
"input": result.get("node_outputs", {}).get(node_name, {}).get("input")
|
||||
if not cycle_variable else cycle_variable,
|
||||
"output": result.get("node_outputs", {}).get(node_name, {}).get("output")
|
||||
|
||||
@@ -210,6 +210,9 @@ class LoopRuntime:
|
||||
"cycle_id": self.node_id,
|
||||
"cycle_idx": idx,
|
||||
"node_id": node_name,
|
||||
"node_type": node_type,
|
||||
"node_name": node_name,
|
||||
"status": result.get("node_outputs", {}).get(node_name, {}).get("status", "completed"),
|
||||
"input": result.get("node_outputs", {}).get(node_name, {}).get("input")
|
||||
if not cycle_variable else cycle_variable,
|
||||
"output": result.get("node_outputs", {}).get(node_name, {}).get("output")
|
||||
|
||||
Reference in New Issue
Block a user