Python: Add FunctionExecutor and @executor decorator (#589)

* Add FunctionExecutor and @executor decorator

* refactor

* add single argument function

* fix test

* update example code

* add support for sync funciton
This commit is contained in:
Eric Zhu
2025-09-02 18:56:53 -07:00
committed by GitHub
Unverified
parent 3286e8c8b1
commit ed8461aa7d
7 changed files with 823 additions and 8 deletions
@@ -7,6 +7,8 @@ PACKAGE_NAME = "agent_framework_workflow"
PACKAGE_EXTRA = "workflow"
_IMPORTS = [
"Executor",
"FunctionExecutor",
"executor",
"WorkflowContext",
"__version__",
"events",
@@ -14,6 +14,7 @@ from agent_framework_workflow import (
ExecutorEvent,
ExecutorInvokeEvent,
FileCheckpointStorage,
FunctionExecutor,
InMemoryCheckpointStorage,
MagenticBuilder,
MagenticCallbackEvent,
@@ -42,6 +43,7 @@ from agent_framework_workflow import (
WorkflowStartedEvent,
WorkflowViz,
__version__,
executor,
handler,
intercepts_request,
)
@@ -60,6 +62,7 @@ __all__ = [
"ExecutorEvent",
"ExecutorInvokeEvent",
"FileCheckpointStorage",
"FunctionExecutor",
"InMemoryCheckpointStorage",
"MagenticBuilder",
"MagenticCallbackEvent",
@@ -88,6 +91,7 @@ __all__ = [
"WorkflowStartedEvent",
"WorkflowViz",
"__version__",
"executor",
"handler",
"intercepts_request",
]