From 10058d82457c6ac51896474676366c7750e913b1 Mon Sep 17 00:00:00 2001 From: Amit Dhawan Date: Tue, 23 Jun 2026 18:51:39 +0530 Subject: [PATCH 1/2] Python: Add load_dotenv to get-started samples and fix chat_response_cancellation docs --- .../01-get-started/05_functional_workflow_with_agents.py | 3 +++ .../02-agents/chat_client/chat_response_cancellation.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python/samples/01-get-started/05_functional_workflow_with_agents.py b/python/samples/01-get-started/05_functional_workflow_with_agents.py index 7ffb0165c4..95a7e1babe 100644 --- a/python/samples/01-get-started/05_functional_workflow_with_agents.py +++ b/python/samples/01-get-started/05_functional_workflow_with_agents.py @@ -12,6 +12,9 @@ from agent_framework import Agent, workflow from agent_framework.foundry import FoundryChatClient from azure.identity import AzureCliCredential +from dotenv import load_dotenv + +load_dotenv() # client = FoundryChatClient(credential=AzureCliCredential()) diff --git a/python/samples/02-agents/chat_client/chat_response_cancellation.py b/python/samples/02-agents/chat_client/chat_response_cancellation.py index 2a4e17432b..76859831d4 100644 --- a/python/samples/02-agents/chat_client/chat_response_cancellation.py +++ b/python/samples/02-agents/chat_client/chat_response_cancellation.py @@ -24,8 +24,9 @@ async def main() -> None: Creates a task for the chat request, waits briefly, then cancels it to show proper cleanup. Configuration: - - OpenAI model ID: Use "model" parameter or "OPENAI_MODEL" environment variable - - OpenAI API key: Use "api_key" parameter or "OPENAI_API_KEY" environment variable + - FOUNDRY_PROJECT_ENDPOINT: Azure AI Foundry project endpoint URL + - FOUNDRY_MODEL: Model deployment name (e.g. gpt-4o) + - Authentication: Run `az login` to authenticate via AzureCliCredential """ client = FoundryChatClient(credential=AzureCliCredential()) From 1898acad3a3f6f31262fb9716aab70ef27e4f1b0 Mon Sep 17 00:00:00 2001 From: Amit Dhawan Date: Tue, 23 Jun 2026 22:04:03 +0530 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../samples/01-get-started/05_functional_workflow_with_agents.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/samples/01-get-started/05_functional_workflow_with_agents.py b/python/samples/01-get-started/05_functional_workflow_with_agents.py index 95a7e1babe..9aff97826d 100644 --- a/python/samples/01-get-started/05_functional_workflow_with_agents.py +++ b/python/samples/01-get-started/05_functional_workflow_with_agents.py @@ -14,6 +14,7 @@ from azure.identity import AzureCliCredential from dotenv import load_dotenv +# Load environment variables from .env file (e.g., FOUNDRY_PROJECT_ENDPOINT, FOUNDRY_MODEL) load_dotenv() #