Skip to content

Conversation

@dmytrostruk
Copy link
Member

Motivation and Context

This PR contains an implementation of create/get API with Provider type for Azure AI V1 chat client, based on Option 2 from this ADR.

Example:

from agent_framework.azure import AzureAIAgentsProvider
from azure.ai.agents import AgentsClient

client = AgentsClient(endpoint, credential)
provider = AzureAIAgentsProvider(client)

agent = await provider.create_agent(name="MyAgent", model="gpt-4", instructions="...")
agent = await provider.get_agent(agent_id="persistent-agent-456")
agent = provider.as_agent(persistent_agent)

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.

@dmytrostruk dmytrostruk self-assigned this Jan 13, 2026
Copilot AI review requested due to automatic review settings January 13, 2026 06:54
@markwallace-microsoft markwallace-microsoft added the documentation Improvements or additions to documentation label Jan 13, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jan 13, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azure-ai/agent_framework_azure_ai
   _agent_provider.py1151487%103–104, 213, 215, 232, 388–390, 421–426
   _chat_client.py3947880%278, 537–538, 540, 543, 546, 549–554, 557, 559, 567, 579–581, 585, 588–589, 597–600, 610, 618–621, 623–624, 626–627, 634, 642–643, 651–652, 657–658, 662–669, 674–675, 683, 689, 697–699, 702, 724–725, 787, 859, 888, 901–905, 942–944, 947–948, 989–994
   _shared.py1201885%97, 99, 101, 103, 148, 236–239, 242–244, 247–248, 258, 265–267
TOTAL17837290583% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3049 158 💤 0 ❌ 0 🔥 1m 2s ⏱️

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 implements a provider pattern for Azure AI V1 agent management by introducing the AzureAIAgentsProvider class. The provider enables creating, retrieving, and wrapping Azure AI agents with a clean, high-level API that manages agent lifecycle and tool conversion automatically.

Changes:

  • Added AzureAIAgentsProvider class with create_agent(), get_agent(), and as_agent() methods
  • Extracted shared tool conversion utilities to _shared.py for reuse between provider and chat client
  • Updated all 15 sample files to use the new provider pattern consistently
  • Added comprehensive test coverage with 39 unit tests and 3 integration tests

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
python/packages/azure-ai/agent_framework_azure_ai/_agent_provider.py New provider class implementing agent creation, retrieval, and wrapping with lifecycle management
python/packages/azure-ai/agent_framework_azure_ai/_shared.py Shared utilities for bidirectional tool conversion between Agent Framework and Azure AI SDK formats
python/packages/azure-ai/agent_framework_azure_ai/_chat_client.py Refactored to use shared tool conversion utilities, removed duplicate code
python/packages/azure-ai/agent_framework_azure_ai/__init__.py Added AzureAIAgentsProvider to package exports
python/packages/core/agent_framework/azure/__init__.py Added AzureAIAgentsProvider to lazy import configuration
python/packages/core/agent_framework/azure/__init__.pyi Added type stub for AzureAIAgentsProvider
python/packages/azure-ai/tests/test_agent_provider.py Comprehensive test suite covering provider initialization, agent operations, tool conversion, and integration scenarios
python/packages/azure-ai/tests/test_azure_ai_agent_client.py Updated tests to use shared utilities, removed duplicate tool preparation tests
python/samples/getting_started/agents/azure_ai_agent/*.py All 14 sample files updated to use provider pattern
python/samples/getting_started/agents/azure_ai_agent/azure_ai_provider_methods.py New sample demonstrating all provider methods
python/samples/getting_started/agents/azure_ai_agent/README.md Updated with provider pattern documentation and examples
.gitignore Added temporary file pattern (unrelated to PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants