From 1950057631902de27d2500c9a6d821057e0916ff Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Sat, 6 Dec 2025 17:33:58 +0300 Subject: [PATCH 01/16] Add AI Agent sample console app --- examples/Python/ai-agent-sample-app/app.py | 35 ++++++++++++++++++ .../ai-agent-sample-app/requirements.txt | Bin 0 -> 196 bytes 2 files changed, 35 insertions(+) create mode 100644 examples/Python/ai-agent-sample-app/app.py create mode 100644 examples/Python/ai-agent-sample-app/requirements.txt diff --git a/examples/Python/ai-agent-sample-app/app.py b/examples/Python/ai-agent-sample-app/app.py new file mode 100644 index 00000000..6fd0943e --- /dev/null +++ b/examples/Python/ai-agent-sample-app/app.py @@ -0,0 +1,35 @@ +import asyncio +import os +from agent_framework.declarative import AgentFactory +from azure.identity.aio import AzureCliCredential +from azure.identity import DefaultAzureCredential +from azure.appconfiguration.provider import load + +async def main(): + endpoint = os.environ["APP_CONFIGURATION_ENDPOINT"] + credential = DefaultAzureCredential() + + config = load(endpoint=endpoint, credential=credential) + + yaml_str = config["Agent:Spec"] + + async with ( + AzureCliCredential() as credential, + AgentFactory(client_kwargs={"async_credential": credential, "project_endpoint": config["Agent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) as agent, + ): + while True: + print("How can I help? (type 'quit' to exit)") + + user_input = input("User: ") + + if user_input.lower() in ['quit', 'exit', 'bye']: + break + + response = await agent.run(user_input) + print("Agent response: ", response.text) + input("Press enter to continue...") + + print("Exiting... Goodbye...") + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file diff --git a/examples/Python/ai-agent-sample-app/requirements.txt b/examples/Python/ai-agent-sample-app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..7239c35479ab2d88196d765b930925430e2ca833 GIT binary patch literal 196 zcmb7;OA3H65JTTu@F+c0(JDo(rT9S)ucmdUD;EQqN0OQAwDdRvGlq_YWz@bgNe^O{ sgGJgE?Ww6=ED~wt56XMBWw%wIFYK@1s4XeED&OjA`doZ?{@81FZk Date: Sat, 6 Dec 2025 18:07:43 +0300 Subject: [PATCH 02/16] Add README.md --- examples/Python/ai-agent-sample-app/README.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 examples/Python/ai-agent-sample-app/README.md diff --git a/examples/Python/ai-agent-sample-app/README.md b/examples/Python/ai-agent-sample-app/README.md new file mode 100644 index 00000000..33a3239f --- /dev/null +++ b/examples/Python/ai-agent-sample-app/README.md @@ -0,0 +1,59 @@ +# Azure App Configuration - AI Agent chat application + +This sample demonstrates using Azure App Configuration to load agent YAML specifications that define AI agent behavior, prompts, and model configurations for a chat application. + +## Features + +- Integrates with Azure AI Agent Framework to create a conversational AI agent +- Loads agent YAML specifications from Azure App Configuration. + +## Prerequisites + +- Python 3.8 or later +- An Azure subscription with access to: + - Azure App Configuration service + - Microsoft Foundry project +- Required environment variables: + - `AZURE_APPCONFIGURATION_ENDPOINT`: Endpoint URL of your Azure App Configuration instance + +## Setup + +1. Clone the repository +1. Install the required packages: + + ```bash + pip install -r requirements.txt + ``` + +1. Configure your Azure App Configuration store with the agent YAML specification: + + ```yaml + kind: Prompt + name: WeatherAgent + description: Weather Agent + instructions: You are a helpful assistant. + model: + id: gpt-4.1 + connection: + kind: remote + ``` + +1. Configure your Azure App Configuration store with project endpoint: + + ```console + Agent:ProjectEndpoint - Your Foundry project endpoint + ``` + +1. Set the required environment variables: + + ```bash + export AZURE_APPCONFIGURATION_ENDPOINT="https://your-appconfig.azconfig.io" + ``` + +## Running the Application + +Start the console application: + +```bash +python app.py +``` \ No newline at end of file From 164d85f09359757e4ccfa38d3ad79ecd5354bdde Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Wed, 10 Dec 2025 14:25:15 +0300 Subject: [PATCH 03/16] Address PR comments --- .../README.md | 33 +++++++++--------- .../app.py | 12 +++---- .../requirements.txt | Bin 3 files changed, 22 insertions(+), 23 deletions(-) rename examples/Python/{ai-agent-sample-app => WeatherAgent}/README.md (67%) rename examples/Python/{ai-agent-sample-app => WeatherAgent}/app.py (69%) rename examples/Python/{ai-agent-sample-app => WeatherAgent}/requirements.txt (100%) diff --git a/examples/Python/ai-agent-sample-app/README.md b/examples/Python/WeatherAgent/README.md similarity index 67% rename from examples/Python/ai-agent-sample-app/README.md rename to examples/Python/WeatherAgent/README.md index 33a3239f..255124ab 100644 --- a/examples/Python/ai-agent-sample-app/README.md +++ b/examples/Python/WeatherAgent/README.md @@ -25,32 +25,31 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif pip install -r requirements.txt ``` -1. Configure your Azure App Configuration store with the agent YAML specification: +1. Configure your Azure App Configuration store with the following key-value pairs: + | Key | Value | + |-----|-------| + | _WeatherAgent:Spec_ | See YAML below | + | _WeatherAgent:ProjectEndpoint_ | Your Foundry project endpoint | + + **YAML specification for _WeatherAgent:Spec_:** ```yaml - kind: Prompt - name: WeatherAgent - description: Weather Agent - instructions: You are a helpful assistant. - model: - id: gpt-4.1 - connection: - kind: remote + kind: Prompt + name: WeatherAgent + description: Weather Agent + instructions: You are a helpful assistant. + model: + id: gpt-4.1 + connection: + kind: remote ``` - -1. Configure your Azure App Configuration store with project endpoint: - - ```console - Agent:ProjectEndpoint - Your Foundry project endpoint - ``` - 1. Set the required environment variables: ```bash export AZURE_APPCONFIGURATION_ENDPOINT="https://your-appconfig.azconfig.io" ``` -## Running the Application +## Run the Application Start the console application: diff --git a/examples/Python/ai-agent-sample-app/app.py b/examples/Python/WeatherAgent/app.py similarity index 69% rename from examples/Python/ai-agent-sample-app/app.py rename to examples/Python/WeatherAgent/app.py index 6fd0943e..fbc78113 100644 --- a/examples/Python/ai-agent-sample-app/app.py +++ b/examples/Python/WeatherAgent/app.py @@ -1,21 +1,21 @@ import asyncio import os from agent_framework.declarative import AgentFactory -from azure.identity.aio import AzureCliCredential +from azure.identity.aio import DefaultAzureCredential as AsyncDefaultCredential from azure.identity import DefaultAzureCredential from azure.appconfiguration.provider import load async def main(): - endpoint = os.environ["APP_CONFIGURATION_ENDPOINT"] + endpoint = os.environ["AZURE_APPCONFIGURATION_ENDPOINT"] credential = DefaultAzureCredential() config = load(endpoint=endpoint, credential=credential) - yaml_str = config["Agent:Spec"] + yaml_str = config["WeatherAgent:Spec"] async with ( - AzureCliCredential() as credential, - AgentFactory(client_kwargs={"async_credential": credential, "project_endpoint": config["Agent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) as agent, + AsyncDefaultCredential() as credential, + AgentFactory(client_kwargs={"async_credential": credential, "project_endpoint": config["WeatherAgent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) as agent, ): while True: print("How can I help? (type 'quit' to exit)") @@ -32,4 +32,4 @@ async def main(): print("Exiting... Goodbye...") if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main()) diff --git a/examples/Python/ai-agent-sample-app/requirements.txt b/examples/Python/WeatherAgent/requirements.txt similarity index 100% rename from examples/Python/ai-agent-sample-app/requirements.txt rename to examples/Python/WeatherAgent/requirements.txt From 72f74421ad69f5c0d63db95c4f791c921e1a8388 Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Wed, 10 Dec 2025 18:28:58 +0300 Subject: [PATCH 04/16] Improve ReadMe --- examples/Python/WeatherAgent/README.md | 45 ++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/examples/Python/WeatherAgent/README.md b/examples/Python/WeatherAgent/README.md index 255124ab..13efe28a 100644 --- a/examples/Python/WeatherAgent/README.md +++ b/examples/Python/WeatherAgent/README.md @@ -18,7 +18,26 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif ## Setup -1. Clone the repository +1. Clone the repository and navigate to the `examples\Python\WeatherAgent` directory: + ```bash + git clone https://github.com/Azure/AppConfiguration.git + cd examples\Python\WeatherAgent + ``` + +1. Next, create a new Python virtual environment where you can safely install the packages: + + On macOS or Linux run the following command: + ```bash + python -m venv .venv + source .venv/bin/activate + ``` + + On Windows run: + ```bash + python -m venv .venv + .venv\scripts\activate + ``` + 1. Install the required packages: ```bash @@ -29,8 +48,8 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif | Key | Value | |-----|-------| - | _WeatherAgent:Spec_ | See YAML below | - | _WeatherAgent:ProjectEndpoint_ | Your Foundry project endpoint | + | WeatherAgent:Spec | _See YAML below_ | + | WeatherAgent:ProjectEndpoint | _Your Foundry project endpoint_ | **YAML specification for _WeatherAgent:Spec_:** ```yaml @@ -39,14 +58,26 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif description: Weather Agent instructions: You are a helpful assistant. model: - id: gpt-4.1 - connection: - kind: remote + id: gpt-4.1 + connection: + kind: remote ``` 1. Set the required environment variables: + If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect: + + ```cmd + setx AZURE_APPCONFIGURATION_ENDPOINT "" + ``` + + If you use PowerShell, run the following command: + ```powershell + $Env:AZURE_APPCONFIGURATION_ENDPOINT="" + ``` + + If you use macOS or Linux run the following command: ```bash - export AZURE_APPCONFIGURATION_ENDPOINT="https://your-appconfig.azconfig.io" + export AZURE_APPCONFIGURATION_ENDPOINT='' ``` ## Run the Application From f8d8936fc87889f7f646cb83fe708fc7ac6096bd Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Thu, 11 Dec 2025 16:48:39 +0300 Subject: [PATCH 05/16] Address PR comments --- examples/Python/ChatAgent/README.md | 103 ++++++++++++++++++ .../Python/{WeatherAgent => ChatAgent}/app.py | 4 +- examples/Python/ChatAgent/requirements.txt | 4 + examples/Python/WeatherAgent/README.md | 89 --------------- examples/Python/WeatherAgent/requirements.txt | Bin 196 -> 0 bytes 5 files changed, 109 insertions(+), 91 deletions(-) create mode 100644 examples/Python/ChatAgent/README.md rename examples/Python/{WeatherAgent => ChatAgent}/app.py (87%) create mode 100644 examples/Python/ChatAgent/requirements.txt delete mode 100644 examples/Python/WeatherAgent/README.md delete mode 100644 examples/Python/WeatherAgent/requirements.txt diff --git a/examples/Python/ChatAgent/README.md b/examples/Python/ChatAgent/README.md new file mode 100644 index 00000000..bc1bea4e --- /dev/null +++ b/examples/Python/ChatAgent/README.md @@ -0,0 +1,103 @@ +# Azure App Configuration - AI Agent chat application + +This sample demonstrates using Azure App Configuration to load agent YAML specifications that define AI agent behavior, prompts, and model configurations for a chat application. + +## Features + +- Integrates with Azure AI Agent Framework to create a conversational AI agent +- Loads agent YAML specifications from Azure App Configuration. + +## Prerequisites + +- Python 3.8 or later +- An Azure subscription with access to: + - Azure App Configuration service + - Microsoft Foundry project + +## Setup + +1. Clone the repository and navigate to the `examples\Python\ChatAgent` directory: + ```bash + git clone https://github.com/Azure/AppConfiguration.git + cd examples\Python\ChatAgent + ``` + +1. Next, create a new Python virtual environment where you can safely install the packages: + + On macOS or Linux run the following command: + ```bash + python -m venv .venv + source .venv/bin/activate + ``` + + On Windows run: + ```bash + python -m venv .venv + .venv\scripts\activate + ``` + +1. Install the required packages: + + ```bash + pip install -r requirements.txt + ``` + +1. Add the following key-values to your Azure App Configuration store. + + | Key | Value | + |-----|-------| + | ChatAgent:Spec | _See YAML below_ | + | CharAgent:ProjectEndpoint | _Your Foundry project endpoint_ | + + **YAML specification for _ChatAgent:Spec_:** + ```yaml + kind: Prompt + name: ChatAgent + description: Agent example with web search + instructions: You are a helpful assistant with access to web search. + model: + id: gpt-4.1 + connection: + kind: remote + tools: + - kind: web_search + name: WebSearchTool + description: Search the web for live information. + ``` + +1. Set the required environment variables: + + If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect: + + ```cmd + setx AZURE_APPCONFIGURATION_ENDPOINT "" + ``` + + If you use PowerShell, run the following command: + ```powershell + $Env:AZURE_APPCONFIGURATION_ENDPOINT="" + ``` + + If you use macOS or Linux run the following command: + ```bash + export AZURE_APPCONFIGURATION_ENDPOINT='' + ``` + +## Run the Application + +1. Start the console application: + + ```bash + python app.py + ``` + +2. Type the message "What is the weather in Seattle today?" when prompted with "How can I help?" and then press the Enter key + + ```output + How can I help? (type 'quit' to exit) + User: What is the weather today in Seattle ? + Agent response: Today in Seattle, expect steady rain throughout the day with patchy fog, and a high temperature around 57°F (14°C). + Winds are from the south-southwest at 14 to 17 mph, with gusts as high as 29 mph. Flood and wind advisories are in effect due to ongoing heavy rain and saturated conditions. Rain is likely to continue into the night, with a low near 49°F. Please stay aware of weather alerts if you are traveling or in low-lying areas [National Weather Service Seattle](https://forecast.weather.gov/zipcity.php?inputstring=Seattle%2CWA) [The Weather Channel Seattle Forecast](https://weather.com/weather/today/l/Seattle+Washington?canonicalCityId=1138ce33fd1be51ab7db675c0da0a27c). + Press enter to continue... + ``` + diff --git a/examples/Python/WeatherAgent/app.py b/examples/Python/ChatAgent/app.py similarity index 87% rename from examples/Python/WeatherAgent/app.py rename to examples/Python/ChatAgent/app.py index fbc78113..11bb67c4 100644 --- a/examples/Python/WeatherAgent/app.py +++ b/examples/Python/ChatAgent/app.py @@ -11,11 +11,11 @@ async def main(): config = load(endpoint=endpoint, credential=credential) - yaml_str = config["WeatherAgent:Spec"] + yaml_str = config["ChatAgent:Spec"] async with ( AsyncDefaultCredential() as credential, - AgentFactory(client_kwargs={"async_credential": credential, "project_endpoint": config["WeatherAgent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) as agent, + AgentFactory(client_kwargs={"async_credential": credential, "project_endpoint": config["ChatAgent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) as agent, ): while True: print("How can I help? (type 'quit' to exit)") diff --git a/examples/Python/ChatAgent/requirements.txt b/examples/Python/ChatAgent/requirements.txt new file mode 100644 index 00000000..39e739fe --- /dev/null +++ b/examples/Python/ChatAgent/requirements.txt @@ -0,0 +1,4 @@ +agent-framework-azure-ai +azure-appconfiguration +azure-appconfiguration-provider +azure-identity \ No newline at end of file diff --git a/examples/Python/WeatherAgent/README.md b/examples/Python/WeatherAgent/README.md deleted file mode 100644 index 13efe28a..00000000 --- a/examples/Python/WeatherAgent/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# Azure App Configuration - AI Agent chat application - -This sample demonstrates using Azure App Configuration to load agent YAML specifications that define AI agent behavior, prompts, and model configurations for a chat application. - -## Features - -- Integrates with Azure AI Agent Framework to create a conversational AI agent -- Loads agent YAML specifications from Azure App Configuration. - -## Prerequisites - -- Python 3.8 or later -- An Azure subscription with access to: - - Azure App Configuration service - - Microsoft Foundry project -- Required environment variables: - - `AZURE_APPCONFIGURATION_ENDPOINT`: Endpoint URL of your Azure App Configuration instance - -## Setup - -1. Clone the repository and navigate to the `examples\Python\WeatherAgent` directory: - ```bash - git clone https://github.com/Azure/AppConfiguration.git - cd examples\Python\WeatherAgent - ``` - -1. Next, create a new Python virtual environment where you can safely install the packages: - - On macOS or Linux run the following command: - ```bash - python -m venv .venv - source .venv/bin/activate - ``` - - On Windows run: - ```bash - python -m venv .venv - .venv\scripts\activate - ``` - -1. Install the required packages: - - ```bash - pip install -r requirements.txt - ``` - -1. Configure your Azure App Configuration store with the following key-value pairs: - - | Key | Value | - |-----|-------| - | WeatherAgent:Spec | _See YAML below_ | - | WeatherAgent:ProjectEndpoint | _Your Foundry project endpoint_ | - - **YAML specification for _WeatherAgent:Spec_:** - ```yaml - kind: Prompt - name: WeatherAgent - description: Weather Agent - instructions: You are a helpful assistant. - model: - id: gpt-4.1 - connection: - kind: remote - ``` -1. Set the required environment variables: - - If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect: - - ```cmd - setx AZURE_APPCONFIGURATION_ENDPOINT "" - ``` - - If you use PowerShell, run the following command: - ```powershell - $Env:AZURE_APPCONFIGURATION_ENDPOINT="" - ``` - - If you use macOS or Linux run the following command: - ```bash - export AZURE_APPCONFIGURATION_ENDPOINT='' - ``` - -## Run the Application - -Start the console application: - -```bash -python app.py -``` \ No newline at end of file diff --git a/examples/Python/WeatherAgent/requirements.txt b/examples/Python/WeatherAgent/requirements.txt deleted file mode 100644 index 7239c35479ab2d88196d765b930925430e2ca833..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 196 zcmb7;OA3H65JTTu@F+c0(JDo(rT9S)ucmdUD;EQqN0OQAwDdRvGlq_YWz@bgNe^O{ sgGJgE?Ww6=ED~wt56XMBWw%wIFYK@1s4XeED&OjA`doZ?{@81FZk Date: Tue, 16 Dec 2025 11:08:16 +0300 Subject: [PATCH 06/16] Address PR comments --- examples/Python/ChatAgent/README.md | 2 +- examples/Python/ChatAgent/requirements.txt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/Python/ChatAgent/README.md b/examples/Python/ChatAgent/README.md index bc1bea4e..69246cd6 100644 --- a/examples/Python/ChatAgent/README.md +++ b/examples/Python/ChatAgent/README.md @@ -65,7 +65,7 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif description: Search the web for live information. ``` -1. Set the required environment variables: +1. Set the required environment variable: If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect: diff --git a/examples/Python/ChatAgent/requirements.txt b/examples/Python/ChatAgent/requirements.txt index 39e739fe..03244e21 100644 --- a/examples/Python/ChatAgent/requirements.txt +++ b/examples/Python/ChatAgent/requirements.txt @@ -1,4 +1,3 @@ agent-framework-azure-ai -azure-appconfiguration azure-appconfiguration-provider -azure-identity \ No newline at end of file +azure-identity From d15b704d438bd55ccf3272aad82734dae067fa3a Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Tue, 16 Dec 2025 12:29:27 +0300 Subject: [PATCH 07/16] Include package version --- examples/Python/ChatAgent/requirements.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/Python/ChatAgent/requirements.txt b/examples/Python/ChatAgent/requirements.txt index 03244e21..57f06d43 100644 --- a/examples/Python/ChatAgent/requirements.txt +++ b/examples/Python/ChatAgent/requirements.txt @@ -1,3 +1,4 @@ -agent-framework-azure-ai -azure-appconfiguration-provider -azure-identity +agent-framework-azure-ai==1.0.0b251120 +agent-framework-declarative==1.0.0b251120 +azure-appconfiguration-provider==2.3.1 +azure-identity==1.26.0b1 From 31cb4d84a5a93326120b361e8c6540e052abd5b6 Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Tue, 16 Dec 2025 20:46:45 +0300 Subject: [PATCH 08/16] Update package version --- examples/Python/ChatAgent/app.py | 28 ++++++++++------------ examples/Python/ChatAgent/requirements.txt | 4 ++-- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/examples/Python/ChatAgent/app.py b/examples/Python/ChatAgent/app.py index 11bb67c4..fb31afde 100644 --- a/examples/Python/ChatAgent/app.py +++ b/examples/Python/ChatAgent/app.py @@ -1,7 +1,6 @@ import asyncio import os from agent_framework.declarative import AgentFactory -from azure.identity.aio import DefaultAzureCredential as AsyncDefaultCredential from azure.identity import DefaultAzureCredential from azure.appconfiguration.provider import load @@ -13,23 +12,22 @@ async def main(): yaml_str = config["ChatAgent:Spec"] - async with ( - AsyncDefaultCredential() as credential, - AgentFactory(client_kwargs={"async_credential": credential, "project_endpoint": config["ChatAgent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) as agent, - ): - while True: - print("How can I help? (type 'quit' to exit)") + agent = AgentFactory(client_kwargs={"credential": credential, "project_endpoint": config["ChatAgent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) - user_input = input("User: ") - - if user_input.lower() in ['quit', 'exit', 'bye']: - break + while True: + print("How can I help? (type 'quit' to exit)") - response = await agent.run(user_input) - print("Agent response: ", response.text) - input("Press enter to continue...") + user_input = input("User: ") + + if user_input.lower() in ['quit', 'exit', 'bye']: + break + + response = await agent.run(user_input) + print("Agent response: ", response.text) + input("Press enter to continue...") + print("Exiting... Goodbye...") if __name__ == "__main__": - asyncio.run(main()) + asyncio.run(main()) \ No newline at end of file diff --git a/examples/Python/ChatAgent/requirements.txt b/examples/Python/ChatAgent/requirements.txt index 57f06d43..ec41b50b 100644 --- a/examples/Python/ChatAgent/requirements.txt +++ b/examples/Python/ChatAgent/requirements.txt @@ -1,4 +1,4 @@ -agent-framework-azure-ai==1.0.0b251120 -agent-framework-declarative==1.0.0b251120 +agent-framework-azure-ai==1.0.0b251211 +agent-framework-declarative==1.0.0b251211 azure-appconfiguration-provider==2.3.1 azure-identity==1.26.0b1 From 0d44ce2392ee5e5db0f46117a52cd2b223d6a905 Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Tue, 16 Dec 2025 20:49:43 +0300 Subject: [PATCH 09/16] Add extra line --- examples/Python/ChatAgent/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/Python/ChatAgent/app.py b/examples/Python/ChatAgent/app.py index fb31afde..627ed652 100644 --- a/examples/Python/ChatAgent/app.py +++ b/examples/Python/ChatAgent/app.py @@ -26,8 +26,7 @@ async def main(): print("Agent response: ", response.text) input("Press enter to continue...") - print("Exiting... Goodbye...") if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main()) From c4c90d6204e25c0b2a2a7390975b6f111933bae0 Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Tue, 16 Dec 2025 20:55:57 +0300 Subject: [PATCH 10/16] Add extra line --- examples/Python/ChatAgent/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Python/ChatAgent/app.py b/examples/Python/ChatAgent/app.py index 627ed652..1a7b8a97 100644 --- a/examples/Python/ChatAgent/app.py +++ b/examples/Python/ChatAgent/app.py @@ -26,7 +26,7 @@ async def main(): print("Agent response: ", response.text) input("Press enter to continue...") - print("Exiting... Goodbye...") + print("Exiting... Goodbye...") if __name__ == "__main__": asyncio.run(main()) From dc02afa4b3c84cc8c4eeb8a631aa925a43360378 Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi <33903727+MaryanneNjeri@users.noreply.github.com> Date: Tue, 16 Dec 2025 21:32:24 +0300 Subject: [PATCH 11/16] Update app.py From d1c89fb9f7a6ad21087696d944315c459bcbaca8 Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Wed, 17 Dec 2025 12:20:58 +0300 Subject: [PATCH 12/16] Address comments --- examples/Python/ChatAgent/README.md | 14 ++++++++------ examples/Python/ChatAgent/app.py | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/Python/ChatAgent/README.md b/examples/Python/ChatAgent/README.md index 69246cd6..bc995e0a 100644 --- a/examples/Python/ChatAgent/README.md +++ b/examples/Python/ChatAgent/README.md @@ -9,10 +9,12 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif ## Prerequisites -- Python 3.8 or later +- Python 3.10 or later - An Azure subscription with access to: - Azure App Configuration service - - Microsoft Foundry project + - An Azure AI project with a deployed gpt-4.1 model and Grounding with Bing Search configured as a connected resource. +- User has **App Configuration Reader** role assigned for the Azure App Configuration resource. +- User has **Azure AI User** role assigned for the Azure AI project. ## Setup @@ -31,7 +33,7 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif ``` On Windows run: - ```bash + ```cmd python -m venv .venv .venv\scripts\activate ``` @@ -49,7 +51,7 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif | ChatAgent:Spec | _See YAML below_ | | CharAgent:ProjectEndpoint | _Your Foundry project endpoint_ | - **YAML specification for _ChatAgent:Spec_:** + **YAML specification for _ChatAgent:Spec_** ```yaml kind: Prompt name: ChatAgent @@ -87,13 +89,13 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif 1. Start the console application: - ```bash + ```cmd python app.py ``` 2. Type the message "What is the weather in Seattle today?" when prompted with "How can I help?" and then press the Enter key - ```output + ```Output How can I help? (type 'quit' to exit) User: What is the weather today in Seattle ? Agent response: Today in Seattle, expect steady rain throughout the day with patchy fog, and a high temperature around 57°F (14°C). diff --git a/examples/Python/ChatAgent/app.py b/examples/Python/ChatAgent/app.py index 1a7b8a97..3768e174 100644 --- a/examples/Python/ChatAgent/app.py +++ b/examples/Python/ChatAgent/app.py @@ -10,9 +10,9 @@ async def main(): config = load(endpoint=endpoint, credential=credential) - yaml_str = config["ChatAgent:Spec"] + agent_spec = config["ChatAgent:Spec"] - agent = AgentFactory(client_kwargs={"credential": credential, "project_endpoint": config["ChatAgent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) + agent = AgentFactory(client_kwargs={"credential": credential, "project_endpoint": config["ChatAgent:ProjectEndpoint"]}).create_agent_from_yaml(agent_spec) while True: print("How can I help? (type 'quit' to exit)") From 62423b7e2525a8cc8906d27f9e100b39d9cf0880 Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi <33903727+MaryanneNjeri@users.noreply.github.com> Date: Wed, 17 Dec 2025 19:06:39 +0300 Subject: [PATCH 13/16] Update examples/Python/ChatAgent/README.md Co-authored-by: Jimmy Campbell --- examples/Python/ChatAgent/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Python/ChatAgent/README.md b/examples/Python/ChatAgent/README.md index bc995e0a..79da4322 100644 --- a/examples/Python/ChatAgent/README.md +++ b/examples/Python/ChatAgent/README.md @@ -10,7 +10,7 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif ## Prerequisites - Python 3.10 or later -- An Azure subscription with access to: +- An Azure subscription with: - Azure App Configuration service - An Azure AI project with a deployed gpt-4.1 model and Grounding with Bing Search configured as a connected resource. - User has **App Configuration Reader** role assigned for the Azure App Configuration resource. From eec7227d64614ad67cff674b4fb6c8420a5ba905 Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi <33903727+MaryanneNjeri@users.noreply.github.com> Date: Wed, 17 Dec 2025 19:06:54 +0300 Subject: [PATCH 14/16] Update examples/Python/ChatAgent/README.md Co-authored-by: Jimmy Campbell --- examples/Python/ChatAgent/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Python/ChatAgent/README.md b/examples/Python/ChatAgent/README.md index 79da4322..1fe65471 100644 --- a/examples/Python/ChatAgent/README.md +++ b/examples/Python/ChatAgent/README.md @@ -11,7 +11,7 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif - Python 3.10 or later - An Azure subscription with: - - Azure App Configuration service + - An Azure App Configuration store - An Azure AI project with a deployed gpt-4.1 model and Grounding with Bing Search configured as a connected resource. - User has **App Configuration Reader** role assigned for the Azure App Configuration resource. - User has **Azure AI User** role assigned for the Azure AI project. From 815957669c319d44382dddaf70550e0c78822a7e Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Wed, 17 Dec 2025 21:03:57 +0300 Subject: [PATCH 15/16] Include agent-framework-core with package version in requirements.txt --- examples/Python/ChatAgent/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Python/ChatAgent/requirements.txt b/examples/Python/ChatAgent/requirements.txt index ec41b50b..85f9ad8b 100644 --- a/examples/Python/ChatAgent/requirements.txt +++ b/examples/Python/ChatAgent/requirements.txt @@ -1,4 +1,5 @@ agent-framework-azure-ai==1.0.0b251211 agent-framework-declarative==1.0.0b251211 +agent-framework-core==1.0.0b251211 azure-appconfiguration-provider==2.3.1 azure-identity==1.26.0b1 From 9390fd3233be7c3384ad5ae18787f10355301d8b Mon Sep 17 00:00:00 2001 From: Maryanne Gichohi Date: Wed, 17 Dec 2025 21:15:53 +0300 Subject: [PATCH 16/16] Minor update in ReadMe --- examples/Python/ChatAgent/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Python/ChatAgent/README.md b/examples/Python/ChatAgent/README.md index 1fe65471..7a96dd5d 100644 --- a/examples/Python/ChatAgent/README.md +++ b/examples/Python/ChatAgent/README.md @@ -49,7 +49,7 @@ This sample demonstrates using Azure App Configuration to load agent YAML specif | Key | Value | |-----|-------| | ChatAgent:Spec | _See YAML below_ | - | CharAgent:ProjectEndpoint | _Your Foundry project endpoint_ | + | CharAgent:ProjectEndpoint | _Your Azure AI project endpoint_ | **YAML specification for _ChatAgent:Spec_** ```yaml