From 71a22c36a850bedf32f2cb84469d6e450d7df8b6 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 1 May 2026 13:43:44 -0700 Subject: [PATCH] Emit SDK from TypeSpec and apply post-emitter fixes Rename AgentEndpoint to AgentEndpointConfig per TypeSpec commit f6fde1c. Updated samples to use the new model name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/CHANGELOG.md | 1 + .../azure-ai-projects/apiview-properties.json | 2 +- .../ai/projects/aio/operations/_operations.py | 8 +- .../azure/ai/projects/models/__init__.py | 4 +- .../azure/ai/projects/models/_models.py | 74 +++++++++---------- .../ai/projects/operations/_operations.py | 8 +- .../hosted_agents/sample_agent_endpoint.py | 4 +- .../sample_agent_endpoint_async.py | 4 +- .../sample_session_log_stream.py | 4 +- .../sample_session_log_stream_async.py | 4 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 11 files changed, 58 insertions(+), 57 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 833b46b1730f..1101a49c760b 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -11,6 +11,7 @@ ### Breaking Changes +* Renamed model `AgentEndpoint` to `AgentEndpointConfig`. * Agent Endpoint beta operations: Removed required parameters `user_isolation_key` and `chat_isolation_key` from the `HeaderIsolationKeySource` class constructor. ### Bugs Fixed diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 9f21416a6e7f..6e86a7e40fdc 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -14,8 +14,8 @@ "azure.ai.projects.models.AgentDataGenerationJobSource": "Azure.AI.Projects.AgentDataGenerationJobSource", "azure.ai.projects.models.AgentDefinition": "Azure.AI.Projects.AgentDefinition", "azure.ai.projects.models.AgentDetails": "Azure.AI.Projects.AgentObject", - "azure.ai.projects.models.AgentEndpoint": "Azure.AI.Projects.AgentEndpoint", "azure.ai.projects.models.AgentEndpointAuthorizationScheme": "Azure.AI.Projects.AgentEndpointAuthorizationScheme", + "azure.ai.projects.models.AgentEndpointConfig": "Azure.AI.Projects.AgentEndpointConfig", "azure.ai.projects.models.BaseCredentials": "Azure.AI.Projects.BaseCredentials", "azure.ai.projects.models.AgenticIdentityPreviewCredentials": "Azure.AI.Projects.AgenticIdentityPreviewCredentials", "azure.ai.projects.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py index 7b4599189e40..ad34ddfca6ee 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py @@ -3024,7 +3024,7 @@ async def patch_agent_details( agent_name: str, *, content_type: str = "application/merge-patch+json", - agent_endpoint: Optional[_models.AgentEndpoint] = None, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: @@ -3036,7 +3036,7 @@ async def patch_agent_details( Default value is "application/merge-patch+json". :paramtype content_type: str :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpoint + :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. :paramtype agent_card: ~azure.ai.projects.models.AgentCard :return: AgentDetails. The AgentDetails is compatible with MutableMapping @@ -3086,7 +3086,7 @@ async def patch_agent_details( agent_name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - agent_endpoint: Optional[_models.AgentEndpoint] = None, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: @@ -3097,7 +3097,7 @@ async def patch_agent_details( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpoint + :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. :paramtype agent_card: ~azure.ai.projects.models.AgentCard :return: AgentDetails. The AgentDetails is compatible with MutableMapping diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index f66fdf8d9c2d..5c6138dfc39a 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -24,8 +24,8 @@ AgentDataGenerationJobSource, AgentDefinition, AgentDetails, - AgentEndpoint, AgentEndpointAuthorizationScheme, + AgentEndpointConfig, AgentIdentity, AgentObjectVersions, AgentSessionResource, @@ -373,8 +373,8 @@ "AgentDataGenerationJobSource", "AgentDefinition", "AgentDetails", - "AgentEndpoint", "AgentEndpointAuthorizationScheme", + "AgentEndpointConfig", "AgentIdentity", "AgentObjectVersions", "AgentSessionResource", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 0d44bd63c458..ac9d267a7c9a 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -562,7 +562,7 @@ class AgentDetails(_Model): :ivar versions: The latest version of the agent. Required. :vartype versions: ~azure.ai.projects.models.AgentObjectVersions :ivar agent_endpoint: The endpoint configuration for the agent. - :vartype agent_endpoint: ~azure.ai.projects.models.AgentEndpoint + :vartype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :ivar instance_identity: The instance identity of the agent. :vartype instance_identity: ~azure.ai.projects.models.AgentIdentity :ivar blueprint: The blueprint for the agent. @@ -581,7 +581,7 @@ class AgentDetails(_Model): """The name of the agent. Required.""" versions: "_models.AgentObjectVersions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The latest version of the agent. Required.""" - agent_endpoint: Optional["_models.AgentEndpoint"] = rest_field( + agent_endpoint: Optional["_models.AgentEndpointConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The endpoint configuration for the agent.""" @@ -601,7 +601,7 @@ def __init__( id: str, # pylint: disable=redefined-builtin name: str, versions: "_models.AgentObjectVersions", - agent_endpoint: Optional["_models.AgentEndpoint"] = None, + agent_endpoint: Optional["_models.AgentEndpointConfig"] = None, agent_card: Optional["_models.AgentCard"] = None, ) -> None: ... @@ -616,8 +616,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEndpoint(_Model): - """AgentEndpoint. +class AgentEndpointAuthorizationScheme(_Model): + """AgentEndpointAuthorizationScheme. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + BotServiceAuthorizationScheme, BotServiceRbacAuthorizationScheme, EntraAuthorizationScheme + + :ivar type: Required. Known values are: "Entra", "BotService", and "BotServiceRbac". + :vartype type: str or ~azure.ai.projects.models.AgentEndpointAuthorizationSchemeType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"Entra\", \"BotService\", and \"BotServiceRbac\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentEndpointConfig(_Model): + """AgentEndpointConfig. :ivar version_selector: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent. @@ -663,38 +695,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEndpointAuthorizationScheme(_Model): - """AgentEndpointAuthorizationScheme. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - BotServiceAuthorizationScheme, BotServiceRbacAuthorizationScheme, EntraAuthorizationScheme - - :ivar type: Required. Known values are: "Entra", "BotService", and "BotServiceRbac". - :vartype type: str or ~azure.ai.projects.models.AgentEndpointAuthorizationSchemeType - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"Entra\", \"BotService\", and \"BotServiceRbac\".""" - - @overload - def __init__( - self, - *, - type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class BaseCredentials(_Model): """A base class for connection credentials. diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index 1ec22a499d99..4efec342c7dd 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py @@ -5329,7 +5329,7 @@ def patch_agent_details( agent_name: str, *, content_type: str = "application/merge-patch+json", - agent_endpoint: Optional[_models.AgentEndpoint] = None, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: @@ -5341,7 +5341,7 @@ def patch_agent_details( Default value is "application/merge-patch+json". :paramtype content_type: str :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpoint + :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. :paramtype agent_card: ~azure.ai.projects.models.AgentCard :return: AgentDetails. The AgentDetails is compatible with MutableMapping @@ -5391,7 +5391,7 @@ def patch_agent_details( agent_name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - agent_endpoint: Optional[_models.AgentEndpoint] = None, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: @@ -5402,7 +5402,7 @@ def patch_agent_details( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpoint + :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. :paramtype agent_card: ~azure.ai.projects.models.AgentCard :return: AgentDetails. The AgentDetails is compatible with MutableMapping diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint.py index 0cec991be41e..f66709fd951a 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint.py @@ -41,7 +41,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - AgentEndpoint, + AgentEndpointConfig, AgentEndpointProtocol, FixedRatioVersionSelectionRule, VersionSelector, @@ -74,7 +74,7 @@ try: # Configure endpoint routing so this agent name serves the created version. # 100% of traffic is routed to the single created version. - endpoint_config = AgentEndpoint( + endpoint_config = AgentEndpointConfig( version_selector=VersionSelector( version_selection_rules=[ FixedRatioVersionSelectionRule(agent_version=agent.version, traffic_percentage=100), diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint_async.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint_async.py index 52b34572bdc5..937ec3330194 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint_async.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_endpoint_async.py @@ -42,7 +42,7 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( - AgentEndpoint, + AgentEndpointConfig, AgentEndpointProtocol, FixedRatioVersionSelectionRule, VersionSelector, @@ -77,7 +77,7 @@ async def main(): try: # Configure endpoint routing so this agent name serves the created version. # 100% of traffic is routed to the single created version. - endpoint_config = AgentEndpoint( + endpoint_config = AgentEndpointConfig( version_selector=VersionSelector( version_selection_rules=[ FixedRatioVersionSelectionRule(agent_version=agent.version, traffic_percentage=100), diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py index 19acc60edbe5..19ac93f01433 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py @@ -44,7 +44,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - AgentEndpoint, + AgentEndpointConfig, AgentEndpointProtocol, FixedRatioVersionSelectionRule, VersionSelector, @@ -104,7 +104,7 @@ def _iter_sse_frames(stream, max_log_events: int): ) print(f"Session created (id: {session.agent_session_id}, status: {session.status})") try: - endpoint_config = AgentEndpoint( + endpoint_config = AgentEndpointConfig( version_selector=VersionSelector( version_selection_rules=[ FixedRatioVersionSelectionRule(agent_version=agent.version, traffic_percentage=100), diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py index 99dac073014b..4f7ab756f95a 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py @@ -45,7 +45,7 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( - AgentEndpoint, + AgentEndpointConfig, AgentEndpointProtocol, FixedRatioVersionSelectionRule, VersionSelector, @@ -134,7 +134,7 @@ async def main(): ) print(f"Session created (id: {session.agent_session_id}, status: {session.status})") try: - endpoint_config = AgentEndpoint( + endpoint_config = AgentEndpointConfig( version_selector=VersionSelector( version_selection_rules=[ FixedRatioVersionSelectionRule(agent_version=agent.version, traffic_percentage=100), diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 373475fda3d1..6026a90f523c 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai-foundry/data-plane/Foundry -commit: 98a44e0fa3d9317725a8fad6e2903fb1787dbbf3 +commit: f6fde1c197adf274a4b344ea27ec26490841ab68 repo: Azure/azure-rest-api-specs additionalDirectories: