Skip to content

Deprecation warning for using old class named AgentEndpoint (instead of new one AgentEndpoingConfig)#46658

Open
dargilco wants to merge 7 commits intofeature/azure-ai-projects/2.2.0from
dargilco/deprecation-notice-agent-endpoint-class
Open

Deprecation warning for using old class named AgentEndpoint (instead of new one AgentEndpoingConfig)#46658
dargilco wants to merge 7 commits intofeature/azure-ai-projects/2.2.0from
dargilco/deprecation-notice-agent-endpoint-class

Conversation

@dargilco
Copy link
Copy Markdown
Member

@dargilco dargilco commented May 1, 2026

With this PR, old code that imports AgentEndpoint will still work but will get a warning message during import (not during construction).

>>> from azure.ai.projects.models import AgentEndpointConfig, AgentEndpointProtocol

>>> config1 = AgentEndpointConfig(protocols=[AgentEndpointProtocol.A2A])

>>> print(config1.protocols)
[<AgentEndpointProtocol.A2A: 'a2a'>]

>>> from azure.ai.projects.models import AgentEndpoint
<python-input-5>:1: DeprecationWarning: 'AgentEndpoint' is deprecated and will be removed in the next release. Use 'AgentEndpointConfig' instead.

>>> config2 = AgentEndpoint(protocols=[AgentEndpointProtocol.A2A])

>>> print(config2.protocols)
[<AgentEndpointProtocol.A2A: 'a2a'>]

>>>

Copilot AI review requested due to automatic review settings May 1, 2026 00:56
@dargilco dargilco self-assigned this May 1, 2026
@dargilco dargilco changed the base branch from main to feature/azure-ai-projects/2.2.0 May 1, 2026 00:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a deprecation path for the AgentEndpoint model by renaming the canonical model to AgentEndpointConfig, updating the public API typing/docs accordingly, and adding a deprecated AgentEndpoint alias that emits a DeprecationWarning while preserving functionality.

Changes:

  • Rename the generated model type AgentEndpoint to AgentEndpointConfig and update patch_agent_details type hints/docstrings (sync + async).
  • Add a deprecated AgentEndpoint alias (subclass) in models/_patch.py that emits a DeprecationWarning on instantiation.
  • Update hosted agents samples to use AgentEndpointConfig and add deprecation-focused tests.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
sdk/ai/azure-ai-projects/tests/deprecation/test_agent_endpoint_deprecation.py Adds tests validating deprecation warning behavior and backward-compatible functionality.
sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py Updates sample imports/usage to AgentEndpointConfig.
sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py Updates sample imports/usage to AgentEndpointConfig.
sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint_async.py Updates sample imports/usage to AgentEndpointConfig.
sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint.py Updates sample imports/usage to AgentEndpointConfig.
sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py Updates patch_agent_details signature/doc typing to AgentEndpointConfig.
sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py Introduces deprecated AgentEndpoint alias class with warning emission.
sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py Renames the generated model class to AgentEndpointConfig and updates references.
sdk/ai/azure-ai-projects/azure/ai/projects/models/init.py Switches the primary exported symbol to AgentEndpointConfig (with patched exports still available).
sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py Updates async patch_agent_details signature/doc typing to AgentEndpointConfig.
sdk/ai/azure-ai-projects/apiview-properties.json Updates APIView cross-language mapping to the new model name.

Comment thread sdk/ai/azure-ai-projects/apiview-properties.json
Comment thread sdk/ai/azure-ai-projects/tests/deprecation/test_agent_endpoint_deprecation.py Outdated
Comment thread sdk/ai/azure-ai-projects/tests/deprecation/test_agent_endpoint_deprecation.py Outdated
Comment thread sdk/ai/azure-ai-projects/tests/deprecation/test_agent_endpoint_deprecation.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants