Construct a WorkflowDefinition with explicit edge declarations.
(
*,
context: WorkflowContext,
prompts: PromptBundle,
tool_specs: list[ToolSpec],
metadata: dict[str, Any] | None = None,
)
| 61 | |
| 62 | |
| 63 | def build_workflow_definition( |
| 64 | *, |
| 65 | context: WorkflowContext, |
| 66 | prompts: PromptBundle, |
| 67 | tool_specs: list[ToolSpec], |
| 68 | metadata: dict[str, Any] | None = None, |
| 69 | ) -> WorkflowDefinition: |
| 70 | """Construct a WorkflowDefinition with explicit edge declarations.""" |
| 71 | return WorkflowDefinition( |
| 72 | context=context, |
| 73 | prompts=prompts, |
| 74 | tool_specs=tool_specs, |
| 75 | edges={ |
| 76 | "START": ["Scan"], |
| 77 | "Scan": ["Vuln_select"], |
| 78 | "Vuln_select": ["Inquire"], |
| 79 | "Inquire": ["Exploit"], |
| 80 | "Exploit": ["Check"], |
| 81 | "Check": ["Exploit", "Vuln_select", "__end__"], |
| 82 | }, |
| 83 | metadata=metadata or {}, |
| 84 | ) |
no test coverage detected