-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathworkflow.py
More file actions
47 lines (36 loc) · 1.35 KB
/
workflow.py
File metadata and controls
47 lines (36 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright (c) Microsoft. All rights reserved.
"""
Sample Validation Workflow using Microsoft Agent Framework.
Workflow composition for sample validation.
"""
from agent_framework import Workflow, WorkflowBuilder
from sample_validation.create_dynamic_workflow_executor import (
CreateConcurrentValidationWorkflowExecutor,
)
from sample_validation.discovery import DiscoverSamplesExecutor, ValidationConfig
from sample_validation.report import GenerateReportExecutor
from sample_validation.run_dynamic_validation_workflow_executor import (
RunDynamicValidationWorkflowExecutor,
)
def create_validation_workflow(
config: ValidationConfig,
) -> Workflow:
"""
Create the sample validation workflow.
Args:
config: Validation configuration
Returns:
Configured Workflow instance
"""
discover = DiscoverSamplesExecutor(config)
create_dynamic_workflow = CreateConcurrentValidationWorkflowExecutor(config)
run_dynamic_workflow = RunDynamicValidationWorkflowExecutor()
generate = GenerateReportExecutor()
return (
WorkflowBuilder(start_executor=discover)
.add_edge(discover, create_dynamic_workflow)
.add_edge(create_dynamic_workflow, run_dynamic_workflow)
.add_edge(run_dynamic_workflow, generate)
.build()
)
__all__ = ["ValidationConfig", "create_validation_workflow"]