Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"apiVersion": "2025-05-15-preview"
"apiVersion": "2025-11-15-preview",
"commit": "d8f039ebd965e40471a082c547b103dd5dc9a33b",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/cognitiveservices/data-plane/LanguageAnalyzeConversationsAuthoring",
"emitterVersion": "0.53.1"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"CrossLanguagePackageId": "Language.Conversations.Authoring",
"CrossLanguageDefinitionId": {
"azure.ai.language.conversations.authoring.models.AssignedDeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedDeploymentResource",
"azure.ai.language.conversations.authoring.models.AssignedDeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourceInfo",
"azure.ai.language.conversations.authoring.models.AssignedProjectDeploymentMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata",
"azure.ai.language.conversations.authoring.models.AssignedProjectDeploymentsMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata",
"azure.ai.language.conversations.authoring.models.ConfusionMatrixCell": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrixCell",
"azure.ai.language.conversations.authoring.models.ConfusionMatrixRow": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrixRow",
"azure.ai.language.conversations.authoring.models.CreateProjectOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCreateProjectOptions",
"azure.ai.language.conversations.authoring.models.DataGenerationConnectionInfo": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDataGenerationConnectionInfo",
"azure.ai.language.conversations.authoring.models.DeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentResource",
"azure.ai.language.conversations.authoring.models.EntitiesEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEntitiesEvaluationSummary",
"azure.ai.language.conversations.authoring.models.EntityEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEntityEvaluationSummary",
"azure.ai.language.conversations.authoring.models.EvalSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationSummary",
Expand All @@ -32,7 +30,6 @@
"azure.ai.language.conversations.authoring.models.UtteranceIntentsEvaluationResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult",
"azure.ai.language.conversations.authoring.models.ProjectKind": "Language.Conversations.Authoring.ProjectKind",
"azure.ai.language.conversations.authoring.models.OperationStatus": "Language.Conversations.Authoring.JobStatus",
"azure.ai.language.conversations.authoring.models.DataGenerationConnectionKind": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDataGenerationConnectionKind",
"azure.ai.language.conversations.authoring.models.TrainingMode": "Language.Conversations.Authoring.TrainingMode",
"azure.ai.language.conversations.authoring.models.StringIndexType": "Language.Conversations.Authoring.StringIndexType",
"azure.ai.language.conversations.authoring.models.EvaluationKind": "Language.Conversations.Authoring.EvaluationKind",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ConversationAuthoringClient(_ConversationAuthoringClientOperationsMixin):
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword api_version: The API version to use for this operation. Default value is
"2025-05-15-preview". Note that overriding this default value may result in unsupported
"2025-11-15-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""
Expand Down Expand Up @@ -132,7 +132,7 @@ class ConversationAuthoringProjectClient:
:param project_name: Required.
:type project_name: str
:keyword api_version: The API version to use for this operation. Default value is
"2025-05-15-preview". Note that overriding this default value may result in unsupported
"2025-11-15-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -169,10 +169,10 @@ def __init__(
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.deployment = DeploymentOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long
self.project = ProjectOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long
self.exported_model = ExportedModelOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long
self.trained_model = TrainedModelOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long
self.deployment = DeploymentOperations(self._client, self._config, self._serialize, self._deserialize)
self.project = ProjectOperations(self._client, self._config, self._serialize, self._deserialize)
self.exported_model = ExportedModelOperations(self._client, self._config, self._serialize, self._deserialize)
self.trained_model = TrainedModelOperations(self._client, self._config, self._serialize, self._deserialize)

def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class ConversationAuthoringClientConfiguration: # pylint: disable=too-many-inst
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword api_version: The API version to use for this operation. Default value is
"2025-05-15-preview". Note that overriding this default value may result in unsupported
"2025-11-15-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2025-05-15-preview")
api_version: str = kwargs.pop("api_version", "2025-11-15-preview")

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand Down Expand Up @@ -89,15 +89,15 @@ class ConversationAuthoringProjectClientConfiguration: # pylint: disable=too-ma
:param project_name: Required.
:type project_name: str
:keyword api_version: The API version to use for this operation. Default value is
"2025-05-15-preview". Note that overriding this default value may result in unsupported
"2025-11-15-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""

def __init__(
self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], project_name: str, **kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2025-05-15-preview")
api_version: str = kwargs.pop("api_version", "2025-11-15-preview")

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# pylint: disable=line-too-long,useless-suppression
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
Expand All @@ -8,169 +7,9 @@

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from collections.abc import MutableMapping # pylint:disable=import-error
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, TypeVar, Union

from azure.core import PipelineClient
from azure.core.credentials import AzureKeyCredential
from azure.core.pipeline import PipelineResponse, policies
from azure.core.polling import LROPoller
from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace

from ._client import (
ConversationAuthoringClient as AuthoringClientGenerated,
ConversationAuthoringProjectClient as AuthoringProjectClientGenerated,
)
from ._configuration import ConversationAuthoringProjectClientConfiguration
from ._utils.serialization import Deserializer, Serializer
from .operations._patch import (
DeploymentOperations,
ExportedModelOperations,
ProjectOperations,
TrainedModelOperations,
)

if TYPE_CHECKING:
from azure.core.credentials import TokenCredential

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[
Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]
]

class ConversationAuthoringProjectClient(AuthoringProjectClientGenerated):

#: Deployment operations group
deployment: DeploymentOperations
#: Exported model operations group
exported_model: ExportedModelOperations
#: Project operations group
project: ProjectOperations
#: Trained model operations group
trained_model: TrainedModelOperations

def __init__( # pylint: disable=super-init-not-called
self,
endpoint: str,
credential: Union[AzureKeyCredential, "TokenCredential"],
*,
api_version: Optional[str] = None,
project_name: str,
**kwargs: Any,
) -> None:
"""
Initialize a ConversationAuthoringProjectClient.

:param str endpoint: Supported Cognitive Services endpoint, e.g.
``https://<resource>.cognitiveservices.azure.com``.
:param credential: Credential used to authenticate requests to the service.
:type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential
:keyword str api_version: The API version to use for this operation.
Default value is ``2025-05-15-preview``.
Note that overriding this default value may result in unsupported behavior.
:keyword str project_name: The name of the project to scope operations. **Required**.
"""
self._project_name = project_name
_endpoint = f"{endpoint}/language"

if api_version is not None:
kwargs["api_version"] = api_version

# Build configuration
self._config = ConversationAuthoringProjectClientConfiguration(
endpoint=endpoint, credential=credential, project_name=project_name, **kwargs
)

# Build policies
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]

# Build pipeline client
self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs)

# Setup serializers
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False

# Assign patched operation groups with project_name
self.deployment = DeploymentOperations(
self._client, self._config, self._serialize, self._deserialize, project_name=project_name
)
self.project = ProjectOperations(
self._client, self._config, self._serialize, self._deserialize, project_name=project_name
)
self.exported_model = ExportedModelOperations(
self._client, self._config, self._serialize, self._deserialize, project_name=project_name
)
self.trained_model = TrainedModelOperations(
self._client, self._config, self._serialize, self._deserialize, project_name=project_name
)


class ConversationAuthoringClient(AuthoringClientGenerated):

def __init__(
self,
endpoint: str,
credential: Union[AzureKeyCredential, "TokenCredential"],
*,
api_version: Optional[str] = None,
**kwargs: Any,
) -> None:
"""
Create a ConversationAuthoringClient.

:param str endpoint: Supported Cognitive Services endpoint, e.g.
``https://<resource-name>.api.cognitiveservices.azure.com``.
:param credential: Key or token credential.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword str api_version: The API version to use for this operation.
Default value is ``2025-05-15-preview``.
Note that overriding this default value may result in unsupported behavior.
"""
if api_version is not None:
kwargs["api_version"] = api_version
super().__init__(endpoint=endpoint, credential=credential, **kwargs)

def get_project_client(self, project_name: str) -> ConversationAuthoringProjectClient:
return ConversationAuthoringProjectClient(
endpoint=self._config.endpoint,
credential=self._config.credential,
project_name=project_name,
)

@distributed_trace
def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[None]: # pylint: disable=delete-operation-wrong-return-type
"""Deletes a project.

:param project_name: The name of the project to delete. Required.
:type project_name: str
:return: An instance of LROPoller that returns None
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
return super()._begin_delete_project(
project_name=project_name, **kwargs
)
__all__: list[str] = [] # Add all objects you want publicly available to users at this package level


def patch_sdk():
Expand All @@ -180,6 +19,3 @@ def patch_sdk():
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""


__all__ = ["ConversationAuthoringProjectClient", "ConversationAuthoringClient"]
Loading
Loading