feat(workflow): Support loading workflows from YAML configurations#6061
feat(workflow): Support loading workflows from YAML configurations#6061baptmont wants to merge 4 commits into
Conversation
- Implement `Workflow.from_config` to instantiate workflows from configurations. - Resolve nested node and sub-agent `.yaml` file references recursively during configuration loading. - Add parsing support for JoinNode, FunctionNode, and ToolNode types in config utilities.
|
Hi @baptmont , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share. |
|
Hi @DeanChensj , can you please review this. |
|
Hi, I thought loading workflows from YAML is already supported, see this sample: https://github.com/google/adk-python/tree/main/contributing/samples/workflows/loop_config What new features does this PR bring? |
|
Hi @boyangsvl, trying to run the example you linked does not work, at least using Changing the agent_class makes little progress agent_class: Workflow #original
agent_class: google.adk.workflow.Workflow #changeI get Even changing the def _resolve_agent_class(agent_class: str) -> type[BaseAgent]: #original
def _resolve_agent_class(agent_class: str) -> type[BaseNode]: #changePlease let me know if I am missing something, or if the feature is actually missing Also this PR does not use the logic defined in the example README.md, it expects a yaml file for tools, functions and joins. agent_class: ToolNode
or
agent_class: JoinNode
or
agent_class: FunctionNodeIf the feature is missing I can update this PR to follow the README.md logic of |
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
Workflows and workflow-specific node types (
JoinNode,FunctionNode,ToolNode) defined in YAML config files could not be loaded or executed because:Workflowclass and workflow-specific nodes.Solution:
Workflow.from_configmethod to instantiate declarative workflow graphs from configuration inputs.Workflow,JoinNode,FunctionNode, andToolNodein_resolve_node_class..yamlconfigurations during parsing.Testing Plan
Unit Tests:
Summary of configuration-related test execution results:
uv run pytest tests/unittests/agents/test_agent_config.py36 passedManual End-to-End (E2E) Tests:
Verified the correctness of workflow config loading by instantiating complex multi-agent graphs from declarative configurations in
test_agent_config.py.Checklist
Additional context
N/A