Skip to content

Commit 9fab5b5

Browse files
alliscodeCopilotekzhu
authored
Python: Adding support for nested workflows (microsoft#460)
* Adding design documents and data flow descriptions for sub-workflows * Updating docs. * Sub-workflow implementation microsoft#1. Stuck because of singleton RequestInfoExecutor, going to make a change to remove that restrivtion. * Removed the singleton restriction on RequestInfoExecutor so enable sub-workflows. * Scenarios seem to be working. * Sample improved. * going to have intern add generic response wrappers. * Wrapped responses working. * Non-hardcoded routing is working. * Sample showing external approved and not approved. * Cleaning up. * Updating some samples and user guide. * Removing old design doc. * Cleaning up. * Adding python-package-setup.md back. * Update python/packages/workflow/agent_framework_workflow/_executor.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update python/packages/workflow/agent_framework_workflow/_validation.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Removing prints. * Fixing lint and type issues. * Fixing lint and type issues. * Update python/packages/workflow/agent_framework_workflow/_executor.py Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> * Adding type hints to intercepts decorator. * Removing unused files. * Fixing issue with sample 5 groupchat with hil. * Removing redundent samples. * Updates to ensure no conflicting request interceptors and to support a subflow with multiple requests in a single super step. * Fixing pypi errors. * clean up samples * update samples to make it more clear * warning for unhandled request info from sub workflow * add logger info --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
1 parent 119d7a5 commit 9fab5b5

16 files changed

Lines changed: 2335 additions & 39 deletions

‎docs/design/python-package-setup.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,4 @@ We should consider auto-instrumentation and provide an implementation of it to t
319319
### Build and release
320320
The build step will be done in GHA, adding the package to the release and then we call into Azure DevOps to use the ESRP pipeline to publish to pypi. This is how SK already works, we will just have to adapt it to the new package structure.
321321

322-
For now we will stick to semantic versioning, and all preview release will be tagged as such.
322+
For now we will stick to semantic versioning, and all preview release will be tagged as such.

‎python/packages/main/agent_framework/workflow/__init__.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
"WorkflowCheckpoint",
3636
"Case",
3737
"Default",
38+
"RequestResponse",
39+
"SubWorkflowRequestInfo",
40+
"SubWorkflowResponse",
41+
"WorkflowExecutor",
42+
"intercepts_request",
3843
]
3944

4045

‎python/packages/main/agent_framework/workflow/__init__.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,22 @@ from agent_framework_workflow import (
1818
RequestInfoEvent,
1919
RequestInfoExecutor,
2020
RequestInfoMessage,
21+
RequestResponse,
22+
SubWorkflowRequestInfo,
23+
SubWorkflowResponse,
2124
Workflow,
2225
WorkflowBuilder,
2326
WorkflowCheckpoint,
2427
WorkflowCompletedEvent,
2528
WorkflowContext,
2629
WorkflowEvent,
30+
WorkflowExecutor,
2731
WorkflowRunResult,
2832
WorkflowStartedEvent,
2933
WorkflowViz,
3034
__version__,
3135
handler,
36+
intercepts_request,
3237
)
3338

3439
__all__ = [
@@ -49,15 +54,20 @@ __all__ = [
4954
"RequestInfoEvent",
5055
"RequestInfoExecutor",
5156
"RequestInfoMessage",
57+
"RequestResponse",
58+
"SubWorkflowRequestInfo",
59+
"SubWorkflowResponse",
5260
"Workflow",
5361
"WorkflowBuilder",
5462
"WorkflowCheckpoint",
5563
"WorkflowCompletedEvent",
5664
"WorkflowContext",
5765
"WorkflowEvent",
66+
"WorkflowExecutor",
5867
"WorkflowRunResult",
5968
"WorkflowStartedEvent",
6069
"WorkflowViz",
6170
"__version__",
6271
"handler",
72+
"intercepts_request",
6373
]

‎python/packages/workflow/agent_framework_workflow/__init__.py‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@
3030
Executor,
3131
RequestInfoExecutor,
3232
RequestInfoMessage,
33+
RequestResponse,
34+
SubWorkflowRequestInfo,
35+
SubWorkflowResponse,
36+
WorkflowExecutor,
3337
handler,
38+
intercepts_request,
3439
)
3540
from ._runner_context import (
3641
InProcRunnerContext,
@@ -76,11 +81,12 @@
7681
"InProcRunnerContext",
7782
"Message",
7883
"RequestInfoEvent",
79-
"RequestInfoEvent",
80-
"RequestInfoExecutor",
8184
"RequestInfoExecutor",
8285
"RequestInfoMessage",
86+
"RequestResponse",
8387
"RunnerContext",
88+
"SubWorkflowRequestInfo",
89+
"SubWorkflowResponse",
8490
"TypeCompatibilityError",
8591
"ValidationTypeEnum",
8692
"Workflow",
@@ -89,11 +95,13 @@
8995
"WorkflowCompletedEvent",
9096
"WorkflowContext",
9197
"WorkflowEvent",
98+
"WorkflowExecutor",
9299
"WorkflowRunResult",
93100
"WorkflowStartedEvent",
94101
"WorkflowValidationError",
95102
"WorkflowViz",
96103
"__version__",
97104
"handler",
105+
"intercepts_request",
98106
"validate_workflow_graph",
99107
]

0 commit comments

Comments
 (0)