INNER CODE UNIT · Python
find_start_node
lishuangqiang/AI-Meeting · skills/xunzhi-interview-domain/scripts/extract_workflow_contracts.py:19
def find_start_node(nodes: list[dict[str, Any]]) -> dict[str, Any] | None:
for node in nodes:
if str(node.get("type", "")).startswith("开始"):
return node
return nodes[0] if nodes else None
def format_types(output_item: dict[str, Any]) -> str:
schema = output_item.get("schema") or {}
data_type = schema.get("type") or "unknown"
file_type = output_item.get("fileType") or output_item.get("customParameterType")
allowed = output_item.get("allowedFileType") or []
parts = [str(data_type)]
if file_type:
parts.append(str(file_type))
if allowed:
parts.append("允许:" + ",".join(map(str, allowed)))
return " / ".join(parts)