Python: [BREAKING] Standardize TypeVar naming convention (TName → NameT)#3770
Merged
giles17 merged 4 commits intomicrosoft:mainfrom Feb 10, 2026
Merged
Python: [BREAKING] Standardize TypeVar naming convention (TName → NameT)#3770giles17 merged 4 commits intomicrosoft:mainfrom
giles17 merged 4 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes Python TypeVar naming across the Agent Framework to use a ...T suffix instead of a T... prefix, aligning typing identifiers across core, provider packages, tests, and samples (resolving #3594).
Changes:
- Renamed TypeVars throughout Python packages (core + integrations) to the
NameT/NameBoundT/OptionsCoTstyle. - Updated affected generics/overloads/annotations in core typing surfaces (
_types.py,_clients.py, middleware/layers) and downstream provider packages to match. - Updated samples/tests to import and use the renamed TypeVars (plus a small pyright-import suppression tweak in an OTel sample).
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/getting_started/observability/configure_otel_providers_with_parameters.py | Adds pyright suppression for optional OTLP exporter imports in the sample. |
| python/samples/getting_started/chat_client/custom_chat_client.py | Updates sample generics to use renamed options TypeVar. |
| python/packages/purview/agent_framework_purview/_models.py | Renames TypeVar used for _AliasSerializable helper typing. |
| python/packages/ollama/agent_framework_ollama/_chat_client.py | Renames response/options TypeVars used by Ollama chat client/options. |
| python/packages/github_copilot/agent_framework_github_copilot/_agent.py | Renames agent options TypeVar and updates method signatures accordingly. |
| python/packages/foundry_local/agent_framework_foundry_local/_foundry_local_client.py | Renames response/options TypeVars used by Foundry Local client/options. |
| python/packages/durabletask/tests/test_durable_entities.py | Renames test TypeVar used for entity state typing. |
| python/packages/devui/tests/devui/conftest.py | Updates test mocks to use renamed options TypeVar. |
| python/packages/declarative/agent_framework_declarative/_models.py | Renames connection/tool TypeVars used by serialization helpers. |
| python/packages/core/tests/core/conftest.py | Updates core test mock chat client generics to renamed options TypeVar. |
| python/packages/core/agent_framework/openai/_responses_client.py | Renames response-format/options TypeVars for OpenAI Responses client. |
| python/packages/core/agent_framework/openai/_chat_client.py | Renames response/options TypeVars for OpenAI Chat client. |
| python/packages/core/agent_framework/openai/_assistants_client.py | Renames response/options TypeVars for OpenAI Assistants client. |
| python/packages/core/agent_framework/openai/_assistant_provider.py | Renames provider options TypeVar for typed ChatAgent[...] returns. |
| python/packages/core/agent_framework/observability.py | Renames TypeVars used by telemetry layers and related overloads. |
| python/packages/core/agent_framework/azure/_responses_client.py | Renames Azure Responses options TypeVar. |
| python/packages/core/agent_framework/azure/_chat_client.py | Renames Azure Chat response/options/client TypeVars. |
| python/packages/core/agent_framework/azure/_assistants_client.py | Renames Azure Assistants options TypeVar. |
| python/packages/core/agent_framework/_workflows/_model_utils.py | Renames model TypeVar used by workflow dict/json conversion helpers. |
| python/packages/core/agent_framework/_types.py | Renames many core TypeVars (responses/content/stream generics) and updates exports. |
| python/packages/core/agent_framework/_tools.py | Renames TypeVars used by tool layers and overloads. |
| python/packages/core/agent_framework/_threads.py | Renames thread/store TypeVars used by (de)serialization classmethods. |
| python/packages/core/agent_framework/_serialization.py | Renames protocol/class TypeVars used in serialization helpers. |
| python/packages/core/agent_framework/_pydantic.py | Renames settings TypeVar used for AFBaseSettings.__new__ typing. |
| python/packages/core/agent_framework/_middleware.py | Renames middleware TypeVars (context/update/options) used by layers and helpers. |
| python/packages/core/agent_framework/_clients.py | Renames client protocol/base client TypeVars (options, input, response model bound). |
| python/packages/core/agent_framework/_agents.py | Renames agent TypeVars (thread/options/response-model bound) used in agent typing/overloads. |
| python/packages/claude/agent_framework_claude/_agent.py | Renames agent options TypeVar and updates method signatures accordingly. |
| python/packages/bedrock/agent_framework_bedrock/_chat_client.py | Renames response/options TypeVars used by Bedrock chat client/options. |
| python/packages/azurefunctions/tests/test_entities.py | Renames test TypeVar used for decorator/function typing. |
| python/packages/azurefunctions/tests/test_app.py | Renames test TypeVar used for decorator/function typing. |
| python/packages/azure-ai/agent_framework_azure_ai/_project_provider.py | Renames provider options TypeVar for typed ChatAgent[...] returns. |
| python/packages/azure-ai/agent_framework_azure_ai/_client.py | Renames Azure AI client options TypeVar and updates derived generics. |
| python/packages/azure-ai/agent_framework_azure_ai/_chat_client.py | Renames Azure AI agent options TypeVar and updates as_agent typing. |
| python/packages/azure-ai/agent_framework_azure_ai/_agent_provider.py | Renames provider options TypeVar for typed ChatAgent[...] returns. |
| python/packages/anthropic/agent_framework_anthropic/_chat_client.py | Renames response/options TypeVars used by Anthropic client/options. |
| python/packages/ag-ui/tests/ag_ui/conftest.py | Updates AG-UI test stubs to use renamed options TypeVar. |
| python/packages/ag-ui/agent_framework_ag_ui_examples/agents/ui_generator_agent.py | Renames example options TypeVar used for agent factory typing. |
| python/packages/ag-ui/agent_framework_ag_ui/_types.py | Renames AG-UI options/response TypeVars used by AG-UI TypedDict options. |
| python/packages/ag-ui/agent_framework_ag_ui/_client.py | Renames client/options TypeVars and decorator TypeVar used by AG-UI client. |
python/packages/azure-ai/agent_framework_azure_ai/_project_provider.py
Outdated
Show resolved
Hide resolved
python/packages/core/agent_framework/openai/_assistant_provider.py
Outdated
Show resolved
Hide resolved
python/packages/azure-ai/agent_framework_azure_ai/_agent_provider.py
Outdated
Show resolved
Hide resolved
Member
dmytrostruk
approved these changes
Feb 10, 2026
markwallace-microsoft
approved these changes
Feb 10, 2026
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
Standardizes TypeVar naming across the Python codebase to use suffix
Tinstead of prefixT, aligning with common Python conventions.Notable renames
TResponseModelResponseModelTTResponseModelTResponseModelBoundTTAgentRunResponseAgentResponseTResolves #3594
Description
Contribution Checklist