Skip to content

Python: added inline yaml sample#2582

Merged
moonbox3 merged 8 commits intomicrosoft:mainfrom
eavanvalkenburg:fix_agent_name
Dec 4, 2025
Merged

Python: added inline yaml sample#2582
moonbox3 merged 8 commits intomicrosoft:mainfrom
eavanvalkenburg:fix_agent_name

Conversation

@eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Dec 2, 2025

Motivation and Context

Added a sample using a inline yaml definition to simplify explaining this, and made a fix in one other sample.
Also added description fields to Foundry clients and Assistants clients and updated _update_name method to update_name_and_description to propagate from Agent to ChatClient, when ChatClient values are not set.

Closes: #2570

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings December 2, 2025 14:16
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Dec 2, 2025
Copy link
Contributor

Copilot AI left a 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 a new Python sample demonstrating how to create an agent using an inline YAML definition string, making it easier to understand declarative agent creation without needing external YAML files. It also fixes a parameter naming issue in an existing sample.

  • Added a new inline_yaml.py sample showing inline YAML agent definition
  • Fixed the get_weather_agent.py sample by explicitly naming the chat_client parameter
  • Updated documentation to include the new sample

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
python/samples/getting_started/declarative/inline_yaml.py New sample demonstrating inline YAML agent creation with Azure AI Foundry credentials
python/samples/getting_started/declarative/get_weather_agent.py Fixed parameter naming by explicitly using chat_client= keyword argument
python/samples/getting_started/declarative/README.md Updated documentation to include the new inline YAML sample with description and usage instructions
python/uv.lock Updated dependency lock file with newer versions of fastapi and modified platform markers
python/.vscode/settings.json Added personal VS Code environment configuration settings

@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Dec 3, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azure-ai/agent_framework_azure_ai
   _chat_client.py4147980%296, 525–526, 528, 531, 534–539, 541, 549, 561–563, 567, 570–571, 579–582, 592, 600–603, 605–606, 608–609, 616, 624–625, 633–634, 639–640, 644–651, 656–657, 665, 671, 679–681, 684, 706–707, 769, 784, 796–800, 827–829, 832–833, 891–896, 917, 958, 967, 993
   _client.py1643081%174–177, 181–182, 184, 225, 227–230, 232, 369–372, 376, 378–379, 381–389, 391
packages/core/agent_framework
   _agents.py2905182%329, 390–392, 438, 492, 510, 672, 853, 856–858, 986–989, 991, 994–996, 1084, 1125, 1127, 1136–1141, 1147, 1149, 1159–1160, 1167, 1169–1170, 1178–1182, 1190–1191, 1193, 1198, 1200, 1234, 1277–1278, 1280, 1293
   observability.py61010183%238, 264–266, 268, 270–274, 282–283, 288–289, 294–299, 322–324, 326–327, 333, 417, 427, 449, 455, 474–476, 484–486, 509–511, 521–523, 656, 658, 745–749, 752–756, 765–768, 778–781, 783, 1050, 1128–1130, 1200–1202, 1360, 1368, 1372, 1376, 1382, 1384, 1386, 1394, 1404, 1432–1433, 1446–1449, 1468–1470, 1472–1475, 1477–1478, 1482, 1485, 1543, 1559, 1563, 1697, 1699
packages/core/agent_framework/azure
   _assistants_client.py350100% 
packages/core/agent_framework/openai
   _assistants_client.py2092986%179, 192, 195, 201–202, 205, 208, 211–212, 223, 248, 250, 252, 254, 256, 259, 262, 265, 269, 280, 365, 402, 438, 467–470, 521, 538
TOTAL15895241984% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2282 130 💤 0 ❌ 0 🔥 58.566s ⏱️

@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Dec 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 3, 2025
@moonbox3 moonbox3 enabled auto-merge December 4, 2025 01:24
@moonbox3 moonbox3 added this pull request to the merge queue Dec 4, 2025
Merged via the queue into microsoft:main with commit d774b64 Dec 4, 2025
24 checks passed
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
* added inline yaml sample

* fixed some typos and added intro comment

* added description params and pass through to client

* add azure assistants

* fix tests

* observabiltiy mypy fix

* for some reason mypy doesn't accept a subclass

---------

Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Declarative agent name is not correct on the AI foundry and description+instruction not reflecting on foundry

6 participants