Upgrade azure-ai-agentserver-agentframework to agent-framework 1.0.0rc1#45239
Upgrade azure-ai-agentserver-agentframework to agent-framework 1.0.0rc1#45239eavanvalkenburg wants to merge 2 commits intoAzure:lusu/agentserver-1110from
Conversation
|
Thank you for your contribution @eavanvalkenburg! We will review the pull request and get back to you soon. |
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
04c6572 to
df4ff48
Compare
|
|
||
|
|
||
| class AgentFrameworkInputConverter: | ||
| def transform_input( # pylint: disable=too-many-return-statements |
There was a problem hiding this comment.
Could you do the update based on dev branch?
| for j, content in enumerate(contents): | ||
| logger.debug(" content index=%d in message=%d type=%s", j, i, type(content).__name__) | ||
| self._append_content_item(content, completed_items, msg_author_name) | ||
| self._append_content_item(content, completed_items) |
There was a problem hiding this comment.
please do the update based on dev branch. The message author info need to be included.
| logger = get_logger() | ||
|
|
||
|
|
||
| class _BaseStreamingState: |
There was a problem hiding this comment.
please do the update based on dev branch.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Superseded by #45428 |
Summary
Upgrades the agent-framework dependency from
1.0.0b251007(Oct 2025) to1.0.0rc1(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.