Skip to content

Commit dff4df0

Browse files
[py sdk - Conv Authoring] a new release to add GA compatibility (#44323)
* Configurations: 'specification/cognitiveservices/data-plane/LanguageAnalyzeConversationsAuthoring/tspconfig.yaml', API Version: 2025-11-15-preview, SDK Release Type: beta, and CommitSHA: '2fc7fcc9a50bcea5b3dd9307b80f09c440e385bb' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5648533 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * add first version patch * add some patch files * added compatibility and tests for it * adjust samples * updated readme versions * updated changelog * updated tag in assets.json * fixed pylint * update docstring * fix docstring --------- Co-authored-by: azure-sdk <[email protected]>
1 parent b044d59 commit dff4df0

File tree

25 files changed

+434
-104
lines changed

25 files changed

+434
-104
lines changed

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Release History
22

3+
## 1.0.0b3 (2025-12-09)
4+
5+
### Features Added
6+
- Added support for service version 2025-11-01.
7+
8+
### Other Changes
9+
- Updated deployment samples (sync and async) to demonstrate usage with both 2025-11-01 (GA) and 2025-11-15-preview service versions.
10+
311
## 1.0.0b2 (2025-11-14)
412

513
### Features Added

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ pip install azure-ai-language-conversations-authoring
3636

3737
> Note: This version of the client library defaults to the 2025-11-15-preview version of the service
3838
39+
This table shows the relationship between SDK versions and supported API versions of the service
40+
41+
| SDK version | Supported API version of service |
42+
| ------------ | --------------------------------- |
43+
| 1.0.0b3 - Latest preview release | 2023-04-01, 2025-11-01, 2025-05-15-preview, 2025-11-15-preview (default) |
44+
| 1.0.0b2 | 2023-04-01, 2025-05-15-preview, 2025-11-15-preview (default) |
45+
| 1.0.0b1 | 2023-04-01, 2024-11-15-preview, 2025-05-15-preview (default) |
46+
3947
### Authenticate the client
4048

4149
To interact with the Conversation Authoring service, you'll need to create an instance of the `ConversationAuthoringClient`. You will need an **endpoint** and an **API key** to instantiate a client object. For more information regarding authenticating with Cognitive Services, see [Authenticate requests to Azure Cognitive Services][cognitive_auth].

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"azure.ai.language.conversations.authoring.models.DataGenerationConnectionInfo": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDataGenerationConnectionInfo",
2121
"azure.ai.language.conversations.authoring.models.DataGenerationSettings": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDataGenerationSettings",
2222
"azure.ai.language.conversations.authoring.models.DeploymentDeleteFromResourcesState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState",
23-
"azure.ai.language.conversations.authoring.models.DeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentResource",
2423
"azure.ai.language.conversations.authoring.models.DeploymentState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentJobState",
2524
"azure.ai.language.conversations.authoring.models.EntitiesEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEntitiesEvaluationSummary",
2625
"azure.ai.language.conversations.authoring.models.EntityEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEntityEvaluationSummary",
@@ -99,12 +98,6 @@
9998
"azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.create_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.createProject",
10099
"azure.ai.language.conversations.authoring.ConversationAuthoringClient.get_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getProject",
101100
"azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.get_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getProject",
102-
"azure.ai.language.conversations.authoring.ConversationAuthoringClient.begin_delete_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.deleteProject",
103-
"azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.begin_delete_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.deleteProject",
104-
"azure.ai.language.conversations.authoring.ConversationAuthoringClient.get_export_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getExportStatus",
105-
"azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.get_export_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getExportStatus",
106-
"azure.ai.language.conversations.authoring.ConversationAuthoringClient.get_import_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getImportStatus",
107-
"azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.get_import_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getImportStatus",
108101
"azure.ai.language.conversations.authoring.operations.DeploymentOperations.get_deployment": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.getDeployment",
109102
"azure.ai.language.conversations.authoring.aio.operations.DeploymentOperations.get_deployment": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.getDeployment",
110103
"azure.ai.language.conversations.authoring.operations.DeploymentOperations.begin_deploy_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.deployProject",

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/cognitivelanguage/azure-ai-language-conversations-authoring",
5-
"Tag": "python/cognitivelanguage/azure-ai-language-conversations-authoring_20102747af"
5+
"Tag": "python/cognitivelanguage/azure-ai-language-conversations-authoring_94c35e32fe"
66
}

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class ConversationAuthoringClient(_ConversationAuthoringClientOperationsMixin):
4343
"2025-11-15-preview". Note that overriding this default value may result in unsupported
4444
behavior.
4545
:paramtype api_version: str
46-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
47-
Retry-After header is present.
4846
"""
4947

5048
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def get_project_client(self, project_name: str) -> ConversationAuthoringProjectC
8484
endpoint=self._config.endpoint,
8585
credential=self._config.credential,
8686
project_name=project_name,
87+
api_version=self._config.api_version,
8788
)
8889

8990

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0b2"
9+
VERSION = "1.0.0b3"

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class ConversationAuthoringClient(_ConversationAuthoringClientOperationsMixin):
4343
"2025-11-15-preview". Note that overriding this default value may result in unsupported
4444
behavior.
4545
:paramtype api_version: str
46-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
47-
Retry-After header is present.
4846
"""
4947

5048
def __init__(

sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def get_project_client(self, project_name: str) -> ConversationAuthoringProjectC
8484
endpoint=self._config.endpoint,
8585
credential=self._config.credential,
8686
project_name=project_name,
87+
api_version=self._config.api_version,
8788
)
8889

8990

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# pylint: disable=line-too-long,useless-suppression
2+
# coding=utf-8
3+
# --------------------------------------------------------------------------
4+
# Copyright (c) Microsoft Corporation. All rights reserved.
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# --------------------------------------------------------------------------
7+
"""Customize generated code here.
8+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
9+
"""
10+
11+
from typing import Any, Optional, Union
12+
13+
from azure.core.polling import AsyncLROPoller
14+
from azure.core.tracing.decorator import distributed_trace
15+
16+
from ._operations import DeploymentOperations as _GeneratedDeploymentOperations, JSON
17+
from ...models import CreateDeploymentDetails
18+
19+
20+
class DeploymentOperations(_GeneratedDeploymentOperations):
21+
"""Deployment operations that handle both:
22+
- 2025-11-15-preview: azureResourceIds = List[AssignedProjectResource]
23+
- 2025-11-01: azureResourceIds = List[str]
24+
"""
25+
26+
@distributed_trace
27+
async def begin_deploy_project( # type: ignore[override]
28+
self,
29+
deployment_name: str,
30+
body: Union[CreateDeploymentDetails, JSON, Any],
31+
**kwargs: Any,
32+
) -> AsyncLROPoller[None]:
33+
api_version: Optional[str] = getattr(self._config, "api_version", None)
34+
35+
if not isinstance(body, CreateDeploymentDetails):
36+
return await super().begin_deploy_project(
37+
deployment_name=deployment_name,
38+
body=body,
39+
**kwargs,
40+
)
41+
42+
# If no api_version or preview → use preview shape
43+
if api_version in (None, "2025-11-15-preview"):
44+
# For preview, we require assigned resources, because region is needed.
45+
if body.azure_resource_ids is None:
46+
# user tried to use GA-style strings but preview needs region
47+
if getattr(body, "_azure_resource_ids_strings", None):
48+
raise ValueError(
49+
"For api_version '2025-11-15-preview', azure_resource_ids must "
50+
"be a list of AssignedProjectResource (with region), not plain strings."
51+
)
52+
# Just send the model as-is
53+
return await super().begin_deploy_project(
54+
deployment_name=deployment_name,
55+
body=body,
56+
**kwargs,
57+
)
58+
59+
# GA 2025-11-01 → azureResourceIds is List[str]
60+
if api_version == "2025-11-01":
61+
trained_model_label = body.trained_model_label
62+
63+
# Prefer GA-style strings if user gave them
64+
str_ids = getattr(body, "_azure_resource_ids_strings", None)
65+
if str_ids is not None:
66+
azure_ids = str_ids
67+
else:
68+
# Otherwise derive from AssignedProjectResource list
69+
azure_ids = None
70+
if body.azure_resource_ids is not None:
71+
azure_ids = [r.resource_id for r in body.azure_resource_ids]
72+
73+
json_body: JSON = {"trainedModelLabel": trained_model_label}
74+
if azure_ids is not None:
75+
json_body["azureResourceIds"] = azure_ids
76+
77+
return await super().begin_deploy_project(
78+
deployment_name=deployment_name,
79+
body=json_body, # GA wire
80+
**kwargs,
81+
)
82+
83+
# Any other version: fall back to default behavior
84+
return await super().begin_deploy_project(
85+
deployment_name=deployment_name,
86+
body=body,
87+
**kwargs,
88+
)

0 commit comments

Comments
 (0)