From 9d0870a66c6eeb67e9aebc778604aff65c18927f Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 26 Aug 2025 11:29:09 -0700 Subject: [PATCH 1/2] Prep for beta release --- sdk/ai/azure-ai-projects/CHANGELOG.md | 10 +++++----- sdk/ai/azure-ai-projects/setup.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index e5ee49d433be..d2b6952da89e 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -1,13 +1,13 @@ # Release History -## 1.1.0b3 (Unreleased) +## 1.1.0b3 (2025-08-26) ### Features added -* File `setup.py` was updated to indicate the dependency `azure-ai-agents>=1.2.0b1` -instead of `azure-ai-agents>=1.0.0`. This means that in a clean environment installing -this version of `azure-ai-projects` will install latest beta version of `azure-ai-agents` -(which has lots of features in preview) instead of latest stable version (which does +* File `setup.py` was updated to indicate the dependency `azure-ai-agents>=1.2.0b3` +instead of `azure-ai-agents>=1.0.0`. This means that in a clean environment, installing +via `pip install --pre azure-ai-projects` will install latest beta version of `azure-ai-agents` +(which has features in preview) instead of latest stable version (which does not include preview features). ### Breaking changes diff --git a/sdk/ai/azure-ai-projects/setup.py b/sdk/ai/azure-ai-projects/setup.py index 8717f8e1fce8..e23ea5adc0fd 100644 --- a/sdk/ai/azure-ai-projects/setup.py +++ b/sdk/ai/azure-ai-projects/setup.py @@ -71,7 +71,7 @@ "azure-core>=1.30.0", "typing-extensions>=4.12.2", "azure-storage-blob>=12.15.0", - "azure-ai-agents>=1.2.0b1", + "azure-ai-agents>=1.2.0b3", ], python_requires=">=3.9", ) From 591d0b445d08602e7d6c459f6053b25a8795ca48 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Thu, 4 Sep 2025 15:01:04 -0700 Subject: [PATCH 2/2] Set missing path in one sample. Update all to be alike --- .../samples/agents_async/utils/user_async_functions.py | 10 +++++----- ...sample_agents_stream_eventhandler_with_functions.py | 9 +++++---- .../sample_agents_stream_eventhandler_with_toolset.py | 9 +++++---- .../sample_agents_stream_iteration_with_functions.py | 9 +++++---- .../sample_agents_stream_iteration_with_toolset.py | 9 +++++---- .../agents_tools/sample_agents_auto_function_call.py | 6 ++++++ .../samples/agents_tools/sample_agents_functions.py | 9 +++++---- .../samples/agents_tools/sample_agents_logic_apps.py | 10 +++++----- .../agents_tools/sample_agents_run_with_toolset.py | 9 +++++---- 9 files changed, 46 insertions(+), 34 deletions(-) diff --git a/sdk/ai/azure-ai-agents/samples/agents_async/utils/user_async_functions.py b/sdk/ai/azure-ai-agents/samples/agents_async/utils/user_async_functions.py index 202efe8b5df9..7ffd3cb3cf6c 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_async/utils/user_async_functions.py +++ b/sdk/ai/azure-ai-agents/samples/agents_async/utils/user_async_functions.py @@ -13,12 +13,12 @@ from azure.ai.agents.telemetry import trace_function -# Add parent directory to sys.path to import user_functions +# Add package directory to sys.path to import user_functions current_dir = os.path.dirname(os.path.abspath(__file__)) -parent_dir = os.path.abspath(os.path.join(current_dir, "..", "..", "..")) -if parent_dir not in sys.path: - sys.path.insert(0, parent_dir) -from samples.utils.user_functions import fetch_current_datetime, fetch_weather, send_email +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) +from samples.utils.user_functions import fetch_weather, send_email async def send_email_async(recipient: str, subject: str, body: str) -> str: diff --git a/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_functions.py b/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_functions.py index e16a99df53a7..7aeb75ead787 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_functions.py +++ b/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_functions.py @@ -40,10 +40,11 @@ ) from azure.identity import DefaultAzureCredential -current_path = os.path.dirname(__file__) -root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir)) -if root_path not in sys.path: - sys.path.insert(0, root_path) +# Add package directory to sys.path to import user_functions +current_dir = os.path.dirname(os.path.abspath(__file__)) +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) from samples.utils.user_functions import user_functions project_client = AIProjectClient( diff --git a/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_toolset.py b/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_toolset.py index b355baefac05..83e3423b14d6 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_toolset.py +++ b/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_toolset.py @@ -38,10 +38,11 @@ import os, sys from typing import Any -current_path = os.path.dirname(__file__) -root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir)) -if root_path not in sys.path: - sys.path.insert(0, root_path) +# Add package directory to sys.path to import user_functions +current_dir = os.path.dirname(os.path.abspath(__file__)) +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) from samples.utils.user_functions import user_functions project_client = AIProjectClient( diff --git a/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_functions.py b/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_functions.py index bc5646270da8..8169664f6297 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_functions.py +++ b/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_functions.py @@ -41,10 +41,11 @@ ) from azure.identity import DefaultAzureCredential -current_path = os.path.dirname(__file__) -root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir)) -if root_path not in sys.path: - sys.path.insert(0, root_path) +# Add package directory to sys.path to import user_functions +current_dir = os.path.dirname(os.path.abspath(__file__)) +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) from samples.utils.user_functions import user_functions project_client = AIProjectClient( diff --git a/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_toolset.py b/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_toolset.py index 4562c7bfa381..0a515f38f25f 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_toolset.py +++ b/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_toolset.py @@ -35,10 +35,11 @@ from azure.ai.agents.models import FunctionTool, ToolSet from azure.identity import DefaultAzureCredential -current_path = os.path.dirname(__file__) -root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir)) -if root_path not in sys.path: - sys.path.insert(0, root_path) +# Add package directory to sys.path to import user_functions +current_dir = os.path.dirname(os.path.abspath(__file__)) +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) from samples.utils.user_functions import user_functions project_client = AIProjectClient( diff --git a/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_auto_function_call.py b/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_auto_function_call.py index a1a9ee49a697..ecbc6179b0aa 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_auto_function_call.py +++ b/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_auto_function_call.py @@ -27,6 +27,12 @@ from azure.ai.projects import AIProjectClient from azure.identity import DefaultAzureCredential from azure.ai.agents.models import FunctionTool + +# Add package directory to sys.path to import user_functions +current_dir = os.path.dirname(os.path.abspath(__file__)) +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) from samples.utils.user_functions import user_functions project_client = AIProjectClient( diff --git a/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_functions.py b/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_functions.py index fd712a5f5342..573fb800cd7c 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_functions.py +++ b/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_functions.py @@ -32,10 +32,11 @@ ToolOutput, ) -current_path = os.path.dirname(__file__) -root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir)) -if root_path not in sys.path: - sys.path.insert(0, root_path) +# Add package directory to sys.path to import user_functions +current_dir = os.path.dirname(os.path.abspath(__file__)) +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) from samples.utils.user_functions import user_functions project_client = AIProjectClient( diff --git a/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_logic_apps.py b/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_logic_apps.py index d0a9590f822e..5aae90f30303 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_logic_apps.py +++ b/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_logic_apps.py @@ -44,11 +44,11 @@ from azure.ai.agents.models import ToolSet, FunctionTool from azure.identity import DefaultAzureCredential -# Example user function -current_path = os.path.dirname(__file__) -root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir)) -if root_path not in sys.path: - sys.path.insert(0, root_path) +# Add package directory to sys.path to import user_functions +current_dir = os.path.dirname(os.path.abspath(__file__)) +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) from samples.utils.user_functions import fetch_current_datetime # Import AzureLogicAppTool and the function factory from user_logic_apps diff --git a/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_run_with_toolset.py b/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_run_with_toolset.py index b6c86a10b28d..ad35860fda53 100644 --- a/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_run_with_toolset.py +++ b/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_run_with_toolset.py @@ -27,10 +27,11 @@ from azure.identity import DefaultAzureCredential from azure.ai.agents.models import FunctionTool, ToolSet, CodeInterpreterTool -current_path = os.path.dirname(__file__) -root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir)) -if root_path not in sys.path: - sys.path.insert(0, root_path) +# Add package directory to sys.path to import user_functions +current_dir = os.path.dirname(os.path.abspath(__file__)) +package_dir = os.path.abspath(os.path.join(current_dir, os.pardir, os.pardir)) +if package_dir not in sys.path: + sys.path.insert(0, package_dir) from samples.utils.user_functions import user_functions project_client = AIProjectClient(