Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR cleans up import statements across Python agent examples and packages by:
- Removing unnecessary
from __future__ import annotationsimports (Python 3.10+ doesn't strictly require this for basic type hints) - Updating imports from the internal
agent_framework._clientsmodule to use the publicagent_frameworkAPI - Updating imports from
agent_framework_ag_uito use the re-export pathagent_framework.ag_ui - Cleaning up excessive blank lines in some files
Key Changes
- Removed
from __future__ import annotationsfrom 12 files (purview, redis, devui, azurefunctions packages and samples) - Updated
ChatClientProtocolimports fromagent_framework._clientstoagent_frameworkin 10 files (tests, examples, agents) - Updated AG-UI related imports from
agent_framework_ag_uitoagent_framework.ag_uiin 15 files (tests, examples, documentation)
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/getting_started/purview_agent/sample_purview_agent.py | Removed unnecessary from __future__ import annotations |
| python/packages/redis/agent_framework_redis/_chat_message_store.py | Removed unnecessary from __future__ import annotations |
| python/packages/purview/agent_framework_purview/_settings.py | Removed unnecessary from __future__ import annotations |
| python/packages/purview/agent_framework_purview/_processor.py | Removed unnecessary from __future__ import annotations |
| python/packages/purview/agent_framework_purview/_models.py | Removed unnecessary from __future__ import annotations |
| python/packages/purview/agent_framework_purview/_middleware.py | Removed unnecessary from __future__ import annotations |
| python/packages/purview/agent_framework_purview/_exceptions.py | Removed unnecessary from __future__ import annotations |
| python/packages/purview/agent_framework_purview/_client.py | Removed unnecessary from __future__ import annotations |
| python/packages/purview/agent_framework_purview/_cache.py | Removed unnecessary from __future__ import annotations |
| python/packages/devui/agent_framework_devui/models/_openai_custom.py | Removed unnecessary from __future__ import annotations |
| python/packages/devui/agent_framework_devui/models/_discovery_models.py | Removed unnecessary from __future__ import annotations |
| python/packages/devui/agent_framework_devui/_discovery.py | Removed unnecessary from __future__ import annotations |
| python/packages/core/tests/core/test_middleware.py | Updated ChatClientProtocol import to use public API |
| python/packages/core/agent_framework/observability.py | Updated ChatClientProtocol import in documentation example |
| python/packages/core/agent_framework/ag_ui/init.pyi | Changed import path from agent_framework_ag_ui to agent_framework.ag_ui (has issues - see comments) |
| python/packages/azurefunctions/agent_framework_azurefunctions/_models.py | Removed unnecessary from __future__ import annotations |
| python/packages/azurefunctions/agent_framework_azurefunctions/_errors.py | Removed unnecessary from __future__ import annotations and excess blank lines |
| python/packages/azurefunctions/agent_framework_azurefunctions/_callbacks.py | Removed imports and from __future__ import annotations (has issues - see comments) |
| python/packages/ag-ui/tests/test_structured_output.py | Updated AG-UI imports to use agent_framework.ag_ui |
| python/packages/ag-ui/tests/test_agent_wrapper_comprehensive.py | Updated AG-UI imports to use agent_framework.ag_ui |
| python/packages/ag-ui/getting_started/client_with_agent.py | Updated AG-UI imports to use agent_framework.ag_ui |
| python/packages/ag-ui/getting_started/client_advanced.py | Updated AG-UI imports to use agent_framework.ag_ui |
| python/packages/ag-ui/getting_started/client.py | Updated AG-UI imports to use agent_framework.ag_ui |
| python/packages/ag-ui/agent_framework_ag_ui_examples/server/main.py | Updated AG-UI imports to use agent_framework.ag_ui |
| python/packages/ag-ui/agent_framework_ag_ui_examples/server/api/backend_tool_rendering.py | Updated AG-UI imports to use agent_framework.ag_ui |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/weather_agent.py | Updated ChatClientProtocol import to use public API |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/ui_generator_agent.py | Updated both ChatClientProtocol and AG-UI imports |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/task_steps_agent.py | Updated both ChatClientProtocol and AG-UI imports |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/task_planner_agent.py | Updated both ChatClientProtocol and AG-UI imports |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/simple_agent.py | Updated ChatClientProtocol import to use public API |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/research_assistant_agent.py | Updated both ChatClientProtocol and AG-UI imports |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/recipe_agent.py | Updated both ChatClientProtocol and AG-UI imports |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/human_in_the_loop_agent.py | Updated ChatClientProtocol import to use public API |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/document_writer_agent.py | Updated both ChatClientProtocol and AG-UI imports |
| python/packages/ag-ui/agent_framework_ag_ui_examples/README.md | Updated AG-UI imports in documentation examples |
| python/packages/ag-ui/README.md | Updated AG-UI imports in documentation examples |
Comments suppressed due to low confidence (1)
python/packages/core/agent_framework/ag_ui/init.pyi:15
- The import path in this stub file is incorrect. This file is a type stub for re-exports from the separate
agent_framework_ag_uipackage, and should import fromagent_framework_ag_ui, not fromagent_framework.ag_ui(which would create a circular reference in the type system).
The import should be:
from agent_framework_ag_ui import (
AgentFrameworkAgent,
...
)from agent_framework.ag_ui import (
AgentFrameworkAgent,
AGUIChatClient,
AGUIEventConverter,
AGUIHttpService,
ConfirmationStrategy,
DefaultConfirmationStrategy,
DocumentWriterConfirmationStrategy,
RecipeConfirmationStrategy,
TaskPlannerConfirmationStrategy,
__version__,
add_agent_framework_fastapi_endpoint,
)
python/packages/azurefunctions/agent_framework_azurefunctions/_errors.py
Show resolved
Hide resolved
python/packages/azurefunctions/agent_framework_azurefunctions/_callbacks.py
Show resolved
Hide resolved
eavanvalkenburg
approved these changes
Nov 19, 2025
…_errors.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…_callbacks.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
moonbox3
approved these changes
Nov 19, 2025
larohra
approved these changes
Nov 19, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
* chore: tidy imports * Update python/packages/azurefunctions/agent_framework_azurefunctions/_errors.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update python/packages/azurefunctions/agent_framework_azurefunctions/_callbacks.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: revert stub file change * chore: trigger pre-commit hook, re-add `annotations` import --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Motivation and Context
This change is improves code readability and maintainability. It provides consistent imports and removes unnecessary imports. It contributes to a cleaner codebase.
Description
This PR updates the import statements in the agent examples to remove unnecessary
_clientsimports and uses the direct import path forAgentFrameworkAgentand confirmation strategies.Contribution Checklist