Python: updated declarative samples and handling of non-pydantic response formats (#5022)

* updated declarative samples and handling of non-pydantic response formats

* fixed from comments

* update docstring
This commit is contained in:
Eduard van Valkenburg
2026-04-01 21:16:00 +02:00
committed by GitHub
Unverified
parent 6acab3d1d6
commit 519bb0cb2b
21 changed files with 370 additions and 90 deletions
@@ -9,6 +9,20 @@ from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
"""
This sample demonstrates creating an agent from a declarative YAML file specification.
It uses a MCP server to connect to the Microsoft Learn content and a FoundryChatClient.
The yaml also has some chat options set, such as temperature and topP.
These options do not work with newer OpenAI models, so ensure to use a compatible model such as gpt-4o-mini.
Environment variables:
- FOUNDRY_PROJECT_ENDPOINT: The endpoint URL for the Foundry project.
- FOUNDRY_MODEL: The model ID to use for the agent, make sure it is compatible with the chat options specified in
the yaml, or remove the options.
"""
async def main():
"""Create an agent from a declarative yaml specification and run it."""