Skip to content

Python: Fix for Azure AI client#2358

Merged
dmytrostruk merged 2 commits intomicrosoft:mainfrom
dmytrostruk:azure-ai-fix
Nov 20, 2025
Merged

Python: Fix for Azure AI client#2358
dmytrostruk merged 2 commits intomicrosoft:mainfrom
dmytrostruk:azure-ai-fix

Conversation

@dmytrostruk
Copy link
Member

Motivation and Context

Resolves: #2338
Resolves: #2294

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.

@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Nov 20, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azure-ai/agent_framework_azure_ai
   _client.py1422284%165–168, 172–173, 175, 324–325, 329, 331–332, 334–342, 344
TOTAL15445235484% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2175 127 💤 0 ❌ 0 🔥 55.429s ⏱️

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 fixes issues #2338 and #2294 by updating the Azure AI client to work with version 2.0.0b2 of the azure-ai-projects package, where the get_openai_client() method changed from asynchronous to synchronous.

Key Changes:

  • Updated azure-ai-projects dependency from version 2.0.0b1 to 2.0.0b2
  • Removed await keyword from get_openai_client() call to match the new synchronous API
  • Updated test mock from AsyncMock to MagicMock to reflect the synchronous behavior

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
python/packages/azure-ai/pyproject.toml Bumps azure-ai-projects dependency to version 2.0.0b2
python/packages/azure-ai/agent_framework_azure_ai/_client.py Removes await from get_openai_client() call in initialize_client method
python/packages/azure-ai/tests/test_azure_ai_client.py Updates mock from AsyncMock to MagicMock to match synchronous API behavior

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dmytrostruk dmytrostruk added this pull request to the merge queue Nov 20, 2025
Merged via the queue into microsoft:main with commit b575b63 Nov 20, 2025
23 checks passed
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
* Fix for Azure AI client

* Update python/packages/azure-ai/agent_framework_azure_ai/_client.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

5 participants