Upgrade azure-ai-agentserver-agentframework to agent-framework 1.0.0b260212#45239
Open
eavanvalkenburg wants to merge 4 commits intoAzure:mainfrom
Open
Upgrade azure-ai-agentserver-agentframework to agent-framework 1.0.0b260212#45239eavanvalkenburg wants to merge 4 commits intoAzure:mainfrom
eavanvalkenburg wants to merge 4 commits intoAzure:mainfrom
Conversation
|
Thank you for your contribution @eavanvalkenburg! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the azure-ai-agentserver-agentframework package to use agent-framework version 1.0.0b260212 (February 2026 release), applying significant breaking changes from the upstream framework. The upgrade modernizes the codebase with Python 3.10+ features and simplifies the architecture.
Changes:
- Upgraded agent-framework dependencies from 1.0.0b251007 to 1.0.0b260212
- Refactored utility classes into module-level functions and constants
- Replaced isinstance checks with Python 3.10+ match statements throughout converters
- Updated streaming API from
run_stream()torun(stream=True)returningResponseStream - Modernized observability setup from
setup_observability()toconfigure_azure_monitor()+enable_instrumentation()
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updated agent-framework dependencies to version 1.0.0b260212 |
| constants.py | Converted Constants class to module-level constants |
| agent_id_generator.py | Converted AgentIdGenerator class to generate_agent_id() function |
| agent_framework_input_converters.py | Refactored AgentFrameworkInputConverter class to transform_input() function; replaced isinstance checks with match statements |
| agent_framework_output_streaming_converter.py | Updated to use AgentResponseUpdate, Content types; added text_reasoning support; replaced isinstance with match statements |
| agent_framework_output_non_streaming_converter.py | Updated to use AgentResponse, Content types; replaced isinstance with match statements |
| agent_framework.py | Updated to use SupportsAgentRun; changed streaming API to run(stream=True); modernized observability setup; removed asyncio timeout logic |
| test_agent_framework_input_converter.py | Updated tests to use transform_input function and new Message/Content APIs |
| workflow_agent_simple.py | Updated to use new Message/Content APIs, WorkflowEvent, WorkflowBuilder(start_executor=...) pattern |
| minimal_async_example.py | Changed create_agent() to as_agent() |
| mcp_simple.py | Changed create_agent() to as_agent() |
| mcp_apikey.py | Changed create_agent() to as_agent() |
| minimal_example.py | Changed create_agent() to as_agent() |
...r/azure-ai-agentserver-agentframework/azure/ai/agentserver/agentframework/agent_framework.py
Outdated
Show resolved
Hide resolved
...ork/azure/ai/agentserver/agentframework/models/agent_framework_output_streaming_converter.py
Show resolved
Hide resolved
Breaking changes applied: - AgentProtocol → SupportsAgentRun - ChatMessage/Role/TextContent → Message/string roles/Content - AgentRunResponse → AgentResponse, AgentRunResponseUpdate → AgentResponseUpdate - run_stream() → run(stream=True) returning ResponseStream - isinstance checks → Content.type string discriminator with match statements - .create_agent() → .as_agent() in samples - WorkflowBuilder constructor, WorkflowEvent, options pattern in workflow sample - setup_observability() → configure_azure_monitor() + enable_instrumentation() Refactoring: - Replace classes with module-level functions and constants - Use Python 3.10+ match statements throughout converters - Add text_reasoning content type support - Add warning logging for unknown content types Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove unused _resolve_stream_timeout method (dead code after asyncio removal) - Remove unused constants import from agent_framework.py - Add explicit text_reasoning case in _TextContentStreamingState.convert_content Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Widen _coerce_to_strings return type to list[str | Message] for invariance - Add explicit result type annotations in function output converters - Fix str | list[str] union in streaming converter fallback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
96e7cd6 to
e6ea939
Compare
- Add type annotation for response_data (mypy var-annotated) - Add missing docstring params, returns, rtypes (pylint C4739/C4741/C4742) - Initialize self.tracer in __init__ (pylint W0201) - Change exception logging to debug level (pylint C4766) - Suppress too-many-return-statements (pylint R0911) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e6ea939 to
0c25128
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the agent-framework dependency from
1.0.0b251007(Oct 2025) to1.0.0b260212(Feb 2026), applying all breaking changes from the official upgrade guide.Breaking changes applied
AgentProtocol→SupportsAgentRunChatMessage/Role/TextContent→Message/string roles/ContentAgentRunResponse→AgentResponse,AgentRunResponseUpdate→AgentResponseUpdaterun_stream()→run(stream=True)returningResponseStreamisinstancechecks →Content.typestring discriminator withmatchstatements.create_agent()→.as_agent()in samplesWorkflowBuilderconstructor,WorkflowEvent, options pattern in workflow samplesetup_observability()→configure_azure_monitor()+enable_instrumentation()Refactoring
Constants,AgentIdGenerator,AgentFrameworkInputConverter)matchstatements throughout converterstext_reasoningcontent type supportResponseStreamasync iteration patternTesting
All 9 unit tests pass.