-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: Introducing support for declarative yaml spec #2002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
67f4b8d to
f7ad21d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds declarative YAML-based agent specification support to the Microsoft Agent Framework Python implementation. The changes enable developers to define agents using YAML files that can be loaded and instantiated at runtime.
Key changes:
- New
agent-framework-declarativepackage with YAML parsing and PowerFx expression evaluation - Model classes for representing MAML (Microsoft Agent Markup Language) objects
AgentFactoryclass for creating agents from YAML specifications- Sample agents demonstrating various scenarios (OpenAI, Azure, tools, etc.)
- Updates to core framework to support additional chat options
Reviewed Changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/declarative/* | New declarative package with models, loader, and factory |
| python/samples/getting_started/declarative/* | Sample applications demonstrating declarative agent usage |
| agent-samples/*.yaml | YAML agent definitions for various providers and scenarios |
| python/packages/core/agent_framework/declarative/* | Core package integration for declarative module |
| python/packages/core/agent_framework/_agents.py | Added allow_multiple_tool_calls parameter support |
| python/packages/core/agent_framework/_clients.py | Added allow_multiple_tool_calls parameter support |
| python/pyproject.toml | Added declarative package to dependencies |
| python/uv.lock | Updated lock file with new dependencies |
python/samples/getting_started/declarative/azure_openai_responses_agent.py
Show resolved
Hide resolved
python/packages/declarative/agent_framework_declarative/_loader.py
Outdated
Show resolved
Hide resolved
python/packages/declarative/agent_framework_declarative/_models.py
Outdated
Show resolved
Hide resolved
python/packages/declarative/agent_framework_declarative/_models.py
Outdated
Show resolved
Hide resolved
python/packages/declarative/agent_framework_declarative/_models.py
Outdated
Show resolved
Hide resolved
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||
|
@eavanvalkenburg Consider creating your own feature branch for this work so the changes can be broken down into multiples PR's. I've done this on the .NET side as I'm expecting a very large number of unit tests. |
python/packages/declarative/agent_framework_declarative/_loader.py
Outdated
Show resolved
Hide resolved
python/packages/declarative/agent_framework_declarative/_loader.py
Outdated
Show resolved
Hide resolved
|
I'll get this into a feature branch once this first iteration is very close to done |
4168a71 to
784ca4f
Compare
0e6a9f4 to
13bc135
Compare
python/packages/declarative/agent_framework_declarative/_loader.py
Outdated
Show resolved
Hide resolved
python/packages/declarative/agent_framework_declarative/_loader.py
Outdated
Show resolved
Hide resolved
python/packages/declarative/agent_framework_declarative/_loader.py
Outdated
Show resolved
Hide resolved
644c9d6 to
0aee147
Compare
python/packages/declarative/agent_framework_declarative/_models.py
Outdated
Show resolved
Hide resolved
9c9d650 to
5879a8b
Compare
|
Hey all, sorry to hijack the PR, quick question: is there any plan to include the YAML declarative workflow approach (similar to what we have for C#)? Maybe not in this PR, but in the roadmap? Thanks! :) |
|
@nstijepovic yes that is the plan, and both workflows and agents should be able to be parsed in both dotnet and python from the same yaml file. |
f5a47d2 to
3b6b224
Compare
3b6b224 to
bec3f6e
Compare
* first work on declarative * initial version of the declarative support * fix tests and mypy * fix parameters of functiontool * slight logic improvement * remove path until merge * updates from comments * create dispatcher and spec type, json_schema method * fix mypy, skipping model * updated lock * fixed declarative tests and renamed some other test files * refined loader * updated lock * fix mypy * added readme to samples folder * fixes from review * undid test file rename
Motivation and Context
Closes #1471 for python
Todo:
Description
Contribution Checklist