diff --git a/python/packages/core/agent_framework/__init__.py b/python/packages/core/agent_framework/__init__.py index a098159a50..13d7bade00 100644 --- a/python/packages/core/agent_framework/__init__.py +++ b/python/packages/core/agent_framework/__init__.py @@ -277,11 +277,11 @@ "USER_AGENT_TELEMETRY_DISABLED_ENV_VAR", "Agent", "AgentContext", - "AgentFrameworkException", "AgentEvalConverter", "AgentExecutor", "AgentExecutorRequest", "AgentExecutorResponse", + "AgentFrameworkException", "AgentMiddleware", "AgentMiddlewareLayer", "AgentMiddlewareTypes", diff --git a/python/packages/core/tests/core/test_exceptions.py b/python/packages/core/tests/core/test_exceptions.py index 47b3a53197..bf164cdbe2 100644 --- a/python/packages/core/tests/core/test_exceptions.py +++ b/python/packages/core/tests/core/test_exceptions.py @@ -2,8 +2,6 @@ """Tests for AgentFrameworkException inner_exception handling.""" -import pytest - from agent_framework import AgentFrameworkException 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 05e5f2637f..7ffb0165c4 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 @@ -37,6 +37,8 @@ async def poem_workflow(topic: str) -> str: poem = (await writer.run(f"Write a poem about: {topic}")).text review = (await reviewer.run(f"Review this poem: {poem}")).text return f"Poem:\n{poem}\n\nReview: {review}" + + # diff --git a/python/samples/01-get-started/06_functional_workflow_basics.py b/python/samples/01-get-started/06_functional_workflow_basics.py index 8033a7ac4e..a679e70a99 100644 --- a/python/samples/01-get-started/06_functional_workflow_basics.py +++ b/python/samples/01-get-started/06_functional_workflow_basics.py @@ -36,6 +36,8 @@ async def text_workflow(text: str) -> str: """Uppercase the text, then reverse it.""" upper = await to_upper_case(text) return await reverse_text(upper) + + # diff --git a/python/samples/04-hosting/a2a/agent_framework_to_a2a.py b/python/samples/04-hosting/a2a/agent_framework_to_a2a.py index 0693b61b0a..6e68f21a02 100644 --- a/python/samples/04-hosting/a2a/agent_framework_to_a2a.py +++ b/python/samples/04-hosting/a2a/agent_framework_to_a2a.py @@ -51,7 +51,7 @@ agent = Agent( client=OpenAIChatClient(), name="Europe Travel Agent", - instructions="You are a helpful Europe Travel Agent. You can help users search and book flights and hotels across Europe." + instructions="You are a helpful Europe Travel Agent. You can help users search and book flights and hotels across Europe.", ) request_handler = DefaultRequestHandler( diff --git a/python/samples/04-hosting/azure_functions/README.md b/python/samples/04-hosting/azure_functions/README.md index cd410771c6..0580dee843 100644 --- a/python/samples/04-hosting/azure_functions/README.md +++ b/python/samples/04-hosting/azure_functions/README.md @@ -19,18 +19,22 @@ All of these samples are set up to run in Azure Functions. Azure Functions has a ### 2. Create and activate a virtual environment +Using [uv](https://docs.astral.sh/uv/) (recommended): + **Windows (PowerShell):** ```powershell -python -m venv .venv +uv venv .venv .venv\Scripts\Activate.ps1 ``` **Linux/macOS:** ```bash -python -m venv .venv +uv venv .venv source .venv/bin/activate ``` +> **Note:** `python -m venv .venv` also works, but can hang indefinitely on Windows with Microsoft Store Python due to a known `ensurepip` issue. Use `uv venv .venv` to avoid this. + ### 3. Running the samples - [Start the Azurite emulator](https://learn.microsoft.com/en-us/azure/storage/common/storage-install-azurite?tabs=npm%2Cblob-storage#run-azurite) diff --git a/python/samples/04-hosting/foundry-hosted-agents/README.md b/python/samples/04-hosting/foundry-hosted-agents/README.md index dcb7dcd24d..609356eda0 100644 --- a/python/samples/04-hosting/foundry-hosted-agents/README.md +++ b/python/samples/04-hosting/foundry-hosted-agents/README.md @@ -6,18 +6,25 @@ Read more about Foundry Hosted Agents [here](https://learn.microsoft.com/en-us/a ## Environment setup -1. Navigate to the sample directory you want to run. For example: +1. Navigate to the sample directory you want to run. For example, create and activate a virtual environment using [uv](https://docs.astral.sh/uv/) (recommended): ```bash - python -m venv .venv + uv venv .venv + ``` + + ```bash + # Windows (PowerShell) + .venv\Scripts\Activate.ps1 - # Windows - .venv\Scripts\Activate + # Windows (Command Prompt) + .venv\Scripts\activate.bat # macOS/Linux source .venv/bin/activate ``` + > **Note:** `python -m venv .venv` also works, but can hang indefinitely on Windows with Microsoft Store Python due to a known `ensurepip` issue. Use `uv venv .venv` to avoid this. + 2. Install dependencies: ```bash