Skip to content

fix: Upgrade azure-ai-projects and agent-framework#599

Draft
Prachig-Microsoft wants to merge 12 commits into
devfrom
feature/upgrade-azure-ai-libs
Draft

fix: Upgrade azure-ai-projects and agent-framework#599
Prachig-Microsoft wants to merge 12 commits into
devfrom
feature/upgrade-azure-ai-libs

Conversation

@Prachig-Microsoft
Copy link
Copy Markdown
Contributor

This pull request updates both the ContentProcessor and ContentProcessorWorkflow projects to support the latest agent-framework (1.3.0) and azure-ai-projects (2.1.0) releases, and removes support for deprecated Azure agent client types. It also updates the code to use the new OpenAI client classes and adapts helper logic and retry wrappers accordingly.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Prachig-Microsoft and others added 2 commits May 20, 2026 14:18
- Update azure-ai-projects from 2.0.0b3/1.0.0b12 to 2.1.0 in pyproject.toml and requirements.txt
- Update agent-framework from 1.0.0b260127/1.0.0b260107 to 1.3.0 in pyproject.toml
- Migrate ChatMessage(text=...) to ChatMessage(contents=[...]) (breaking change in 1.0.0)
- Update codeSample.py to use new sub-client agents API (.agents.threads.create() etc.)
- Fix test files to use public ChatMessage import and new constructor

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…or 1.3.0

In agent-framework 1.3.0, Azure OpenAI clients were extracted into the
agent-framework-openai sub-package. The old import path
agent_framework.azure no longer exports OpenAI client classes.

Changes:
- AzureOpenAIChatClient -> OpenAIChatCompletionClient (agent_framework.openai)
- AzureOpenAIResponsesClient -> OpenAIChatClient (agent_framework.openai)
- Updated constructor params: deployment_name->model, endpoint->azure_endpoint,
  ad_token_provider->credential
- Removed unsupported params: ad_token, token_endpoint
- AzureOpenAIAssistantsClient and AzureAIAgentClient raise NotImplementedError
  (never used at runtime, no direct equivalents in 1.3.0)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL121716186% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
244 0 💤 0 ❌ 0 🔥 4.112s ⏱️

In agent-framework 1.3.0, individual event classes (ExecutorCompletedEvent,
ExecutorFailedEvent, ExecutorInvokedEvent, WorkflowFailedEvent,
WorkflowOutputEvent, WorkflowStartedEvent) were replaced by a unified
WorkflowEvent class with a type discriminator field.

Migrated isinstance checks to event.type == '...' pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reverted all agent-framework 1.3.0 breaking change fixes (ChatMessage,
event classes, import paths) back to dev baseline. Set agent-framework
to 1.1.1 instead of 1.3.0. Kept azure-ai-projects upgrade to 2.1.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Prachig-Microsoft Prachig-Microsoft changed the title fix: Upgrade azure-ai-projects and agent-framework with breaking changes fix: Upgrade azure-ai-projects and agent-framework May 20, 2026
agent-framework stable releases (1.1.1+) have the same API changes as 1.3.0:
- Individual event classes replaced by unified WorkflowEvent with type field
- Azure OpenAI clients moved to agent_framework.openai sub-package
- Constructor params renamed (deployment_name->model, endpoint->azure_endpoint)
- ChatMessage(text=...) replaced with ChatMessage(contents=[...])

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Dockerfile uses 'uv sync --frozen' which reads from uv.lock, not
pyproject.toml. The lock files were still pinned to the old beta
versions (1.0.0b260107/1.0.0b260127), causing the Docker build to
install the old beta despite pyproject.toml specifying 1.1.1.

Regenerated both lock files to resolve agent-framework 1.1.1 with
agent-framework-openai 1.1.1 and agent-framework-core 1.1.1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Updated mock patches in test_agent_framework_helper.py to reference:
- agent_framework.openai.OpenAIChatCompletionClient (was azure.AzureOpenAIChatClient)
- agent_framework.openai.OpenAIChatClient (was azure.AzureOpenAIResponsesClient)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Stable agent-framework 1.1.1 renamed core symbols from beta versions:
- ChatClientProtocol -> SupportsChatGetResponse
- ChatAgent -> Agent
- ChatMessage -> Message
- AgentProtocol -> SupportsAgentRun
- AgentRunContext -> AgentContext
- AgentRunUpdateEvent -> AgentResponseUpdate
- ToolProtocol -> Any (removed)
- ChatMessageStoreProtocol -> HistoryProvider
- AggregateContextProvider -> ContextProvider
- GroupChatBuilder -> from agent_framework.orchestrations
- ManagerSelectionResponse -> local Pydantic model (removed from SDK)

Updated 21 files across production code and tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
In agent-framework 1.1.1, WorkflowBuilder requires start_executor as a
mandatory keyword argument. Moved from .set_start_executor() chain call
to constructor parameter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
WorkflowBuilder in agent-framework 1.1.1 removed register_executor()
and string-based names. Now requires actual Executor instances passed
to start_executor= and add_edge(source, target).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Agent constructor: client= (not chat_client=), model params via
  default_options=ChatOptions(...) instead of individual kwargs
- WorkflowContext: set_shared_state() -> set_state()
- GroupChatBuilder: constructor params instead of fluent .with_*()
- Agent.run: response_format via options=ChatOptions(...)
- _inner_get_response: options= (not chat_options=)
- Remove dead _inner_get_streaming_response (no longer in 1.1.1 API)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant