-
Notifications
You must be signed in to change notification settings - Fork 1k
Python: Create/Get Agent API for Azure V1 #3192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this 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
AzureAIAgentsProviderclass withcreate_agent(),get_agent(), andas_agent()methods - Extracted shared tool conversion utilities to
_shared.pyfor 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) |
Motivation and Context
This PR contains an implementation of create/get API with
Providertype for Azure AI V1 chat client, based on Option 2 from this ADR.Example:
Contribution Checklist