Skip to content

Conversation

@eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Oct 30, 2025

Motivation and Context

Removed Azure Monitor dependency, added importerror catch with a good message.
Also removed viz extra, since we want to not use extras as much as possible, also updated import error message
Reviewed some other depencies:

  • aiofiles was only used in a sample
  • aiohttp was not used in azure-ai package

Closes #1376

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings October 30, 2025 09:04
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Oct 30, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   observability.py60711281%238, 264–266, 268, 270–274, 282–283, 288–289, 294–299, 322–324, 326–327, 333, 417, 427, 449, 455, 474–476, 484–486, 509–511, 521–523, 656, 658, 745–749, 752–756, 765–768, 778–781, 783, 870–873, 1048, 1196–1198, 1353, 1360, 1362, 1364, 1366, 1368, 1370, 1372, 1374, 1376, 1378, 1382–1384, 1386, 1396, 1424–1425, 1435, 1438–1441, 1455, 1460–1462, 1464–1467, 1469–1470, 1474, 1477, 1497, 1535, 1551, 1555, 1689, 1691
packages/core/agent_framework/_workflows
   _viz.py1781889%81–82, 96–98, 101–102, 105, 112, 130, 141, 152, 163–166, 285, 338
TOTAL11949183384% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
1441 98 💤 0 ❌ 0 🔥 28.696s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes several dependencies from the Python agent framework to make them optional, reducing the base installation size and complexity. The changes focus on making Azure Monitor telemetry and graphviz visualization opt-in rather than required dependencies.

Key Changes:

  • Removed mandatory dependencies: aiohttp, aiofiles, azure-monitor-opentelemetry, azure-monitor-opentelemetry-exporter, and graphviz
  • Added try-catch blocks to handle optional imports gracefully with helpful error messages
  • Updated documentation to reflect the new installation instructions for optional features
  • Removed the viz extra from core package, making graphviz a standalone optional install
  • Updated dependency versions for agentlightning, azure-storage-blob, and virtualenv

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
python/uv.lock Removed unused dependencies and updated package versions
python/packages/core/pyproject.toml Reorganized dependencies, removed viz extra, and eliminated azure-monitor and aiofiles as required dependencies
python/packages/core/agent_framework/observability.py Added try-catch for Azure Monitor imports with helpful error message
python/packages/core/agent_framework/_workflows/_viz.py Updated error message for graphviz installation instructions
python/packages/azure-ai/pyproject.toml Removed aiohttp dependency
python/samples/getting_started/workflows/parallelism/map_reduce_and_visualization.py Updated installation instructions for graphviz

@markwallace-microsoft markwallace-microsoft added the lab Agent Framework Lab label Oct 30, 2025
Copy link
Contributor

@ekzhu ekzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do a search for documentation referencing the viz extra and update those as well?

@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Oct 30, 2025
Merged via the queue into microsoft:main with commit 434ffb8 Oct 30, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lab Agent Framework Lab python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Dependency on Azure Monitor OpenTelemetry package means OTEL autoinstrumentation requires Azure Monitor

5 participants