From c67b13b589c0c3265a72c2332a16d9ad5a8dae30 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Wed, 14 Sep 2022 16:14:20 -0700 Subject: [PATCH 1/7] regenerate on 2022-10-01-preview for CLU runtime --- .../ai/language/conversations/_client.py | 2 +- .../language/conversations/_configuration.py | 4 +- .../conversations/_operations/_operations.py | 294 +++-- .../conversations/_operations/_patch.py | 58 +- .../azure/ai/language/conversations/_patch.py | 16 +- .../language/conversations/_serialization.py | 2 +- .../ai/language/conversations/aio/_client.py | 2 +- .../conversations/aio/_configuration.py | 4 +- .../aio/_operations/_operations.py | 290 ++++- .../conversations/aio/_operations/_patch.py | 62 +- .../ai/language/conversations/aio/_patch.py | 16 +- .../authoring/_operations/_operations.py | 1156 ++++++++++------- .../authoring/_operations/_patch.py | 92 +- .../conversations/authoring/_patch.py | 11 +- .../conversations/authoring/_serialization.py | 2 +- .../conversations/authoring/_version.py | 2 +- .../authoring/aio/_operations/_operations.py | 1151 +++++++++------- .../authoring/aio/_operations/_patch.py | 94 +- .../conversations/authoring/aio/_patch.py | 11 +- .../swagger/README.md | 4 +- 20 files changed, 2029 insertions(+), 1244 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_client.py index 8a8993923eef..27b0f943a026 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_client.py @@ -42,7 +42,7 @@ class ConversationAnalysisClient( :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-10-01-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 diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_configuration.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_configuration.py index 8374755f7f32..97905670824c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_configuration.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_configuration.py @@ -29,14 +29,14 @@ class ConversationAnalysisClientConfiguration(Configuration): # pylint: disable :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: super(ConversationAnalysisClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-05-15-preview") # type: str + api_version = kwargs.pop("api_version", "2022-10-01-preview") # type: str if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py index 59ffe68d267d..7b345a8b7492 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -44,7 +45,7 @@ def build_analyze_conversation_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +67,7 @@ def build_conversation_analysis_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,12 +109,12 @@ def analyze_conversation(self, task: JSON, *, content_type: str = "application/j "analysisInput": { "conversationItem": { "id": "str", # The ID of a conversation item. Required. + "participantId": "str", # The participant ID of a + conversation item. Required. "language": "str", # Optional. The override language of a conversation item in BCP 47 language representation. "modality": "str", # Optional. Enumeration of supported conversational modalities. Known values are: "transcript" and "text". - "participantId": "str", # The participant ID of a - conversation item. Required. "role": "str" # Optional. The role of the participant. Known values are: "agent", "customer", and "generic". } @@ -122,11 +123,11 @@ def analyze_conversation(self, task: JSON, *, content_type: str = "application/j "parameters": { "deploymentName": "str", # The name of the deployment to use. Required. + "projectName": "str", # The name of the project to use. Required. "directTarget": "str", # Optional. The name of a target project to forward the request to. "isLoggingEnabled": bool, # Optional. If true, the service will keep the query for further review. - "projectName": "str", # The name of the project to use. Required. "stringIndexType": "TextElements_v8", # Optional. Default value is "TextElements_v8". Specifies the method used to interpret string offsets. Set to "UnicodeCodePoint" for Python strings. Known values are: @@ -148,14 +149,53 @@ def analyze_conversation(self, task: JSON, *, content_type: str = "application/j analyze_conversation_task_result = { "kind": "ConversationResult", "result": { - "detectedLanguage": "str", # Optional. The system detected language - for the query in BCP 47 language representation.. "prediction": base_prediction, - "query": "str" # The conversation utterance given by the caller. + "query": "str", # The conversation utterance given by the caller. Required. + "detectedLanguage": "str" # Optional. The system detected language + for the query in BCP 47 language representation.. } } + # JSON input template for discriminator value "Conversation": + base_prediction = { + "entities": [ + { + "category": "str", # The entity category. Required. + "confidenceScore": 0.0, # The entity confidence score. + Required. + "length": 0, # The length of the text. Required. + "offset": 0, # The starting index of this entity in the + query. Required. + "text": "str", # The predicted entity text. Required. + "extraInformation": [ + base_extra_information + ], + "resolutions": [ + base_resolution + ] + } + ], + "intents": [ + { + "category": "str", # A predicted class. Required. + "confidenceScore": 0.0 # The confidence score of the class + from 0.0 to 1.0. Required. + } + ], + "projectKind": "Conversation", + "topIntent": "str" # Optional. The intent with the highest score. + } + + # JSON input template for discriminator value "Orchestration": + base_prediction = { + "intents": { + "str": target_intent_result + }, + "projectKind": "Orchestration", + "topIntent": "str" # Optional. The intent with the highest score. + } + # response body for status code(s): 200 response == analyze_conversation_task_result """ @@ -182,14 +222,53 @@ def analyze_conversation(self, task: IO, *, content_type: str = "application/jso analyze_conversation_task_result = { "kind": "ConversationResult", "result": { - "detectedLanguage": "str", # Optional. The system detected language - for the query in BCP 47 language representation.. "prediction": base_prediction, - "query": "str" # The conversation utterance given by the caller. + "query": "str", # The conversation utterance given by the caller. Required. + "detectedLanguage": "str" # Optional. The system detected language + for the query in BCP 47 language representation.. } } + # JSON input template for discriminator value "Conversation": + base_prediction = { + "entities": [ + { + "category": "str", # The entity category. Required. + "confidenceScore": 0.0, # The entity confidence score. + Required. + "length": 0, # The length of the text. Required. + "offset": 0, # The starting index of this entity in the + query. Required. + "text": "str", # The predicted entity text. Required. + "extraInformation": [ + base_extra_information + ], + "resolutions": [ + base_resolution + ] + } + ], + "intents": [ + { + "category": "str", # A predicted class. Required. + "confidenceScore": 0.0 # The confidence score of the class + from 0.0 to 1.0. Required. + } + ], + "projectKind": "Conversation", + "topIntent": "str" # Optional. The intent with the highest score. + } + + # JSON input template for discriminator value "Orchestration": + base_prediction = { + "intents": { + "str": target_intent_result + }, + "projectKind": "Orchestration", + "topIntent": "str" # Optional. The intent with the highest score. + } + # response body for status code(s): 200 response == analyze_conversation_task_result """ @@ -217,18 +296,62 @@ def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JSON: analyze_conversation_task_result = { "kind": "ConversationResult", "result": { - "detectedLanguage": "str", # Optional. The system detected language - for the query in BCP 47 language representation.. "prediction": base_prediction, - "query": "str" # The conversation utterance given by the caller. + "query": "str", # The conversation utterance given by the caller. Required. + "detectedLanguage": "str" # Optional. The system detected language + for the query in BCP 47 language representation.. } } + # JSON input template for discriminator value "Conversation": + base_prediction = { + "entities": [ + { + "category": "str", # The entity category. Required. + "confidenceScore": 0.0, # The entity confidence score. + Required. + "length": 0, # The length of the text. Required. + "offset": 0, # The starting index of this entity in the + query. Required. + "text": "str", # The predicted entity text. Required. + "extraInformation": [ + base_extra_information + ], + "resolutions": [ + base_resolution + ] + } + ], + "intents": [ + { + "category": "str", # A predicted class. Required. + "confidenceScore": 0.0 # The confidence score of the class + from 0.0 to 1.0. Required. + } + ], + "projectKind": "Conversation", + "topIntent": "str" # Optional. The intent with the highest score. + } + + # JSON input template for discriminator value "Orchestration": + base_prediction = { + "intents": { + "str": target_intent_result + }, + "projectKind": "Orchestration", + "topIntent": "str" # Optional. The intent with the highest score. + } + # response body for status code(s): 200 response == analyze_conversation_task_result """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -279,7 +402,12 @@ def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JSON: return cast(JSON, deserialized) def _conversation_analysis_initial(self, task: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -373,16 +501,29 @@ def begin_conversation_analysis( conversation ] }, - "displayName": "str", # Optional. Optional display name for the analysis - job. "tasks": [ analyze_conversation_lro_task - ] + ], + "displayName": "str" # Optional. Optional display name for the analysis job. } # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Required. + "jobId": "str", # Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. + "status": "str", # Required. Known values are: "notStarted", "running", + "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "tasks": { + "completed": 0, # Count of tasks completed successfully. Required. + "failed": 0, # Count of tasks that failed. Required. + "inProgress": 0, # Count of tasks in progress currently. Required. + "total": 0, # Total count of tasks submitted as part of the job. + Required. + "items": [ + analyze_conversation_job_result + ] + }, "displayName": "str", # Optional. "errors": [ { @@ -395,6 +536,8 @@ def begin_conversation_analysis( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -407,45 +550,36 @@ def begin_conversation_analysis( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. - "jobId": "str", # Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. "nextLink": "str", # Optional. "statistics": { "conversationsCount": 0, # Number of conversations submitted in the request. Required. + "documentsCount": 0, # Number of documents submitted in the request. + Required. "erroneousConversationsCount": 0, # Number of invalid documents. This includes empty, over-size limit or non-supported languages documents. Required. + "erroneousDocumentsCount": 0, # Number of invalid documents. This + includes empty, over-size limit or non-supported languages documents. + Required. "transactionsCount": 0, # Number of transactions for the request. Required. - "validConversationsCount": 0 # Number of conversations documents. + "validConversationsCount": 0, # Number of conversations documents. This excludes empty, over-size limit or non-supported languages documents. Required. - }, - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". - "tasks": { - "completed": 0, # Count of tasks completed successfully. Required. - "failed": 0, # Count of tasks that failed. Required. - "inProgress": 0, # Count of tasks in progress currently. Required. - "items": [ - analyze_conversation_job_result - ], - "total": 0 # Total count of tasks submitted as part of the job. - Required. + "validDocumentsCount": 0 # Number of valid documents. This excludes + empty, over-size limit or non-supported languages documents. Required. } } """ @@ -482,6 +616,20 @@ def begin_conversation_analysis( # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Required. + "jobId": "str", # Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. + "status": "str", # Required. Known values are: "notStarted", "running", + "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "tasks": { + "completed": 0, # Count of tasks completed successfully. Required. + "failed": 0, # Count of tasks that failed. Required. + "inProgress": 0, # Count of tasks in progress currently. Required. + "total": 0, # Total count of tasks submitted as part of the job. + Required. + "items": [ + analyze_conversation_job_result + ] + }, "displayName": "str", # Optional. "errors": [ { @@ -494,6 +642,8 @@ def begin_conversation_analysis( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -506,45 +656,36 @@ def begin_conversation_analysis( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. - "jobId": "str", # Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. "nextLink": "str", # Optional. "statistics": { "conversationsCount": 0, # Number of conversations submitted in the request. Required. + "documentsCount": 0, # Number of documents submitted in the request. + Required. "erroneousConversationsCount": 0, # Number of invalid documents. This includes empty, over-size limit or non-supported languages documents. Required. + "erroneousDocumentsCount": 0, # Number of invalid documents. This + includes empty, over-size limit or non-supported languages documents. + Required. "transactionsCount": 0, # Number of transactions for the request. Required. - "validConversationsCount": 0 # Number of conversations documents. + "validConversationsCount": 0, # Number of conversations documents. This excludes empty, over-size limit or non-supported languages documents. Required. - }, - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". - "tasks": { - "completed": 0, # Count of tasks completed successfully. Required. - "failed": 0, # Count of tasks that failed. Required. - "inProgress": 0, # Count of tasks in progress currently. Required. - "items": [ - analyze_conversation_job_result - ], - "total": 0 # Total count of tasks submitted as part of the job. - Required. + "validDocumentsCount": 0 # Number of valid documents. This excludes + empty, over-size limit or non-supported languages documents. Required. } } """ @@ -579,6 +720,20 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Required. + "jobId": "str", # Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. + "status": "str", # Required. Known values are: "notStarted", "running", + "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "tasks": { + "completed": 0, # Count of tasks completed successfully. Required. + "failed": 0, # Count of tasks that failed. Required. + "inProgress": 0, # Count of tasks in progress currently. Required. + "total": 0, # Total count of tasks submitted as part of the job. + Required. + "items": [ + analyze_conversation_job_result + ] + }, "displayName": "str", # Optional. "errors": [ { @@ -591,6 +746,8 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -603,45 +760,36 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. - "jobId": "str", # Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. "nextLink": "str", # Optional. "statistics": { "conversationsCount": 0, # Number of conversations submitted in the request. Required. + "documentsCount": 0, # Number of documents submitted in the request. + Required. "erroneousConversationsCount": 0, # Number of invalid documents. This includes empty, over-size limit or non-supported languages documents. Required. + "erroneousDocumentsCount": 0, # Number of invalid documents. This + includes empty, over-size limit or non-supported languages documents. + Required. "transactionsCount": 0, # Number of transactions for the request. Required. - "validConversationsCount": 0 # Number of conversations documents. + "validConversationsCount": 0, # Number of conversations documents. This excludes empty, over-size limit or non-supported languages documents. Required. - }, - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". - "tasks": { - "completed": 0, # Count of tasks completed successfully. Required. - "failed": 0, # Count of tasks that failed. Required. - "inProgress": 0, # Count of tasks in progress currently. Required. - "items": [ - analyze_conversation_job_result - ], - "total": 0 # Total count of tasks submitted as part of the job. - Required. + "validDocumentsCount": 0 # Number of valid documents. This excludes + empty, over-size limit or non-supported languages documents. Required. } } """ diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_patch.py index ac58edcf02de..9797ad2cc532 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_patch.py @@ -10,8 +10,7 @@ from ._operations import ConversationAnalysisClientOperationsMixin as ConversationAnalysisClientOperationsMixinGenerated -ConversationAnalysisClientOperationsMixinGenerated.analyze_conversation.__doc__ = \ - """Analyzes the input conversation utterance. +ConversationAnalysisClientOperationsMixinGenerated.analyze_conversation.__doc__ = """Analyzes the input conversation utterance. See https://docs.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information. @@ -62,19 +61,56 @@ # response body for status code(s): 200 response.json() == { "kind": "str", # Required. Enumeration of supported conversational task results. Known values are: "ConversationResult". - "result": { - "query": "str", # Required. The conversation utterance given by the caller. - "detectedLanguage": "str", # Optional. The system detected language for the query in BCP 47 language representation. - "prediction": { - "topIntent": "str", # Required. The intent with the highest score. - "projectKind": "str", # Required. The type of the project. Known values are: "Conversation" and "Orchestration". + "result": { + "prediction": base_prediction, + "query": "str", # The conversation utterance given by the caller. + Required. + "detectedLanguage": "str" # Optional. The system detected language + for the query in BCP 47 language representation.. } } - } + + # JSON input template for discriminator value "Conversation": + base_prediction = { + "entities": [ + { + "category": "str", # The entity category. Required. + "confidenceScore": 0.0, # The entity confidence score. + Required. + "length": 0, # The length of the text. Required. + "offset": 0, # The starting index of this entity in the + query. Required. + "text": "str", # The predicted entity text. Required. + "extraInformation": [ + base_extra_information + ], + "resolutions": [ + base_resolution + ] + } + ], + "intents": [ + { + "category": "str", # A predicted class. Required. + "confidenceScore": 0.0 # The confidence score of the class + from 0.0 to 1.0. Required. + } + ], + "projectKind": "Conversation", + "topIntent": "str" # Optional. The intent with the highest score. + } + + # JSON input template for discriminator value "Orchestration": + base_prediction = { + "intents": { + "str": target_intent_result + }, + "projectKind": "Orchestration", + "topIntent": "str" # Optional. The intent with the highest score. + } """ -ConversationAnalysisClientOperationsMixinGenerated.begin_conversation_analysis.__doc__ = \ - """Submit analysis job for conversations. +ConversationAnalysisClientOperationsMixinGenerated.begin_conversation_analysis.__doc__ = """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_patch.py index 6d4b26ba54a2..53d7dc37f92f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_patch.py @@ -39,9 +39,7 @@ def _authentication_policy(credential): if credential is None: raise ValueError("Parameter 'credential' must not be None.") if isinstance(credential, AzureKeyCredential): - authentication_policy = AzureKeyCredentialPolicy( - name="Ocp-Apim-Subscription-Key", credential=credential - ) + authentication_policy = AzureKeyCredentialPolicy(name="Ocp-Apim-Subscription-Key", credential=credential) elif credential is not None and not hasattr(credential, "get_token"): raise TypeError( f"Unsupported credential: {type(credential)}. Use an instance of AzureKeyCredential " @@ -50,7 +48,9 @@ def _authentication_policy(credential): return authentication_policy -class ConversationAnalysisClient(GeneratedConversationAnalysisClient): # pylint: disable=client-accepts-api-version-keyword +class ConversationAnalysisClient( + GeneratedConversationAnalysisClient +): # pylint: disable=client-accepts-api-version-keyword """The language service conversations API is a suite of natural language processing (NLP) skills that can be used to analyze structured conversations (textual or spoken). The synchronous API in this suite accepts a request and mediates among multiple language projects, such as LUIS @@ -68,8 +68,9 @@ class ConversationAnalysisClient(GeneratedConversationAnalysisClient): # pylint: This can be the an instance of AzureKeyCredential if using a Language API key or a token credential from :mod:`azure.identity`. :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Available values are "2022-05-15-preview" and "2022-05-01". Default - value is "2022-05-15-preview". Note that overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. Available values are "2022-10-01-preview", "2022-05-15-preview", + "2022-05-01". Default value is "2022-10-01-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 Retry-After header is present. @@ -80,12 +81,11 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, TokenCre endpoint = endpoint.rstrip("/") except AttributeError: raise ValueError("Parameter 'endpoint' must be a string.") - super().__init__( endpoint=endpoint, credential=credential, # type: ignore authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)), - **kwargs + **kwargs, ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_serialization.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_serialization.py index 648f84cc4e65..7c1dedb5133d 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_serialization.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_serialization.py @@ -1505,7 +1505,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): try: return self(target_obj, data, content_type=content_type) except: - _LOGGER.warning( + _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_client.py index 436cc462cba5..ad8ba7033741 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_client.py @@ -42,7 +42,7 @@ class ConversationAnalysisClient( :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-10-01-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 diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_configuration.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_configuration.py index 625f14a52e1f..4491fb71bbed 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_configuration.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_configuration.py @@ -29,14 +29,14 @@ class ConversationAnalysisClientConfiguration(Configuration): # pylint: disable :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(ConversationAnalysisClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-05-15-preview") # type: str + api_version = kwargs.pop("api_version", "2022-10-01-preview") # type: str if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py index f0eb5b673668..dcd9b297dd48 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -61,12 +62,12 @@ async def analyze_conversation(self, task: JSON, *, content_type: str = "applica "analysisInput": { "conversationItem": { "id": "str", # The ID of a conversation item. Required. + "participantId": "str", # The participant ID of a + conversation item. Required. "language": "str", # Optional. The override language of a conversation item in BCP 47 language representation. "modality": "str", # Optional. Enumeration of supported conversational modalities. Known values are: "transcript" and "text". - "participantId": "str", # The participant ID of a - conversation item. Required. "role": "str" # Optional. The role of the participant. Known values are: "agent", "customer", and "generic". } @@ -75,11 +76,11 @@ async def analyze_conversation(self, task: JSON, *, content_type: str = "applica "parameters": { "deploymentName": "str", # The name of the deployment to use. Required. + "projectName": "str", # The name of the project to use. Required. "directTarget": "str", # Optional. The name of a target project to forward the request to. "isLoggingEnabled": bool, # Optional. If true, the service will keep the query for further review. - "projectName": "str", # The name of the project to use. Required. "stringIndexType": "TextElements_v8", # Optional. Default value is "TextElements_v8". Specifies the method used to interpret string offsets. Set to "UnicodeCodePoint" for Python strings. Known values are: @@ -101,14 +102,53 @@ async def analyze_conversation(self, task: JSON, *, content_type: str = "applica analyze_conversation_task_result = { "kind": "ConversationResult", "result": { - "detectedLanguage": "str", # Optional. The system detected language - for the query in BCP 47 language representation.. "prediction": base_prediction, - "query": "str" # The conversation utterance given by the caller. + "query": "str", # The conversation utterance given by the caller. Required. + "detectedLanguage": "str" # Optional. The system detected language + for the query in BCP 47 language representation.. } } + # JSON input template for discriminator value "Conversation": + base_prediction = { + "entities": [ + { + "category": "str", # The entity category. Required. + "confidenceScore": 0.0, # The entity confidence score. + Required. + "length": 0, # The length of the text. Required. + "offset": 0, # The starting index of this entity in the + query. Required. + "text": "str", # The predicted entity text. Required. + "extraInformation": [ + base_extra_information + ], + "resolutions": [ + base_resolution + ] + } + ], + "intents": [ + { + "category": "str", # A predicted class. Required. + "confidenceScore": 0.0 # The confidence score of the class + from 0.0 to 1.0. Required. + } + ], + "projectKind": "Conversation", + "topIntent": "str" # Optional. The intent with the highest score. + } + + # JSON input template for discriminator value "Orchestration": + base_prediction = { + "intents": { + "str": target_intent_result + }, + "projectKind": "Orchestration", + "topIntent": "str" # Optional. The intent with the highest score. + } + # response body for status code(s): 200 response == analyze_conversation_task_result """ @@ -135,14 +175,53 @@ async def analyze_conversation(self, task: IO, *, content_type: str = "applicati analyze_conversation_task_result = { "kind": "ConversationResult", "result": { - "detectedLanguage": "str", # Optional. The system detected language - for the query in BCP 47 language representation.. "prediction": base_prediction, - "query": "str" # The conversation utterance given by the caller. + "query": "str", # The conversation utterance given by the caller. Required. + "detectedLanguage": "str" # Optional. The system detected language + for the query in BCP 47 language representation.. } } + # JSON input template for discriminator value "Conversation": + base_prediction = { + "entities": [ + { + "category": "str", # The entity category. Required. + "confidenceScore": 0.0, # The entity confidence score. + Required. + "length": 0, # The length of the text. Required. + "offset": 0, # The starting index of this entity in the + query. Required. + "text": "str", # The predicted entity text. Required. + "extraInformation": [ + base_extra_information + ], + "resolutions": [ + base_resolution + ] + } + ], + "intents": [ + { + "category": "str", # A predicted class. Required. + "confidenceScore": 0.0 # The confidence score of the class + from 0.0 to 1.0. Required. + } + ], + "projectKind": "Conversation", + "topIntent": "str" # Optional. The intent with the highest score. + } + + # JSON input template for discriminator value "Orchestration": + base_prediction = { + "intents": { + "str": target_intent_result + }, + "projectKind": "Orchestration", + "topIntent": "str" # Optional. The intent with the highest score. + } + # response body for status code(s): 200 response == analyze_conversation_task_result """ @@ -170,18 +249,62 @@ async def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JS analyze_conversation_task_result = { "kind": "ConversationResult", "result": { - "detectedLanguage": "str", # Optional. The system detected language - for the query in BCP 47 language representation.. "prediction": base_prediction, - "query": "str" # The conversation utterance given by the caller. + "query": "str", # The conversation utterance given by the caller. Required. + "detectedLanguage": "str" # Optional. The system detected language + for the query in BCP 47 language representation.. } } + # JSON input template for discriminator value "Conversation": + base_prediction = { + "entities": [ + { + "category": "str", # The entity category. Required. + "confidenceScore": 0.0, # The entity confidence score. + Required. + "length": 0, # The length of the text. Required. + "offset": 0, # The starting index of this entity in the + query. Required. + "text": "str", # The predicted entity text. Required. + "extraInformation": [ + base_extra_information + ], + "resolutions": [ + base_resolution + ] + } + ], + "intents": [ + { + "category": "str", # A predicted class. Required. + "confidenceScore": 0.0 # The confidence score of the class + from 0.0 to 1.0. Required. + } + ], + "projectKind": "Conversation", + "topIntent": "str" # Optional. The intent with the highest score. + } + + # JSON input template for discriminator value "Orchestration": + base_prediction = { + "intents": { + "str": target_intent_result + }, + "projectKind": "Orchestration", + "topIntent": "str" # Optional. The intent with the highest score. + } + # response body for status code(s): 200 response == analyze_conversation_task_result """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -232,7 +355,12 @@ async def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JS return cast(JSON, deserialized) async def _conversation_analysis_initial(self, task: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -326,16 +454,29 @@ async def begin_conversation_analysis( conversation ] }, - "displayName": "str", # Optional. Optional display name for the analysis - job. "tasks": [ analyze_conversation_lro_task - ] + ], + "displayName": "str" # Optional. Optional display name for the analysis job. } # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Required. + "jobId": "str", # Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. + "status": "str", # Required. Known values are: "notStarted", "running", + "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "tasks": { + "completed": 0, # Count of tasks completed successfully. Required. + "failed": 0, # Count of tasks that failed. Required. + "inProgress": 0, # Count of tasks in progress currently. Required. + "total": 0, # Total count of tasks submitted as part of the job. + Required. + "items": [ + analyze_conversation_job_result + ] + }, "displayName": "str", # Optional. "errors": [ { @@ -348,6 +489,8 @@ async def begin_conversation_analysis( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -360,45 +503,36 @@ async def begin_conversation_analysis( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. - "jobId": "str", # Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. "nextLink": "str", # Optional. "statistics": { "conversationsCount": 0, # Number of conversations submitted in the request. Required. + "documentsCount": 0, # Number of documents submitted in the request. + Required. "erroneousConversationsCount": 0, # Number of invalid documents. This includes empty, over-size limit or non-supported languages documents. Required. + "erroneousDocumentsCount": 0, # Number of invalid documents. This + includes empty, over-size limit or non-supported languages documents. + Required. "transactionsCount": 0, # Number of transactions for the request. Required. - "validConversationsCount": 0 # Number of conversations documents. + "validConversationsCount": 0, # Number of conversations documents. This excludes empty, over-size limit or non-supported languages documents. Required. - }, - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". - "tasks": { - "completed": 0, # Count of tasks completed successfully. Required. - "failed": 0, # Count of tasks that failed. Required. - "inProgress": 0, # Count of tasks in progress currently. Required. - "items": [ - analyze_conversation_job_result - ], - "total": 0 # Total count of tasks submitted as part of the job. - Required. + "validDocumentsCount": 0 # Number of valid documents. This excludes + empty, over-size limit or non-supported languages documents. Required. } } """ @@ -435,6 +569,20 @@ async def begin_conversation_analysis( # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Required. + "jobId": "str", # Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. + "status": "str", # Required. Known values are: "notStarted", "running", + "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "tasks": { + "completed": 0, # Count of tasks completed successfully. Required. + "failed": 0, # Count of tasks that failed. Required. + "inProgress": 0, # Count of tasks in progress currently. Required. + "total": 0, # Total count of tasks submitted as part of the job. + Required. + "items": [ + analyze_conversation_job_result + ] + }, "displayName": "str", # Optional. "errors": [ { @@ -447,6 +595,8 @@ async def begin_conversation_analysis( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -459,45 +609,36 @@ async def begin_conversation_analysis( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. - "jobId": "str", # Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. "nextLink": "str", # Optional. "statistics": { "conversationsCount": 0, # Number of conversations submitted in the request. Required. + "documentsCount": 0, # Number of documents submitted in the request. + Required. "erroneousConversationsCount": 0, # Number of invalid documents. This includes empty, over-size limit or non-supported languages documents. Required. + "erroneousDocumentsCount": 0, # Number of invalid documents. This + includes empty, over-size limit or non-supported languages documents. + Required. "transactionsCount": 0, # Number of transactions for the request. Required. - "validConversationsCount": 0 # Number of conversations documents. + "validConversationsCount": 0, # Number of conversations documents. This excludes empty, over-size limit or non-supported languages documents. Required. - }, - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". - "tasks": { - "completed": 0, # Count of tasks completed successfully. Required. - "failed": 0, # Count of tasks that failed. Required. - "inProgress": 0, # Count of tasks in progress currently. Required. - "items": [ - analyze_conversation_job_result - ], - "total": 0 # Total count of tasks submitted as part of the job. - Required. + "validDocumentsCount": 0 # Number of valid documents. This excludes + empty, over-size limit or non-supported languages documents. Required. } } """ @@ -532,6 +673,20 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Required. + "jobId": "str", # Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. + "status": "str", # Required. Known values are: "notStarted", "running", + "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "tasks": { + "completed": 0, # Count of tasks completed successfully. Required. + "failed": 0, # Count of tasks that failed. Required. + "inProgress": 0, # Count of tasks in progress currently. Required. + "total": 0, # Total count of tasks submitted as part of the job. + Required. + "items": [ + analyze_conversation_job_result + ] + }, "displayName": "str", # Optional. "errors": [ { @@ -544,6 +699,8 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -556,45 +713,36 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. - "jobId": "str", # Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. "nextLink": "str", # Optional. "statistics": { "conversationsCount": 0, # Number of conversations submitted in the request. Required. + "documentsCount": 0, # Number of documents submitted in the request. + Required. "erroneousConversationsCount": 0, # Number of invalid documents. This includes empty, over-size limit or non-supported languages documents. Required. + "erroneousDocumentsCount": 0, # Number of invalid documents. This + includes empty, over-size limit or non-supported languages documents. + Required. "transactionsCount": 0, # Number of transactions for the request. Required. - "validConversationsCount": 0 # Number of conversations documents. + "validConversationsCount": 0, # Number of conversations documents. This excludes empty, over-size limit or non-supported languages documents. Required. - }, - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". - "tasks": { - "completed": 0, # Count of tasks completed successfully. Required. - "failed": 0, # Count of tasks that failed. Required. - "inProgress": 0, # Count of tasks in progress currently. Required. - "items": [ - analyze_conversation_job_result - ], - "total": 0 # Total count of tasks submitted as part of the job. - Required. + "validDocumentsCount": 0 # Number of valid documents. This excludes + empty, over-size limit or non-supported languages documents. Required. } } """ diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_patch.py index 12b24c5b7886..511975a6392e 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_patch.py @@ -10,8 +10,7 @@ from ._operations import ConversationAnalysisClientOperationsMixin as ConversationAnalysisClientOperationsMixinGenerated -ConversationAnalysisClientOperationsMixinGenerated.analyze_conversation.__doc__ = \ - """Analyzes the input conversation utterance. +ConversationAnalysisClientOperationsMixinGenerated.analyze_conversation.__doc__ = """Analyzes the input conversation utterance. See https://docs.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information. @@ -55,26 +54,63 @@ "targetProjectParameters": "dict" # Optional. A dictionary representing the parameters for each target project. } } - + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": - + # response body for status code(s): 200 response.json() == { "kind": "str", # Required. Enumeration of supported conversational task results. Known values are: "ConversationResult". - "result": { - "query": "str", # Required. The conversation utterance given by the caller. - "detectedLanguage": "str", # Optional. The system detected language for the query in BCP 47 language representation. - "prediction": { - "topIntent": "str", # Required. The intent with the highest score. - "projectKind": "str", # Required. The type of the project. Known values are: "Conversation" and "Orchestration". + "result": { + "prediction": base_prediction, + "query": "str", # The conversation utterance given by the caller. + Required. + "detectedLanguage": "str" # Optional. The system detected language + for the query in BCP 47 language representation.. } } - } + + # JSON input template for discriminator value "Conversation": + base_prediction = { + "entities": [ + { + "category": "str", # The entity category. Required. + "confidenceScore": 0.0, # The entity confidence score. + Required. + "length": 0, # The length of the text. Required. + "offset": 0, # The starting index of this entity in the + query. Required. + "text": "str", # The predicted entity text. Required. + "extraInformation": [ + base_extra_information + ], + "resolutions": [ + base_resolution + ] + } + ], + "intents": [ + { + "category": "str", # A predicted class. Required. + "confidenceScore": 0.0 # The confidence score of the class + from 0.0 to 1.0. Required. + } + ], + "projectKind": "Conversation", + "topIntent": "str" # Optional. The intent with the highest score. + } + + # JSON input template for discriminator value "Orchestration": + base_prediction = { + "intents": { + "str": target_intent_result + }, + "projectKind": "Orchestration", + "topIntent": "str" # Optional. The intent with the highest score. + } """ -ConversationAnalysisClientOperationsMixinGenerated.begin_conversation_analysis.__doc__ = \ - """Submit analysis job for conversations. +ConversationAnalysisClientOperationsMixinGenerated.begin_conversation_analysis.__doc__ = """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_patch.py index 6c8d583a45da..6ff97acb2d89 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_patch.py @@ -40,9 +40,7 @@ def _authentication_policy(credential): if credential is None: raise ValueError("Parameter 'credential' must not be None.") if isinstance(credential, AzureKeyCredential): - authentication_policy = AzureKeyCredentialPolicy( - name="Ocp-Apim-Subscription-Key", credential=credential - ) + authentication_policy = AzureKeyCredentialPolicy(name="Ocp-Apim-Subscription-Key", credential=credential) elif credential is not None and not hasattr(credential, "get_token"): raise TypeError( f"Unsupported credential: {type(credential)}. Use an instance of AzureKeyCredential " @@ -51,7 +49,9 @@ def _authentication_policy(credential): return authentication_policy -class ConversationAnalysisClient(GeneratedConversationAnalysisClient): # pylint: disable=client-accepts-api-version-keyword +class ConversationAnalysisClient( + GeneratedConversationAnalysisClient +): # pylint: disable=client-accepts-api-version-keyword """The language service conversations API is a suite of natural language processing (NLP) skills that can be used to analyze structured conversations (textual or spoken). The synchronous API in this suite accepts a request and mediates among multiple language projects, such as LUIS @@ -69,8 +69,9 @@ class ConversationAnalysisClient(GeneratedConversationAnalysisClient): # pylint: This can be the an instance of AzureKeyCredential if using a Language API key or a token credential from :mod:`azure.identity`. :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Available values are "2022-05-15-preview" and "2022-05-01". Default - value is "2022-05-15-preview". Note that overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. Available values are "2022-10-01-preview", "2022-05-15-preview", + "2022-05-01". Default value is "2022-10-01-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 Retry-After header is present. @@ -83,12 +84,11 @@ def __init__( endpoint = endpoint.rstrip("/") except AttributeError: raise ValueError("Parameter 'endpoint' must be a string.") - super().__init__( endpoint=endpoint, credential=credential, # type: ignore authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)), - **kwargs + **kwargs, ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py index b7b88e632ac6..b1a77a86af6d 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -175,11 +176,12 @@ def build_export_project_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_import_project_request(project_name: str, **kwargs: Any) -> HttpRequest: +def build_import_project_request( + project_name: str, *, exported_project_format: Optional[str] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - exported_project_format = kwargs.pop("exported_project_format", _params.pop("format", None)) # type: Optional[str] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str accept = _headers.pop("Accept", "application/json") @@ -829,21 +831,21 @@ def list_projects(self, *, top: Optional[int] = None, skip: Optional[int] = None response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -856,7 +858,12 @@ def list_projects(self, *, top: Optional[int] = None, skip: Optional[int] = None cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -936,15 +943,15 @@ def create_project( # JSON input template you can fill out and use as your body input. project = { - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. "projectKind": "str", # Represents the project kind. Required. Known values are: "Conversation" and "Orchestration". "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "multilingual": bool, # Optional. Whether the project would be used for + multiple languages or not. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -956,21 +963,21 @@ def create_project( response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -1003,21 +1010,21 @@ def create_project( response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -1048,21 +1055,21 @@ def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -1070,7 +1077,12 @@ def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1145,21 +1157,21 @@ def get_project(self, project_name: str, **kwargs: Any) -> JSON: response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -1167,7 +1179,12 @@ def get_project(self, project_name: str, **kwargs: Any) -> JSON: } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1207,7 +1224,12 @@ def get_project(self, project_name: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1278,6 +1300,12 @@ def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[JS response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1289,6 +1317,8 @@ def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[JS "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1301,26 +1331,18 @@ def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[JS "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1382,7 +1404,12 @@ def _export_project_initial( asset_kind: Optional[str] = None, **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1472,6 +1499,12 @@ def begin_export_project( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1483,6 +1516,8 @@ def begin_export_project( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1495,28 +1530,20 @@ def begin_export_project( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. "resultUrl": "str", # Optional. The URL to use in order to download the exported project. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1584,7 +1611,12 @@ def _import_project_initial( exported_project_format: Optional[str] = None, **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1681,19 +1713,110 @@ def begin_import_project( Example: .. code-block:: python + # The input is polymorphic. The following are possible polymorphic inputs based off + discriminator "projectKind": + + # JSON input template for discriminator value "Conversation": + exported_project_assets = { + "projectKind": "Conversation", + "entities": [ + { + "category": "str", # The category of the entity. Required. + "compositionSetting": "str", # Optional. The behavior to + follow when the entity's components overlap with each other. Known values + are: "returnLongestOverlap", "requireExactOverlap", "separateComponents", + and "combineComponents". + "list": { + "sublists": [ + { + "listKey": "str", # Optional. The + key of the sub-list. + "synonyms": [ + { + "language": "str", # + Optional. Represents the language of the synonyms. + This is BCP-47 representation of a language. For + example, use "en" for English, "en-gb" for English + (UK), "es" for Spanish etc. + "values": [ + "str" # + Optional. The list of synonyms. + ] + } + ] + } + ] + }, + "prebuilts": [ + { + "category": "str" # The prebuilt entity + category. Required. + } + ] + } + ], + "intents": [ + { + "category": "str" # The intent category. Required. + } + ], + "utterances": [ + { + "intent": "str", # The intent of the utterance. Required. + "text": "str", # The utterance text. Required. + "dataset": "str", # Optional. The dataset for this + utterance. Allowed values are 'Train' and 'Test'. + "entities": [ + { + "category": "str", # The category of the + entity label. Required. + "length": 0, # Length for the entity text. + Required. + "offset": 0 # Start position for the entity + text. Required. + } + ], + "language": "str" # Optional. Represents the utterance's + language. This is BCP-47 representation of a language. For example, use + "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + } + ] + } + + # JSON input template for discriminator value "Orchestration": + exported_project_assets = { + "projectKind": "Orchestration", + "intents": [ + { + "category": "str", # The intent category. Required. + "orchestration": exported_orchestration_options + } + ], + "utterances": [ + { + "intent": "str", # The intent of the utterance. Required. + "text": "str", # The utterance text. Required. + "dataset": "str", # Optional. The dataset for this + utterance. Allowed values are 'Train' and 'Test'. + "language": "str" # Optional. Represents the utterance's + language. This is BCP-47 representation of a language. For example, use + "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + } + ] + } + # JSON input template you can fill out and use as your body input. project = { - "assets": exported_project_assets, "metadata": { - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "multilingual": bool, # Optional. Whether the project would be used - for multiple languages or not. "projectKind": "str", # Represents the project kind. Required. Known values are: "Conversation" and "Orchestration". "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "multilingual": bool, # Optional. Whether the project would be used + for multiple languages or not. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically @@ -1701,15 +1824,22 @@ def begin_import_project( } }, "projectFileVersion": "str", # The version of the exported file. Required. - "stringIndexType": "str" # Specifies the method used to interpret string + "stringIndexType": "str", # Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Required. "Utf16CodeUnit" + "assets": exported_project_assets } # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1721,6 +1851,8 @@ def begin_import_project( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1733,26 +1865,18 @@ def begin_import_project( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1803,6 +1927,12 @@ def begin_import_project( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1814,6 +1944,8 @@ def begin_import_project( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1826,26 +1958,18 @@ def begin_import_project( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1895,6 +2019,12 @@ def begin_import_project( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1906,6 +2036,8 @@ def begin_import_project( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1918,26 +2050,18 @@ def begin_import_project( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1999,7 +2123,12 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) def _train_initial(self, project_name: str, configuration: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2087,6 +2216,9 @@ def begin_train( # JSON input template you can fill out and use as your body input. configuration = { + "modelLabel": "str", # Represents the output model label. Required. + "trainingMode": "str", # Represents the mode of the training operation. + Required. Known values are: "advanced" and "standard". "evaluationOptions": { "kind": "str", # Optional. Represents the evaluation kind. By default, the evaluation kind is set to percentage. Known values are: @@ -2098,18 +2230,54 @@ def begin_train( dataset split percentage. Only needed in case the evaluation kind is percentage. }, - "modelLabel": "str", # Represents the output model label. Required. - "trainingConfigVersion": "str", # Optional. Represents training config + "trainingConfigVersion": "str" # Optional. Represents training config version. By default, "latest" value is used which uses the latest released training config version. - "trainingMode": "str" # Represents the mode of the training operation. - Required. Known values are: "advanced" and "standard". } # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2121,6 +2289,8 @@ def begin_train( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2133,59 +2303,18 @@ def begin_train( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2226,6 +2355,45 @@ def begin_train( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2237,6 +2405,8 @@ def begin_train( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2249,59 +2419,18 @@ def begin_train( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2341,6 +2470,45 @@ def begin_train(self, project_name: str, configuration: Union[JSON, IO], **kwarg response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2352,6 +2520,8 @@ def begin_train(self, project_name: str, configuration: Union[JSON, IO], **kwarg "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2364,59 +2534,18 @@ def begin_train(self, project_name: str, configuration: Union[JSON, IO], **kwarg "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2516,7 +2645,12 @@ def list_deployments( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -2578,7 +2712,12 @@ def get_next(next_link=None): def _swap_deployments_initial( self, project_name: str, deployments: Union[JSON, IO], **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2676,6 +2815,12 @@ def begin_swap_deployments( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2687,6 +2832,8 @@ def begin_swap_deployments( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2699,26 +2846,18 @@ def begin_swap_deployments( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2759,6 +2898,12 @@ def begin_swap_deployments( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2770,6 +2915,8 @@ def begin_swap_deployments( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2782,26 +2929,18 @@ def begin_swap_deployments( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2841,6 +2980,12 @@ def begin_swap_deployments(self, project_name: str, deployments: Union[JSON, IO] response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2852,6 +2997,8 @@ def begin_swap_deployments(self, project_name: str, deployments: Union[JSON, IO] "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2864,26 +3011,18 @@ def begin_swap_deployments(self, project_name: str, deployments: Union[JSON, IO] "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2972,7 +3111,12 @@ def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) version. Required. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3015,7 +3159,12 @@ def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) def _deploy_project_initial( self, project_name: str, deployment_name: str, deployment: Union[JSON, IO], **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3276,7 +3425,12 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) def _delete_deployment_initial(self, project_name: str, deployment_name: str, **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3350,6 +3504,12 @@ def begin_delete_deployment(self, project_name: str, deployment_name: str, **kwa response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -3361,6 +3521,8 @@ def begin_delete_deployment(self, project_name: str, deployment_name: str, **kwa "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -3373,26 +3535,18 @@ def begin_delete_deployment(self, project_name: str, deployment_name: str, **kwa "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3471,6 +3625,12 @@ def get_deployment_job_status(self, project_name: str, deployment_name: str, job response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -3482,6 +3642,8 @@ def get_deployment_job_status(self, project_name: str, deployment_name: str, job "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -3494,26 +3656,18 @@ def get_deployment_job_status(self, project_name: str, deployment_name: str, job "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3522,7 +3676,12 @@ def get_deployment_job_status(self, project_name: str, deployment_name: str, job ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3582,6 +3741,12 @@ def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwar response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -3593,6 +3758,8 @@ def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwar "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -3605,26 +3772,18 @@ def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwar "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3633,7 +3792,12 @@ def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwar ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3692,6 +3856,12 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -3703,6 +3873,8 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -3715,28 +3887,20 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. "resultUrl": "str", # Optional. The URL to use in order to download the exported project. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3745,7 +3909,12 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3804,6 +3973,12 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -3815,6 +3990,8 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -3827,26 +4004,18 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3855,7 +4024,12 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3934,7 +4108,12 @@ def list_trained_models( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -4021,7 +4200,12 @@ def get_trained_model(self, project_name: str, trained_model_label: str, **kwarg Required. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4075,7 +4259,12 @@ def delete_trained_model( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4183,7 +4372,12 @@ def list_model_evaluation_results( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -4298,17 +4492,6 @@ def get_model_evaluation_summary(self, project_name: str, trained_model_label: s "microPrecision": 0.0, # Represents the micro precision. Required. "microRecall": 0.0 # Represents the micro recall. Required. }, - "evaluationOptions": { - "kind": "str", # Optional. Represents the evaluation kind. By - default, the evaluation kind is set to percentage. Known values are: - "percentage" and "manual". - "testingSplitPercentage": 0, # Optional. Represents the testing - dataset split percentage. Only needed in case the evaluation kind is - percentage. - "trainingSplitPercentage": 0 # Optional. Represents the training - dataset split percentage. Only needed in case the evaluation kind is - percentage. - }, "intentsEvaluation": { "confusionMatrix": { "str": { @@ -4344,10 +4527,26 @@ def get_model_evaluation_summary(self, project_name: str, trained_model_label: s "microF1": 0.0, # Represents the micro F1. Required. "microPrecision": 0.0, # Represents the micro precision. Required. "microRecall": 0.0 # Represents the micro recall. Required. + }, + "evaluationOptions": { + "kind": "str", # Optional. Represents the evaluation kind. By + default, the evaluation kind is set to percentage. Known values are: + "percentage" and "manual". + "testingSplitPercentage": 0, # Optional. Represents the testing + dataset split percentage. Only needed in case the evaluation kind is + percentage. + "trainingSplitPercentage": 0 # Optional. Represents the training + dataset split percentage. Only needed in case the evaluation kind is + percentage. } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4412,6 +4611,45 @@ def list_training_jobs( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -4423,6 +4661,8 @@ def list_training_jobs( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -4435,59 +4675,18 @@ def list_training_jobs( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -4501,7 +4700,12 @@ def list_training_jobs( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -4579,6 +4783,45 @@ def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -4590,6 +4833,8 @@ def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -4602,59 +4847,18 @@ def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -4663,7 +4867,12 @@ def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4704,7 +4913,12 @@ def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) return cast(JSON, deserialized) def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4778,6 +4992,45 @@ def begin_cancel_training_job(self, project_name: str, job_id: str, **kwargs: An response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -4789,6 +5042,8 @@ def begin_cancel_training_job(self, project_name: str, job_id: str, **kwargs: An "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -4801,59 +5056,18 @@ def begin_cancel_training_job(self, project_name: str, job_id: str, **kwargs: An "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -4928,6 +5142,12 @@ def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -4939,6 +5159,8 @@ def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -4951,26 +5173,18 @@ def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -4979,7 +5193,12 @@ def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -5053,7 +5272,12 @@ def list_supported_languages( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -5156,7 +5380,12 @@ def list_supported_prebuilt_entities( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -5251,7 +5480,12 @@ def list_training_config_versions( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py index ed03213e35cf..d5f72c042ec5 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py @@ -7,11 +7,12 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ from typing import List -from ._operations import ConversationAuthoringClientOperationsMixin as ConversationAuthoringClientOperationsMixinGenerated +from ._operations import ( + ConversationAuthoringClientOperationsMixin as ConversationAuthoringClientOperationsMixinGenerated, +) -ConversationAuthoringClientOperationsMixinGenerated.list_projects.__doc__ = \ - """Lists the existing projects. +ConversationAuthoringClientOperationsMixinGenerated.list_projects.__doc__ = """Lists the existing projects. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-projects for more information. @@ -57,8 +58,7 @@ """ -ConversationAuthoringClientOperationsMixinGenerated.create_project.__doc__ = \ - """Creates a new project or updates an existing one. +ConversationAuthoringClientOperationsMixinGenerated.create_project.__doc__ = """Creates a new project or updates an existing one. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project for more information. @@ -123,8 +123,7 @@ """ -ConversationAuthoringClientOperationsMixinGenerated.get_project.__doc__ = \ - """Gets the details of a project. +ConversationAuthoringClientOperationsMixinGenerated.get_project.__doc__ = """Gets the details of a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project for more information. @@ -165,8 +164,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_delete_project.__doc__ = \ - """Deletes a project. +ConversationAuthoringClientOperationsMixinGenerated.begin_delete_project.__doc__ = """Deletes a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-project for more information. @@ -243,8 +241,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_export_project.__doc__ = \ - """Triggers a job to export a project's data. +ConversationAuthoringClientOperationsMixinGenerated.begin_export_project.__doc__ = """Triggers a job to export a project's data. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/export for more information. @@ -332,8 +329,7 @@ """ -ConversationAuthoringClientOperationsMixinGenerated.begin_import_project.__doc__ = \ - """Triggers a job to import a project. If a project with the same name already exists, the data of +ConversationAuthoringClientOperationsMixinGenerated.begin_import_project.__doc__ = """Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more @@ -444,8 +440,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_train.__doc__ = \ - """Triggers a training job for a project. +ConversationAuthoringClientOperationsMixinGenerated.begin_train.__doc__ = """Triggers a training job for a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more information. @@ -582,8 +577,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_deployments.__doc__ = \ - """Lists the deployments belonging to a project. +ConversationAuthoringClientOperationsMixinGenerated.list_deployments.__doc__ = """Lists the deployments belonging to a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployments for more information. @@ -618,8 +612,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_swap_deployments.__doc__ = \ - """Swaps two existing deployments with each other. +ConversationAuthoringClientOperationsMixinGenerated.begin_swap_deployments.__doc__ = """Swaps two existing deployments with each other. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments for more information. @@ -710,8 +703,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_deployment.__doc__ = \ - """Gets the details of a deployment. +ConversationAuthoringClientOperationsMixinGenerated.get_deployment.__doc__ = """Gets the details of a deployment. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment for more information. @@ -742,8 +734,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_deploy_project.__doc__ = \ - """Creates a new deployment or replaces an existing one. +ConversationAuthoringClientOperationsMixinGenerated.begin_deploy_project.__doc__ = """Creates a new deployment or replaces an existing one. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project for more information. @@ -791,8 +782,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_delete_deployment.__doc__ = \ - """Deletes a project deployment. +ConversationAuthoringClientOperationsMixinGenerated.begin_delete_deployment.__doc__ = """Deletes a project deployment. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment for more information. @@ -871,8 +861,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_deployment_job_status.__doc__ = \ - """Gets the status of an existing deployment job. +ConversationAuthoringClientOperationsMixinGenerated.get_deployment_job_status.__doc__ = """Gets the status of an existing deployment job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status for more information. @@ -946,8 +935,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_swap_deployments_job_status.__doc__ = \ - """Gets the status of an existing swap deployment job. +ConversationAuthoringClientOperationsMixinGenerated.get_swap_deployments_job_status.__doc__ = """Gets the status of an existing swap deployment job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status for more information. @@ -1019,8 +1007,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_export_project_job_status.__doc__ = \ - """Gets the status of an export job. Once job completes, returns the project metadata, and assets. +ConversationAuthoringClientOperationsMixinGenerated.get_export_project_job_status.__doc__ = """Gets the status of an export job. Once job completes, returns the project metadata, and assets. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status for more information. @@ -1094,8 +1081,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_import_project_job_status.__doc__ = \ - """Gets the status for an import. +ConversationAuthoringClientOperationsMixinGenerated.get_import_project_job_status.__doc__ = """Gets the status for an import. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status for more information. @@ -1167,8 +1153,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_trained_models.__doc__ = \ - """Lists the trained models belonging to a project. +ConversationAuthoringClientOperationsMixinGenerated.list_trained_models.__doc__ = """Lists the trained models belonging to a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models for more information. @@ -1202,8 +1187,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_trained_model.__doc__ = \ - """Gets the details of a trained model. +ConversationAuthoringClientOperationsMixinGenerated.get_trained_model.__doc__ = """Gets the details of a trained model. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-trained-model for more information. @@ -1233,8 +1217,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.delete_trained_model.__doc__ = \ - """Deletes an existing trained model. +ConversationAuthoringClientOperationsMixinGenerated.delete_trained_model.__doc__ = """Deletes an existing trained model. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-trained-model for more information. @@ -1248,8 +1231,7 @@ :raises ~azure.core.exceptions.HttpResponseError: """ -ConversationAuthoringClientOperationsMixinGenerated.list_model_evaluation_results.__doc__ = \ - """Gets the detailed results of the evaluation for a trained model. This includes the raw +ConversationAuthoringClientOperationsMixinGenerated.list_model_evaluation_results.__doc__ = """Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-results @@ -1313,8 +1295,7 @@ """ -ConversationAuthoringClientOperationsMixinGenerated.get_model_evaluation_summary.__doc__ = \ - """Gets the evaluation summary of a trained model. The summary includes high level performance +ConversationAuthoringClientOperationsMixinGenerated.get_model_evaluation_summary.__doc__ = """Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary @@ -1419,8 +1400,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_training_jobs.__doc__ = \ - """Lists the non-expired training jobs created for a project. +ConversationAuthoringClientOperationsMixinGenerated.list_training_jobs.__doc__ = """Lists the non-expired training jobs created for a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-jobs for more information. @@ -1529,8 +1509,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_training_job_status.__doc__ = \ - """Gets the status for a training job. +ConversationAuthoringClientOperationsMixinGenerated.get_training_job_status.__doc__ = """Gets the status for a training job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-training-status for more information. @@ -1635,8 +1614,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_cancel_training_job.__doc__ = \ - """Triggers a cancellation for a running training job. +ConversationAuthoringClientOperationsMixinGenerated.begin_cancel_training_job.__doc__ = """Triggers a cancellation for a running training job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/cancel-training-job for more information. @@ -1748,8 +1726,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_project_deletion_job_status.__doc__ = \ - """Gets the status for a project deletion job. +ConversationAuthoringClientOperationsMixinGenerated.get_project_deletion_job_status.__doc__ = """Gets the status for a project deletion job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project-deletion-status for more information. @@ -1819,8 +1796,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_supported_languages.__doc__ = \ - """Lists the supported languages for the given project type. +ConversationAuthoringClientOperationsMixinGenerated.list_supported_languages.__doc__ = """Lists the supported languages for the given project type. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages for more information. @@ -1850,8 +1826,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_supported_prebuilt_entities.__doc__ = \ - """Lists the supported prebuilt entities that can be used while creating composed entities. +ConversationAuthoringClientOperationsMixinGenerated.list_supported_prebuilt_entities.__doc__ = """Lists the supported prebuilt entities that can be used while creating composed entities. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-prebuilt-entities for more information. @@ -1884,8 +1859,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_training_config_versions.__doc__ = \ - """Lists the support training config version for a given project type. +ConversationAuthoringClientOperationsMixinGenerated.list_training_config_versions.__doc__ = """Lists the support training config version for a given project type. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions for more information. @@ -1920,7 +1894,9 @@ class ConversationAuthoringClientOperationsMixin(ConversationAuthoringClientOper ... -__all__: List[str] = ["ConversationAuthoringClientOperationsMixin"] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [ + "ConversationAuthoringClientOperationsMixin" +] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py index 5a201e73e34f..a65ab7f3f769 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py @@ -17,9 +17,7 @@ def _authentication_policy(credential): if credential is None: raise ValueError("Parameter 'credential' must not be None.") if isinstance(credential, AzureKeyCredential): - authentication_policy = AzureKeyCredentialPolicy( - name="Ocp-Apim-Subscription-Key", credential=credential - ) + authentication_policy = AzureKeyCredentialPolicy(name="Ocp-Apim-Subscription-Key", credential=credential) elif credential is not None and not hasattr(credential, "get_token"): raise TypeError( f"Unsupported credential: {type(credential)}. Use an instance of AzureKeyCredential " @@ -28,7 +26,9 @@ def _authentication_policy(credential): return authentication_policy -class ConversationAuthoringClient(GeneratedConversationAuthoringClient): # pylint: disable=client-accepts-api-version-keyword +class ConversationAuthoringClient( + GeneratedConversationAuthoringClient +): # pylint: disable=client-accepts-api-version-keyword """The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language @@ -57,12 +57,11 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, TokenCre endpoint = endpoint.rstrip("/") except AttributeError: raise ValueError("Parameter 'endpoint' must be a string.") - super().__init__( endpoint=endpoint, credential=credential, # type: ignore authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)), - **kwargs + **kwargs, ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_serialization.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_serialization.py index 648f84cc4e65..7c1dedb5133d 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_serialization.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_serialization.py @@ -1505,7 +1505,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): try: return self(target_obj, data, content_type=content_type) except: - _LOGGER.warning( + _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_version.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_version.py index f1fb63697cf5..73aef742777f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_version.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0b2" +VERSION = "1.1.0b3" diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py index e023ff47ad92..c8b1492266e7 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py @@ -16,6 +16,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -92,21 +93,21 @@ def list_projects( response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -119,7 +120,12 @@ def list_projects( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -199,15 +205,15 @@ async def create_project( # JSON input template you can fill out and use as your body input. project = { - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. "projectKind": "str", # Represents the project kind. Required. Known values are: "Conversation" and "Orchestration". "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "multilingual": bool, # Optional. Whether the project would be used for + multiple languages or not. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -219,21 +225,21 @@ async def create_project( response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -266,21 +272,21 @@ async def create_project( response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -311,21 +317,21 @@ async def create_project(self, project_name: str, project: Union[JSON, IO], **kw response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -333,7 +339,12 @@ async def create_project(self, project_name: str, project: Union[JSON, IO], **kw } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -408,21 +419,21 @@ async def get_project(self, project_name: str, **kwargs: Any) -> JSON: response == { "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. + "projectKind": "str", # Represents the project kind. Required. Known values + are: "Conversation" and "Orchestration". + "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the + project last deployed datetime. "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the project last trained datetime. "multilingual": bool, # Optional. Whether the project would be used for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to @@ -430,7 +441,12 @@ async def get_project(self, project_name: str, **kwargs: Any) -> JSON: } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -470,7 +486,12 @@ async def get_project(self, project_name: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) async def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -541,6 +562,12 @@ async def begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncL response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -552,6 +579,8 @@ async def begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncL "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -564,26 +593,18 @@ async def begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncL "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -646,7 +667,12 @@ async def _export_project_initial( asset_kind: Optional[str] = None, **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -736,6 +762,12 @@ async def begin_export_project( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -747,6 +779,8 @@ async def begin_export_project( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -759,28 +793,20 @@ async def begin_export_project( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. "resultUrl": "str", # Optional. The URL to use in order to download the exported project. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -849,7 +875,12 @@ async def _import_project_initial( exported_project_format: Optional[str] = None, **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -946,19 +977,110 @@ async def begin_import_project( Example: .. code-block:: python + # The input is polymorphic. The following are possible polymorphic inputs based off + discriminator "projectKind": + + # JSON input template for discriminator value "Conversation": + exported_project_assets = { + "projectKind": "Conversation", + "entities": [ + { + "category": "str", # The category of the entity. Required. + "compositionSetting": "str", # Optional. The behavior to + follow when the entity's components overlap with each other. Known values + are: "returnLongestOverlap", "requireExactOverlap", "separateComponents", + and "combineComponents". + "list": { + "sublists": [ + { + "listKey": "str", # Optional. The + key of the sub-list. + "synonyms": [ + { + "language": "str", # + Optional. Represents the language of the synonyms. + This is BCP-47 representation of a language. For + example, use "en" for English, "en-gb" for English + (UK), "es" for Spanish etc. + "values": [ + "str" # + Optional. The list of synonyms. + ] + } + ] + } + ] + }, + "prebuilts": [ + { + "category": "str" # The prebuilt entity + category. Required. + } + ] + } + ], + "intents": [ + { + "category": "str" # The intent category. Required. + } + ], + "utterances": [ + { + "intent": "str", # The intent of the utterance. Required. + "text": "str", # The utterance text. Required. + "dataset": "str", # Optional. The dataset for this + utterance. Allowed values are 'Train' and 'Test'. + "entities": [ + { + "category": "str", # The category of the + entity label. Required. + "length": 0, # Length for the entity text. + Required. + "offset": 0 # Start position for the entity + text. Required. + } + ], + "language": "str" # Optional. Represents the utterance's + language. This is BCP-47 representation of a language. For example, use + "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + } + ] + } + + # JSON input template for discriminator value "Orchestration": + exported_project_assets = { + "projectKind": "Orchestration", + "intents": [ + { + "category": "str", # The intent category. Required. + "orchestration": exported_orchestration_options + } + ], + "utterances": [ + { + "intent": "str", # The intent of the utterance. Required. + "text": "str", # The utterance text. Required. + "dataset": "str", # Optional. The dataset for this + utterance. Allowed values are 'Train' and 'Test'. + "language": "str" # Optional. Represents the utterance's + language. This is BCP-47 representation of a language. For example, use + "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + } + ] + } + # JSON input template you can fill out and use as your body input. project = { - "assets": exported_project_assets, "metadata": { - "description": "str", # Optional. The project description. "language": "str", # The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. - "multilingual": bool, # Optional. Whether the project would be used - for multiple languages or not. "projectKind": "str", # Represents the project kind. Required. Known values are: "Conversation" and "Orchestration". "projectName": "str", # The new project name. Required. + "description": "str", # Optional. The project description. + "multilingual": bool, # Optional. Whether the project would be used + for multiple languages or not. "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically @@ -966,15 +1088,22 @@ async def begin_import_project( } }, "projectFileVersion": "str", # The version of the exported file. Required. - "stringIndexType": "str" # Specifies the method used to interpret string + "stringIndexType": "str", # Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Required. "Utf16CodeUnit" + "assets": exported_project_assets } # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -986,6 +1115,8 @@ async def begin_import_project( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -998,26 +1129,18 @@ async def begin_import_project( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1068,6 +1191,12 @@ async def begin_import_project( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1079,6 +1208,8 @@ async def begin_import_project( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1091,26 +1222,18 @@ async def begin_import_project( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1160,6 +1283,12 @@ async def begin_import_project( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1171,6 +1300,8 @@ async def begin_import_project( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1183,26 +1314,18 @@ async def begin_import_project( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1265,7 +1388,12 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) async def _train_initial(self, project_name: str, configuration: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1353,6 +1481,9 @@ async def begin_train( # JSON input template you can fill out and use as your body input. configuration = { + "modelLabel": "str", # Represents the output model label. Required. + "trainingMode": "str", # Represents the mode of the training operation. + Required. Known values are: "advanced" and "standard". "evaluationOptions": { "kind": "str", # Optional. Represents the evaluation kind. By default, the evaluation kind is set to percentage. Known values are: @@ -1364,18 +1495,54 @@ async def begin_train( dataset split percentage. Only needed in case the evaluation kind is percentage. }, - "modelLabel": "str", # Represents the output model label. Required. - "trainingConfigVersion": "str", # Optional. Represents training config + "trainingConfigVersion": "str" # Optional. Represents training config version. By default, "latest" value is used which uses the latest released training config version. - "trainingMode": "str" # Represents the mode of the training operation. - Required. Known values are: "advanced" and "standard". } # response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1387,6 +1554,8 @@ async def begin_train( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1399,59 +1568,18 @@ async def begin_train( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1492,6 +1620,45 @@ async def begin_train( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1503,6 +1670,8 @@ async def begin_train( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1515,59 +1684,18 @@ async def begin_train( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1609,6 +1737,45 @@ async def begin_train( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1620,6 +1787,8 @@ async def begin_train( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1632,59 +1801,18 @@ async def begin_train( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -1785,7 +1913,12 @@ def list_deployments( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1847,7 +1980,12 @@ async def get_next(next_link=None): async def _swap_deployments_initial( self, project_name: str, deployments: Union[JSON, IO], **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1945,6 +2083,12 @@ async def begin_swap_deployments( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -1956,6 +2100,8 @@ async def begin_swap_deployments( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -1968,26 +2114,18 @@ async def begin_swap_deployments( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2028,6 +2166,12 @@ async def begin_swap_deployments( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2039,6 +2183,8 @@ async def begin_swap_deployments( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2051,26 +2197,18 @@ async def begin_swap_deployments( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2112,6 +2250,12 @@ async def begin_swap_deployments( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2123,6 +2267,8 @@ async def begin_swap_deployments( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2135,26 +2281,18 @@ async def begin_swap_deployments( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2244,7 +2382,12 @@ async def get_deployment(self, project_name: str, deployment_name: str, **kwargs version. Required. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2287,7 +2430,12 @@ async def get_deployment(self, project_name: str, deployment_name: str, **kwargs async def _deploy_project_initial( self, project_name: str, deployment_name: str, deployment: Union[JSON, IO], **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2551,7 +2699,12 @@ def get_long_running_output(pipeline_response): async def _delete_deployment_initial( self, project_name: str, deployment_name: str, **kwargs: Any ) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2627,6 +2780,12 @@ async def begin_delete_deployment( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2638,6 +2797,8 @@ async def begin_delete_deployment( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2650,26 +2811,18 @@ async def begin_delete_deployment( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2751,6 +2904,12 @@ async def get_deployment_job_status( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2762,6 +2921,8 @@ async def get_deployment_job_status( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2774,26 +2935,18 @@ async def get_deployment_job_status( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2802,7 +2955,12 @@ async def get_deployment_job_status( ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2862,6 +3020,12 @@ async def get_swap_deployments_job_status(self, project_name: str, job_id: str, response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2873,6 +3037,8 @@ async def get_swap_deployments_job_status(self, project_name: str, job_id: str, "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2885,26 +3051,18 @@ async def get_swap_deployments_job_status(self, project_name: str, job_id: str, "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -2913,7 +3071,12 @@ async def get_swap_deployments_job_status(self, project_name: str, job_id: str, ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2972,6 +3135,12 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -2983,6 +3152,8 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -2995,28 +3166,20 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. "resultUrl": "str", # Optional. The URL to use in order to download the exported project. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3025,7 +3188,12 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3084,6 +3252,12 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -3095,6 +3269,8 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -3107,26 +3283,18 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3135,7 +3303,12 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3214,7 +3387,12 @@ def list_trained_models( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -3301,7 +3479,12 @@ async def get_trained_model(self, project_name: str, trained_model_label: str, * Required. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3355,7 +3538,12 @@ async def delete_trained_model( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3463,7 +3651,12 @@ def list_model_evaluation_results( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -3578,17 +3771,6 @@ async def get_model_evaluation_summary(self, project_name: str, trained_model_la "microPrecision": 0.0, # Represents the micro precision. Required. "microRecall": 0.0 # Represents the micro recall. Required. }, - "evaluationOptions": { - "kind": "str", # Optional. Represents the evaluation kind. By - default, the evaluation kind is set to percentage. Known values are: - "percentage" and "manual". - "testingSplitPercentage": 0, # Optional. Represents the testing - dataset split percentage. Only needed in case the evaluation kind is - percentage. - "trainingSplitPercentage": 0 # Optional. Represents the training - dataset split percentage. Only needed in case the evaluation kind is - percentage. - }, "intentsEvaluation": { "confusionMatrix": { "str": { @@ -3624,10 +3806,26 @@ async def get_model_evaluation_summary(self, project_name: str, trained_model_la "microF1": 0.0, # Represents the micro F1. Required. "microPrecision": 0.0, # Represents the micro precision. Required. "microRecall": 0.0 # Represents the micro recall. Required. + }, + "evaluationOptions": { + "kind": "str", # Optional. Represents the evaluation kind. By + default, the evaluation kind is set to percentage. Known values are: + "percentage" and "manual". + "testingSplitPercentage": 0, # Optional. Represents the testing + dataset split percentage. Only needed in case the evaluation kind is + percentage. + "trainingSplitPercentage": 0 # Optional. Represents the training + dataset split percentage. Only needed in case the evaluation kind is + percentage. } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3692,6 +3890,45 @@ def list_training_jobs( response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -3703,6 +3940,8 @@ def list_training_jobs( "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -3715,59 +3954,18 @@ def list_training_jobs( "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3781,7 +3979,12 @@ def list_training_jobs( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -3859,6 +4062,45 @@ async def get_training_job_status(self, project_name: str, job_id: str, **kwargs response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -3870,6 +4112,8 @@ async def get_training_job_status(self, project_name: str, job_id: str, **kwargs "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -3882,59 +4126,18 @@ async def get_training_job_status(self, project_name: str, job_id: str, **kwargs "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -3943,7 +4146,12 @@ async def get_training_job_status(self, project_name: str, job_id: str, **kwargs ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3984,7 +4192,12 @@ async def get_training_job_status(self, project_name: str, job_id: str, **kwargs return cast(JSON, deserialized) async def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: Any) -> Optional[JSON]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4058,6 +4271,45 @@ async def begin_cancel_training_job(self, project_name: str, job_id: str, **kwar response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "result": { + "modelLabel": "str", # Represents trained model label. Required. + "trainingConfigVersion": "str", # Represents training config + version. Required. + "trainingStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. + Represents the estimated end date time for training and evaluation. + "evaluationStatus": { + "percentComplete": 0, # Represents progress percentage. + Required. + "status": "str", # Represents the status of the + sub-operation. Required. Known values are: "notStarted", "running", + "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "endDateTime": "2020-02-20 00:00:00", # Optional. Represents + the end date time. + "startDateTime": "2020-02-20 00:00:00" # Optional. + Represents the start date time. + }, + "trainingMode": "str" # Optional. Represents the mode of the + training operation. Known values are: "advanced" and "standard". + }, + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -4069,6 +4321,8 @@ async def begin_cancel_training_job(self, project_name: str, job_id: str, **kwar "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -4081,59 +4335,18 @@ async def begin_cancel_training_job(self, project_name: str, job_id: str, **kwar "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -4209,6 +4422,12 @@ async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> J response == { "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". "errors": [ { "code": "str", # One of a server-defined set of error codes. @@ -4220,6 +4439,8 @@ async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> J "AzureCognitiveSearchIndexLimitReached", "InternalServerError", "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and "Warning". + "message": "str", # A human-readable representation of the + error. Required. "details": [ ... ], @@ -4232,26 +4453,18 @@ async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> J "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", and "InvalidCountryHint". + "message": "str", # Error message. Required. "details": { "str": "str" # Optional. Error details. }, "innererror": ..., - "message": "str", # Error message. Required. "target": "str" # Optional. Error target. }, - "message": "str", # A human-readable representation of the - error. Required. "target": "str" # Optional. The target of the error. } ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". "warnings": [ { "code": "str", # The warning code. Required. @@ -4260,7 +4473,12 @@ async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> J ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4334,7 +4552,12 @@ def list_supported_languages( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -4437,7 +4660,12 @@ def list_supported_prebuilt_entities( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -4532,7 +4760,12 @@ def list_training_config_versions( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py index 19ffdbff12ad..279f40c7d65e 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py @@ -7,11 +7,11 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ from typing import List -from ._operations import \ - ConversationAuthoringClientOperationsMixin as ConversationAuthoringClientOperationsMixinGenerated +from ._operations import ( + ConversationAuthoringClientOperationsMixin as ConversationAuthoringClientOperationsMixinGenerated, +) -ConversationAuthoringClientOperationsMixinGenerated.list_projects.__doc__ = \ - """Lists the existing projects. +ConversationAuthoringClientOperationsMixinGenerated.list_projects.__doc__ = """Lists the existing projects. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-projects for more information. @@ -56,8 +56,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.create_project.__doc__ = \ - """Creates a new project or updates an existing one. +ConversationAuthoringClientOperationsMixinGenerated.create_project.__doc__ = """Creates a new project or updates an existing one. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project for more information. @@ -121,8 +120,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_project.__doc__ = \ - """Gets the details of a project. +ConversationAuthoringClientOperationsMixinGenerated.get_project.__doc__ = """Gets the details of a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project for more information. @@ -163,8 +161,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_delete_project.__doc__ = \ - """Deletes a project. +ConversationAuthoringClientOperationsMixinGenerated.begin_delete_project.__doc__ = """Deletes a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-project for more information. @@ -241,8 +238,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_export_project.__doc__ = \ - """Triggers a job to export a project's data. +ConversationAuthoringClientOperationsMixinGenerated.begin_export_project.__doc__ = """Triggers a job to export a project's data. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/export for more information. @@ -329,8 +325,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_import_project.__doc__ = \ - """Triggers a job to import a project. If a project with the same name already exists, the data of +ConversationAuthoringClientOperationsMixinGenerated.begin_import_project.__doc__ = """Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more @@ -441,8 +436,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_train.__doc__ = \ - """Triggers a training job for a project. +ConversationAuthoringClientOperationsMixinGenerated.begin_train.__doc__ = """Triggers a training job for a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more information. @@ -579,8 +573,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_deployments.__doc__ = \ - """Lists the deployments belonging to a project. +ConversationAuthoringClientOperationsMixinGenerated.list_deployments.__doc__ = """Lists the deployments belonging to a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployments for more information. @@ -615,8 +608,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_swap_deployments.__doc__ = \ - """Swaps two existing deployments with each other. +ConversationAuthoringClientOperationsMixinGenerated.begin_swap_deployments.__doc__ = """Swaps two existing deployments with each other. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments for more information. @@ -707,8 +699,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_deployment.__doc__ = \ - """Gets the details of a deployment. +ConversationAuthoringClientOperationsMixinGenerated.get_deployment.__doc__ = """Gets the details of a deployment. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment for more information. @@ -739,8 +730,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_deploy_project.__doc__ = \ - """Creates a new deployment or replaces an existing one. +ConversationAuthoringClientOperationsMixinGenerated.begin_deploy_project.__doc__ = """Creates a new deployment or replaces an existing one. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project for more information. @@ -788,8 +778,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_delete_deployment.__doc__ = \ - """Deletes a project deployment. +ConversationAuthoringClientOperationsMixinGenerated.begin_delete_deployment.__doc__ = """Deletes a project deployment. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment for more information. @@ -868,8 +857,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_deployment_job_status.__doc__ = \ - """Gets the status of an existing deployment job. +ConversationAuthoringClientOperationsMixinGenerated.get_deployment_job_status.__doc__ = """Gets the status of an existing deployment job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status for more information. @@ -943,8 +931,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_swap_deployments_job_status.__doc__ = \ - """Gets the status of an existing swap deployment job. +ConversationAuthoringClientOperationsMixinGenerated.get_swap_deployments_job_status.__doc__ = """Gets the status of an existing swap deployment job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status for more information. @@ -1016,8 +1003,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_export_project_job_status.__doc__ = \ - """Gets the status of an export job. Once job completes, returns the project metadata, and assets. +ConversationAuthoringClientOperationsMixinGenerated.get_export_project_job_status.__doc__ = """Gets the status of an export job. Once job completes, returns the project metadata, and assets. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status for more information. @@ -1091,8 +1077,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_import_project_job_status.__doc__ = \ - """Gets the status for an import. +ConversationAuthoringClientOperationsMixinGenerated.get_import_project_job_status.__doc__ = """Gets the status for an import. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status for more information. @@ -1164,8 +1149,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_trained_models.__doc__ = \ - """Lists the trained models belonging to a project. +ConversationAuthoringClientOperationsMixinGenerated.list_trained_models.__doc__ = """Lists the trained models belonging to a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models for more information. @@ -1199,8 +1183,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_trained_model.__doc__ = \ - """Gets the details of a trained model. +ConversationAuthoringClientOperationsMixinGenerated.get_trained_model.__doc__ = """Gets the details of a trained model. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-trained-model for more information. @@ -1230,8 +1213,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.delete_trained_model.__doc__ = \ - """Deletes an existing trained model. +ConversationAuthoringClientOperationsMixinGenerated.delete_trained_model.__doc__ = """Deletes an existing trained model. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-trained-model for more information. @@ -1245,8 +1227,7 @@ :raises ~azure.core.exceptions.HttpResponseError: """ -ConversationAuthoringClientOperationsMixinGenerated.list_model_evaluation_results.__doc__ = \ - """Gets the detailed results of the evaluation for a trained model. This includes the raw +ConversationAuthoringClientOperationsMixinGenerated.list_model_evaluation_results.__doc__ = """Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-results @@ -1309,8 +1290,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_model_evaluation_summary.__doc__ = \ - """Gets the evaluation summary of a trained model. The summary includes high level performance +ConversationAuthoringClientOperationsMixinGenerated.get_model_evaluation_summary.__doc__ = """Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary @@ -1415,8 +1395,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_training_jobs.__doc__ = \ - """Lists the non-expired training jobs created for a project. +ConversationAuthoringClientOperationsMixinGenerated.list_training_jobs.__doc__ = """Lists the non-expired training jobs created for a project. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-jobs for more information. @@ -1525,8 +1504,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_training_job_status.__doc__ = \ - """Gets the status for a training job. +ConversationAuthoringClientOperationsMixinGenerated.get_training_job_status.__doc__ = """Gets the status for a training job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-training-status for more information. @@ -1631,8 +1609,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.begin_cancel_training_job.__doc__ = \ - """Triggers a cancellation for a running training job. +ConversationAuthoringClientOperationsMixinGenerated.begin_cancel_training_job.__doc__ = """Triggers a cancellation for a running training job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/cancel-training-job for more information. @@ -1744,8 +1721,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.get_project_deletion_job_status.__doc__ = \ - """Gets the status for a project deletion job. +ConversationAuthoringClientOperationsMixinGenerated.get_project_deletion_job_status.__doc__ = """Gets the status for a project deletion job. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project-deletion-status for more information. @@ -1815,8 +1791,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_supported_languages.__doc__ = \ - """Lists the supported languages for the given project type. +ConversationAuthoringClientOperationsMixinGenerated.list_supported_languages.__doc__ = """Lists the supported languages for the given project type. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages for more information. @@ -1846,8 +1821,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_supported_prebuilt_entities.__doc__ = \ - """Lists the supported prebuilt entities that can be used while creating composed entities. +ConversationAuthoringClientOperationsMixinGenerated.list_supported_prebuilt_entities.__doc__ = """Lists the supported prebuilt entities that can be used while creating composed entities. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-prebuilt-entities for more information. @@ -1880,8 +1854,7 @@ } """ -ConversationAuthoringClientOperationsMixinGenerated.list_training_config_versions.__doc__ = \ - """Lists the support training config version for a given project type. +ConversationAuthoringClientOperationsMixinGenerated.list_training_config_versions.__doc__ = """Lists the support training config version for a given project type. See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions for more information. @@ -1916,7 +1889,10 @@ class ConversationAuthoringClientOperationsMixin(ConversationAuthoringClientOper ... -__all__: List[str] = ["ConversationAuthoringClientOperationsMixin"] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [ + "ConversationAuthoringClientOperationsMixin" +] # Add all objects you want publicly available to users at this package level + def patch_sdk(): """Do not remove from this file. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_patch.py index e12796035e03..c3c7fcc5def9 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_patch.py @@ -18,9 +18,7 @@ def _authentication_policy(credential): if credential is None: raise ValueError("Parameter 'credential' must not be None.") if isinstance(credential, AzureKeyCredential): - authentication_policy = AzureKeyCredentialPolicy( - name="Ocp-Apim-Subscription-Key", credential=credential - ) + authentication_policy = AzureKeyCredentialPolicy(name="Ocp-Apim-Subscription-Key", credential=credential) elif credential is not None and not hasattr(credential, "get_token"): raise TypeError( f"Unsupported credential: {type(credential)}. Use an instance of AzureKeyCredential " @@ -29,7 +27,9 @@ def _authentication_policy(credential): return authentication_policy -class ConversationAuthoringClient(GeneratedConversationAuthoringClient): # pylint: disable=client-accepts-api-version-keyword +class ConversationAuthoringClient( + GeneratedConversationAuthoringClient +): # pylint: disable=client-accepts-api-version-keyword """The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language @@ -60,12 +60,11 @@ def __init__( endpoint = endpoint.rstrip("/") except AttributeError: raise ValueError("Parameter 'endpoint' must be a string.") - super().__init__( endpoint=endpoint, credential=credential, # type: ignore authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)), - **kwargs + **kwargs, ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md index de63fbcc475a..b8bbaff55404 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md @@ -29,7 +29,7 @@ python: true tag: release_2022_05_15_preview openapi-type: data-plane version-tolerant: true -package-version: 1.1.0b2 +package-version: 1.1.0b3 add-credential: true credential-scopes: https://cognitiveservices.azure.com/.default black: true @@ -50,7 +50,7 @@ batch: These settings apply only when `--tag=release_runtime_1_1_preview` is specified on the command line. ```yaml $(tag) == 'release_runtime_1_1_preview' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e7f37e4e43b1d12fd1988fda3ed39624c4b23303/specification/cognitiveservices/data-plane/Language/preview/2022-05-15-preview/analyzeconversations.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/374bebd0b0764ba8350cb186e010f1fee987d0b7/dev/cognitiveservices/data-plane/Language/analyzeconversations.json output-folder: ../azure/ai/language/conversations title: ConversationAnalysisClient ``` From 61a49432048aaf7862447c44f8b8438cbda69f8b Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Tue, 27 Sep 2022 13:50:35 -0700 Subject: [PATCH 2/7] add rest api docs to the docstrings --- .../ai/language/conversations/_client.py | 2 - .../conversations/_operations/_operations.py | 24 ++- .../ai/language/conversations/aio/_client.py | 2 - .../aio/_operations/_operations.py | 24 ++- .../conversations/authoring/_client.py | 2 - .../authoring/_operations/_operations.py | 151 +++++++++++++----- .../conversations/authoring/aio/_client.py | 2 - .../authoring/aio/_operations/_operations.py | 151 +++++++++++++----- .../swagger/README.md | 18 +++ 9 files changed, 282 insertions(+), 94 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_client.py index 27b0f943a026..305fb0675aba 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_client.py @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials import TokenCredential diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py index 7b345a8b7492..ee040c98e01a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py @@ -87,7 +87,9 @@ def build_conversation_analysis_request(**kwargs: Any) -> HttpRequest: class ConversationAnalysisClientOperationsMixin(MixinABC): @overload def analyze_conversation(self, task: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. + """Analyzes the input conversation utterance. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation + for more information. :param task: A single conversational task to execute. Required. :type task: JSON @@ -202,7 +204,9 @@ def analyze_conversation(self, task: JSON, *, content_type: str = "application/j @overload def analyze_conversation(self, task: IO, *, content_type: str = "application/json", **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. + """Analyzes the input conversation utterance. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation + for more information. :param task: A single conversational task to execute. Required. :type task: IO @@ -275,7 +279,9 @@ def analyze_conversation(self, task: IO, *, content_type: str = "application/jso @distributed_trace def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. + """Analyzes the input conversation utterance. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation + for more information. :param task: A single conversational task to execute. Is either a model type or a IO type. Required. @@ -472,7 +478,9 @@ def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. + executed. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -591,7 +599,9 @@ def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. + executed. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -695,7 +705,9 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. + executed. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Is either a model type or a IO type. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_client.py index ad8ba7033741..78c1ed6a2526 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_client.py @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials_async import AsyncTokenCredential diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py index dcd9b297dd48..475472bdeaa5 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py @@ -40,7 +40,9 @@ class ConversationAnalysisClientOperationsMixin(MixinABC): @overload async def analyze_conversation(self, task: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. + """Analyzes the input conversation utterance. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation + for more information. :param task: A single conversational task to execute. Required. :type task: JSON @@ -155,7 +157,9 @@ async def analyze_conversation(self, task: JSON, *, content_type: str = "applica @overload async def analyze_conversation(self, task: IO, *, content_type: str = "application/json", **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. + """Analyzes the input conversation utterance. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation + for more information. :param task: A single conversational task to execute. Required. :type task: IO @@ -228,7 +232,9 @@ async def analyze_conversation(self, task: IO, *, content_type: str = "applicati @distributed_trace_async async def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. + """Analyzes the input conversation utterance. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation + for more information. :param task: A single conversational task to execute. Is either a model type or a IO type. Required. @@ -425,7 +431,9 @@ async def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. + executed. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -544,7 +552,9 @@ async def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. + executed. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -648,7 +658,9 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. + executed. See + https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Is either a model type or a IO type. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py index 9dc9ef312dea..f22612cdaf6d 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials import TokenCredential diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py index b1a77a86af6d..b579e1ec2f34 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py @@ -812,7 +812,9 @@ def build_list_training_config_versions_request( class ConversationAuthoringClientOperationsMixin(MixinABC): # pylint: disable=too-many-public-methods @distributed_trace def list_projects(self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any) -> Iterable[JSON]: - """Lists the existing projects. + """Lists the existing projects. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-projects + for more information. :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -925,7 +927,9 @@ def get_next(next_link=None): def create_project( self, project_name: str, project: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Creates a new project or updates an existing one. + """Creates a new project or updates an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -990,7 +994,9 @@ def create_project( def create_project( self, project_name: str, project: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Creates a new project or updates an existing one. + """Creates a new project or updates an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1035,7 +1041,9 @@ def create_project( @distributed_trace def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: Any) -> JSON: - """Creates a new project or updates an existing one. + """Creates a new project or updates an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1142,7 +1150,9 @@ def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: @distributed_trace def get_project(self, project_name: str, **kwargs: Any) -> JSON: - """Gets the details of a project. + """Gets the details of a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1278,7 +1288,9 @@ def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Optional[ @distributed_trace def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[JSON]: - """Deletes a project. + """Deletes a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1469,7 +1481,9 @@ def begin_export_project( asset_kind: Optional[str] = None, **kwargs: Any ) -> LROPoller[JSON]: - """Triggers a job to export a project's data. + """Triggers a job to export a project's data. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/export for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1687,7 +1701,9 @@ def begin_import_project( **kwargs: Any ) -> LROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. + that project is replaced. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1897,7 +1913,9 @@ def begin_import_project( **kwargs: Any ) -> LROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. + that project is replaced. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1989,7 +2007,9 @@ def begin_import_project( **kwargs: Any ) -> LROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. + that project is replaced. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2191,7 +2211,9 @@ def _train_initial(self, project_name: str, configuration: Union[JSON, IO], **kw def begin_train( self, project_name: str, configuration: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Triggers a training job for a project. + """Triggers a training job for a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2328,7 +2350,9 @@ def begin_train( def begin_train( self, project_name: str, configuration: IO, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Triggers a training job for a project. + """Triggers a training job for a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2442,7 +2466,9 @@ def begin_train( @distributed_trace def begin_train(self, project_name: str, configuration: Union[JSON, IO], **kwargs: Any) -> LROPoller[JSON]: - """Triggers a training job for a project. + """Triggers a training job for a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2609,7 +2635,9 @@ def get_long_running_output(pipeline_response): def list_deployments( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the deployments belonging to a project. + """Lists the deployments belonging to a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployments + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2780,7 +2808,9 @@ def _swap_deployments_initial( def begin_swap_deployments( self, project_name: str, deployments: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Swaps two existing deployments with each other. + """Swaps two existing deployments with each other. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2871,7 +2901,9 @@ def begin_swap_deployments( def begin_swap_deployments( self, project_name: str, deployments: IO, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Swaps two existing deployments with each other. + """Swaps two existing deployments with each other. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2952,7 +2984,9 @@ def begin_swap_deployments( @distributed_trace def begin_swap_deployments(self, project_name: str, deployments: Union[JSON, IO], **kwargs: Any) -> LROPoller[JSON]: - """Swaps two existing deployments with each other. + """Swaps two existing deployments with each other. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3084,7 +3118,9 @@ def get_long_running_output(pipeline_response): @distributed_trace def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> JSON: - """Gets the details of a deployment. + """Gets the details of a deployment. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3234,7 +3270,9 @@ def begin_deploy_project( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Creates a new deployment or replaces an existing one. + """Creates a new deployment or replaces an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3289,7 +3327,9 @@ def begin_deploy_project( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Creates a new deployment or replaces an existing one. + """Creates a new deployment or replaces an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3333,7 +3373,9 @@ def begin_deploy_project( def begin_deploy_project( self, project_name: str, deployment_name: str, deployment: Union[JSON, IO], **kwargs: Any ) -> LROPoller[JSON]: - """Creates a new deployment or replaces an existing one. + """Creates a new deployment or replaces an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3480,7 +3522,9 @@ def _delete_deployment_initial(self, project_name: str, deployment_name: str, ** @distributed_trace def begin_delete_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> LROPoller[JSON]: - """Deletes a project deployment. + """Deletes a project deployment. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3606,7 +3650,9 @@ def get_long_running_output(pipeline_response): @distributed_trace def get_deployment_job_status(self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing deployment job. + """Gets the status of an existing deployment job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3724,7 +3770,9 @@ def get_deployment_job_status(self, project_name: str, deployment_name: str, job @distributed_trace def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing swap deployment job. + """Gets the status of an existing swap deployment job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3840,6 +3888,9 @@ def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwar @distributed_trace def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: """Gets the status of an export job. Once job completes, returns the project metadata, and assets. + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3956,7 +4007,9 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs @distributed_trace def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for an import. + """Gets the status for an import. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4073,7 +4126,9 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs def list_trained_models( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the trained models belonging to a project. + """Lists the trained models belonging to a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4174,7 +4229,9 @@ def get_next(next_link=None): @distributed_trace def get_trained_model(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: - """Gets the details of a trained model. + """Gets the details of a trained model. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-trained-model + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4249,7 +4306,9 @@ def get_trained_model(self, project_name: str, trained_model_label: str, **kwarg def delete_trained_model( # pylint: disable=inconsistent-return-statements self, project_name: str, trained_model_label: str, **kwargs: Any ) -> None: - """Deletes an existing trained model. + """Deletes an existing trained model. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-trained-model + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4309,7 +4368,9 @@ def list_model_evaluation_results( **kwargs: Any ) -> Iterable[JSON]: """Gets the detailed results of the evaluation for a trained model. This includes the raw - inference results for the data included in the evaluation process. + inference results for the data included in the evaluation process. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-results + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4441,7 +4502,9 @@ def get_next(next_link=None): @distributed_trace def get_model_evaluation_summary(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. + measurements of the model e.g., F1, Precision, Recall, etc. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4590,7 +4653,9 @@ def get_model_evaluation_summary(self, project_name: str, trained_model_label: s def list_training_jobs( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the non-expired training jobs created for a project. + """Lists the non-expired training jobs created for a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-jobs + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4766,7 +4831,9 @@ def get_next(next_link=None): @distributed_trace def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a training job. + """Gets the status for a training job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-training-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4968,7 +5035,9 @@ def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: @distributed_trace def begin_cancel_training_job(self, project_name: str, job_id: str, **kwargs: Any) -> LROPoller[JSON]: - """Triggers a cancellation for a running training job. + """Triggers a cancellation for a running training job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/cancel-training-job + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -5127,7 +5196,9 @@ def get_long_running_output(pipeline_response): @distributed_trace def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a project deletion job. + """Gets the status for a project deletion job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project-deletion-status + for more information. :param job_id: The job ID. Required. :type job_id: str @@ -5241,7 +5312,9 @@ def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: def list_supported_languages( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the supported languages for the given project type. + """Lists the supported languages for the given project type. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages + for more information. :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". Required. @@ -5346,7 +5419,9 @@ def list_supported_prebuilt_entities( skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the supported prebuilt entities that can be used while creating composed entities. + """Lists the supported prebuilt entities that can be used while creating composed entities. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-prebuilt-entities + for more information. :keyword language: The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for @@ -5449,7 +5524,9 @@ def get_next(next_link=None): def list_training_config_versions( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the support training config version for a given project type. + """Lists the support training config version for a given project type. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions + for more information. :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py index e3ddd1d4caa3..48f9e9980d6c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials_async import AsyncTokenCredential diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py index c8b1492266e7..ab315d418ddb 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py @@ -74,7 +74,9 @@ class ConversationAuthoringClientOperationsMixin(MixinABC): # pylint: disable=t def list_projects( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the existing projects. + """Lists the existing projects. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-projects + for more information. :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -187,7 +189,9 @@ async def get_next(next_link=None): async def create_project( self, project_name: str, project: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Creates a new project or updates an existing one. + """Creates a new project or updates an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -252,7 +256,9 @@ async def create_project( async def create_project( self, project_name: str, project: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Creates a new project or updates an existing one. + """Creates a new project or updates an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -297,7 +303,9 @@ async def create_project( @distributed_trace_async async def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: Any) -> JSON: - """Creates a new project or updates an existing one. + """Creates a new project or updates an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -404,7 +412,9 @@ async def create_project(self, project_name: str, project: Union[JSON, IO], **kw @distributed_trace_async async def get_project(self, project_name: str, **kwargs: Any) -> JSON: - """Gets the details of a project. + """Gets the details of a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -540,7 +550,9 @@ async def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Opt @distributed_trace_async async def begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncLROPoller[JSON]: - """Deletes a project. + """Deletes a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -732,7 +744,9 @@ async def begin_export_project( asset_kind: Optional[str] = None, **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Triggers a job to export a project's data. + """Triggers a job to export a project's data. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/export for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -951,7 +965,9 @@ async def begin_import_project( **kwargs: Any ) -> AsyncLROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. + that project is replaced. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1161,7 +1177,9 @@ async def begin_import_project( **kwargs: Any ) -> AsyncLROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. + that project is replaced. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1253,7 +1271,9 @@ async def begin_import_project( **kwargs: Any ) -> AsyncLROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. + that project is replaced. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1456,7 +1476,9 @@ async def _train_initial(self, project_name: str, configuration: Union[JSON, IO] async def begin_train( self, project_name: str, configuration: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Triggers a training job for a project. + """Triggers a training job for a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1593,7 +1615,9 @@ async def begin_train( async def begin_train( self, project_name: str, configuration: IO, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Triggers a training job for a project. + """Triggers a training job for a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1709,7 +1733,9 @@ async def begin_train( async def begin_train( self, project_name: str, configuration: Union[JSON, IO], **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Triggers a training job for a project. + """Triggers a training job for a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more + information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1877,7 +1903,9 @@ def get_long_running_output(pipeline_response): def list_deployments( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the deployments belonging to a project. + """Lists the deployments belonging to a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployments + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2048,7 +2076,9 @@ async def _swap_deployments_initial( async def begin_swap_deployments( self, project_name: str, deployments: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Swaps two existing deployments with each other. + """Swaps two existing deployments with each other. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2139,7 +2169,9 @@ async def begin_swap_deployments( async def begin_swap_deployments( self, project_name: str, deployments: IO, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Swaps two existing deployments with each other. + """Swaps two existing deployments with each other. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2222,7 +2254,9 @@ async def begin_swap_deployments( async def begin_swap_deployments( self, project_name: str, deployments: Union[JSON, IO], **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Swaps two existing deployments with each other. + """Swaps two existing deployments with each other. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2355,7 +2389,9 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> JSON: - """Gets the details of a deployment. + """Gets the details of a deployment. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2505,7 +2541,9 @@ async def begin_deploy_project( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Creates a new deployment or replaces an existing one. + """Creates a new deployment or replaces an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2560,7 +2598,9 @@ async def begin_deploy_project( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Creates a new deployment or replaces an existing one. + """Creates a new deployment or replaces an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2604,7 +2644,9 @@ async def begin_deploy_project( async def begin_deploy_project( self, project_name: str, deployment_name: str, deployment: Union[JSON, IO], **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Creates a new deployment or replaces an existing one. + """Creates a new deployment or replaces an existing one. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2756,7 +2798,9 @@ async def _delete_deployment_initial( async def begin_delete_deployment( self, project_name: str, deployment_name: str, **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Deletes a project deployment. + """Deletes a project deployment. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2885,7 +2929,9 @@ def get_long_running_output(pipeline_response): async def get_deployment_job_status( self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any ) -> JSON: - """Gets the status of an existing deployment job. + """Gets the status of an existing deployment job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3003,7 +3049,9 @@ async def get_deployment_job_status( @distributed_trace_async async def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing swap deployment job. + """Gets the status of an existing swap deployment job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3119,6 +3167,9 @@ async def get_swap_deployments_job_status(self, project_name: str, job_id: str, @distributed_trace_async async def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: """Gets the status of an export job. Once job completes, returns the project metadata, and assets. + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3235,7 +3286,9 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** @distributed_trace_async async def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for an import. + """Gets the status for an import. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3352,7 +3405,9 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** def list_trained_models( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the trained models belonging to a project. + """Lists the trained models belonging to a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3453,7 +3508,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get_trained_model(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: - """Gets the details of a trained model. + """Gets the details of a trained model. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-trained-model + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3528,7 +3585,9 @@ async def get_trained_model(self, project_name: str, trained_model_label: str, * async def delete_trained_model( # pylint: disable=inconsistent-return-statements self, project_name: str, trained_model_label: str, **kwargs: Any ) -> None: - """Deletes an existing trained model. + """Deletes an existing trained model. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-trained-model + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3588,7 +3647,9 @@ def list_model_evaluation_results( **kwargs: Any ) -> AsyncIterable[JSON]: """Gets the detailed results of the evaluation for a trained model. This includes the raw - inference results for the data included in the evaluation process. + inference results for the data included in the evaluation process. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-results + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3720,7 +3781,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get_model_evaluation_summary(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. + measurements of the model e.g., F1, Precision, Recall, etc. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -3869,7 +3932,9 @@ async def get_model_evaluation_summary(self, project_name: str, trained_model_la def list_training_jobs( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the non-expired training jobs created for a project. + """Lists the non-expired training jobs created for a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-jobs + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4045,7 +4110,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a training job. + """Gets the status for a training job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-training-status + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4247,7 +4314,9 @@ async def _cancel_training_job_initial(self, project_name: str, job_id: str, **k @distributed_trace_async async def begin_cancel_training_job(self, project_name: str, job_id: str, **kwargs: Any) -> AsyncLROPoller[JSON]: - """Triggers a cancellation for a running training job. + """Triggers a cancellation for a running training job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/cancel-training-job + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -4407,7 +4476,9 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a project deletion job. + """Gets the status for a project deletion job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project-deletion-status + for more information. :param job_id: The job ID. Required. :type job_id: str @@ -4521,7 +4592,9 @@ async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> J def list_supported_languages( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the supported languages for the given project type. + """Lists the supported languages for the given project type. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages + for more information. :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". Required. @@ -4626,7 +4699,9 @@ def list_supported_prebuilt_entities( skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the supported prebuilt entities that can be used while creating composed entities. + """Lists the supported prebuilt entities that can be used while creating composed entities. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-prebuilt-entities + for more information. :keyword language: The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for @@ -4729,7 +4804,9 @@ async def get_next(next_link=None): def list_training_config_versions( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the support training config version for a given project type. + """Lists the support training config version for a given project type. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions + for more information. :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md index b8bbaff55404..c7fd322f9077 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md @@ -71,6 +71,24 @@ Customizations that should eventually be added to central autorest configuration ### General customizations +#### Add rest api docs to operations + +```yaml +directive: +- from: analyzeconversations-authoring.json + where: $.paths.*.* + transform: | + var operationId = $.operationId.replace(/_/g, "/").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); + $.description = $.description + " See https://learn.microsoft.com/rest/api/language/" + operationId + " for more information."; +- from: analyzeconversations.json + where: $.paths.*.* + transform: | + var operationId = $.operationId.replace(/_/g, "/").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().split("/")[1]; + $.description = $.description + " See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/" + operationId + " for more information."; +``` + + + ```yaml directive: # Support automatically generating code for key credentials. From c00513c214767df936d524b276f3f383a95ca9bb Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Wed, 28 Sep 2022 16:29:31 -0700 Subject: [PATCH 3/7] remove patched docstrings for authoring, swagger transform now works to include rest api docs --- .../authoring/_operations/_patch.py | 1889 +---------------- .../authoring/aio/_operations/_patch.py | 1885 +--------------- 2 files changed, 2 insertions(+), 3772 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py index d5f72c042ec5..b02015d5ac49 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py @@ -7,1896 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ from typing import List -from ._operations import ( - ConversationAuthoringClientOperationsMixin as ConversationAuthoringClientOperationsMixinGenerated, -) -ConversationAuthoringClientOperationsMixinGenerated.list_projects.__doc__ = """Lists the existing projects. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-projects - for more information. - - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation - datetime. Required. - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 representation of - a language. For example, use "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project - creation datetime. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last trained datetime. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent with the - highest confidence, at which the prediction will automatically be changed to - "None". Required. - } - } - """ - - -ConversationAuthoringClientOperationsMixinGenerated.create_project.__doc__ = """Creates a new project or updates an existing one. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param project: The project parameters. Is either a model type or a IO type. Required. - :type project: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: - 'application/merge-patch+json'. Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - project = { - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 representation of - a language. For example, use "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent with the - highest confidence, at which the prediction will automatically be changed to - "None". Required. - } - } - - # response body for status code(s): 200, 201 - response == { - "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation - datetime. Required. - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 representation of - a language. For example, use "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project - creation datetime. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last trained datetime. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent with the - highest confidence, at which the prediction will automatically be changed to - "None". Required. - } - } - """ - - -ConversationAuthoringClientOperationsMixinGenerated.get_project.__doc__ = """Gets the details of a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project for - more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation - datetime. Required. - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 representation of - a language. For example, use "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project - creation datetime. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last trained datetime. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent with the - highest confidence, at which the prediction will automatically be changed to - "None". Required. - } - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_delete_project.__doc__ = """Deletes a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-project - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_export_project.__doc__ = """Triggers a job to export a project's data. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/export for more - information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword string_index_type: Specifies the method used to interpret string offsets. For - additional information see https://aka.ms/text-analytics-offsets. "Utf16CodeUnit" Required. - :paramtype string_index_type: str - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str - :keyword asset_kind: Kind of asset to export. Default value is None. - :paramtype asset_kind: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "resultUrl": "str", # Optional. The URL to use in order to download the - exported project. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - - -ConversationAuthoringClientOperationsMixinGenerated.begin_import_project.__doc__ = """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more - information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param project: The project data to import. Is either a model type or a IO type. Required. - :type project: JSON or IO - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - project = { - "assets": exported_project_assets, - "metadata": { - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 - representation of a language. For example, use "en" for English, "en-gb" for - English (UK), "es" for Spanish etc. Required. - "multilingual": bool, # Optional. Whether the project would be used - for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known - values are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent - with the highest confidence, at which the prediction will automatically - be changed to "None". Required. - } - }, - "projectFileVersion": "str", # The version of the exported file. Required. - "stringIndexType": "str" # Specifies the method used to interpret string - offsets. For additional information see https://aka.ms/text-analytics-offsets. - Required. "Utf16CodeUnit" - } - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_train.__doc__ = """Triggers a training job for a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more - information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param configuration: The training input parameters. Is either a model type or a IO type. - Required. - :type configuration: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - configuration = { - "evaluationOptions": { - "kind": "str", # Optional. Represents the evaluation kind. By - default, the evaluation kind is set to percentage. Known values are: - "percentage" and "manual". - "testingSplitPercentage": 0, # Optional. Represents the testing - dataset split percentage. Only needed in case the evaluation kind is - percentage. - "trainingSplitPercentage": 0 # Optional. Represents the training - dataset split percentage. Only needed in case the evaluation kind is - percentage. - }, - "modelLabel": "str", # Represents the output model label. Required. - "trainingConfigVersion": "str", # Optional. Represents training config - version. By default, "latest" value is used which uses the latest released - training config version. - "trainingMode": "str" # Represents the mode of the training operation. - Required. Known values are: "advanced" and "standard". - } - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_deployments.__doc__ = """Lists the deployments belonging to a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployments - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "deploymentExpirationDate": "2020-02-20", # Represents deployment expiration - date in the runtime. Required. - "deploymentName": "str", # Represents deployment name. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Represents deployment last - deployed time. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last - trained time. Required. - "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config - version. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_swap_deployments.__doc__ = """Swaps two existing deployments with each other. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployments: The job object to swap two deployments. Is either a model type or a IO - type. Required. - :type deployments: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - deployments = { - "firstDeploymentName": "str", # Represents the first deployment name. - Required. - "secondDeploymentName": "str" # Represents the second deployment name. - Required. - } - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_deployment.__doc__ = """Gets the details of a deployment. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "deploymentExpirationDate": "2020-02-20", # Represents deployment expiration - date in the runtime. Required. - "deploymentName": "str", # Represents deployment name. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Represents deployment last - deployed time. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last - trained time. Required. - "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config - version. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_deploy_project.__doc__ = """Creates a new deployment or replaces an existing one. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param deployment: The new deployment info. Is either a model type or a IO type. Required. - :type deployment: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - deployment = { - "trainedModelLabel": "str" # Represents the trained model label. Required. - } - - # response body for status code(s): 200 - response == { - "deploymentExpirationDate": "2020-02-20", # Represents deployment expiration - date in the runtime. Required. - "deploymentName": "str", # Represents deployment name. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Represents deployment last - deployed time. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last - trained time. Required. - "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config - version. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_delete_deployment.__doc__ = """Deletes a project deployment. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_deployment_job_status.__doc__ = """Gets the status of an existing deployment job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_swap_deployments_job_status.__doc__ = """Gets the status of an existing swap deployment job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_export_project_job_status.__doc__ = """Gets the status of an export job. Once job completes, returns the project metadata, and assets. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "resultUrl": "str", # Optional. The URL to use in order to download the - exported project. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_import_project_job_status.__doc__ = """Gets the status for an import. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_trained_models.__doc__ = """Lists the trained models belonging to a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "label": "str", # The trained model label. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # The last trained date time - of the model. Required. - "lastTrainingDurationInSeconds": 0, # The duration of the model's last - training request in seconds. Required. - "modelExpirationDate": "2020-02-20", # The model expiration date. Required. - "modelId": "str", # The model ID. Required. - "modelTrainingConfigVersion": "str" # The model training config version. - Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_trained_model.__doc__ = """Gets the details of a trained model. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-trained-model - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "label": "str", # The trained model label. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # The last trained date time - of the model. Required. - "lastTrainingDurationInSeconds": 0, # The duration of the model's last - training request in seconds. Required. - "modelExpirationDate": "2020-02-20", # The model expiration date. Required. - "modelId": "str", # The model ID. Required. - "modelTrainingConfigVersion": "str" # The model training config version. - Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.delete_trained_model.__doc__ = """Deletes an existing trained model. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-trained-model - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_model_evaluation_results.__doc__ = """Gets the detailed results of the evaluation for a trained model. This includes the raw - inference results for the data included in the evaluation process. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-results - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :keyword string_index_type: Specifies the method used to interpret string offsets. For - additional information see https://aka.ms/text-analytics-offsets. "Utf16CodeUnit" Required. - :paramtype string_index_type: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "entitiesResult": { - "expectedEntities": [ - { - "category": "str", # Represents the entity category. - Required. - "length": 0, # Represents the entity length. - Required. - "offset": 0 # Represents the entity offset index - relative to the original text. Required. - } - ], - "predictedEntities": [ - { - "category": "str", # Represents the entity category. - Required. - "length": 0, # Represents the entity length. - Required. - "offset": 0 # Represents the entity offset index - relative to the original text. Required. - } - ] - }, - "intentsResult": { - "expectedIntent": "str", # Represents the utterance's expected - intent. Required. - "predictedIntent": "str" # Represents the utterance's predicted - intent. Required. - }, - "language": "str", # Represents the utterance language. This is BCP-47 - representation of a language. For example, use "en" for English, "en-gb" for - English (UK), "es" for Spanish etc. Required. - "text": "str" # Represents the utterance text. Required. - } - """ - - -ConversationAuthoringClientOperationsMixinGenerated.get_model_evaluation_summary.__doc__ = """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "entitiesEvaluation": { - "confusionMatrix": { - "str": { - "str": { - "normalizedValue": 0.0, # Represents - normalized value in percentages. Required. - "rawValue": 0.0 # Represents raw value. - Required. - } - } - }, - "entities": { - "str": { - "f1": 0.0, # Represents the model precision. - Required. - "falseNegativeCount": 0, # Represents the count of - false negative. Required. - "falsePositiveCount": 0, # Represents the count of - false positive. Required. - "precision": 0.0, # Represents the model recall. - Required. - "recall": 0.0, # Represents the model F1 score. - Required. - "trueNegativeCount": 0, # Represents the count of - true negative. Required. - "truePositiveCount": 0 # Represents the count of - true positive. Required. - } - }, - "macroF1": 0.0, # Represents the macro F1. Required. - "macroPrecision": 0.0, # Represents the macro precision. Required. - "macroRecall": 0.0, # Represents the macro recall. Required. - "microF1": 0.0, # Represents the micro F1. Required. - "microPrecision": 0.0, # Represents the micro precision. Required. - "microRecall": 0.0 # Represents the micro recall. Required. - }, - "evaluationOptions": { - "kind": "str", # Optional. Represents the evaluation kind. By - default, the evaluation kind is set to percentage. Known values are: - "percentage" and "manual". - "testingSplitPercentage": 0, # Optional. Represents the testing - dataset split percentage. Only needed in case the evaluation kind is - percentage. - "trainingSplitPercentage": 0 # Optional. Represents the training - dataset split percentage. Only needed in case the evaluation kind is - percentage. - }, - "intentsEvaluation": { - "confusionMatrix": { - "str": { - "str": { - "normalizedValue": 0.0, # Represents - normalized value in percentages. Required. - "rawValue": 0.0 # Represents raw value. - Required. - } - } - }, - "intents": { - "str": { - "f1": 0.0, # Represents the model precision. - Required. - "falseNegativeCount": 0, # Represents the count of - false negative. Required. - "falsePositiveCount": 0, # Represents the count of - false positive. Required. - "precision": 0.0, # Represents the model recall. - Required. - "recall": 0.0, # Represents the model F1 score. - Required. - "trueNegativeCount": 0, # Represents the count of - true negative. Required. - "truePositiveCount": 0 # Represents the count of - true positive. Required. - } - }, - "macroF1": 0.0, # Represents the macro F1. Required. - "macroPrecision": 0.0, # Represents the macro precision. Required. - "macroRecall": 0.0, # Represents the macro recall. Required. - "microF1": 0.0, # Represents the micro F1. Required. - "microPrecision": 0.0, # Represents the micro precision. Required. - "microRecall": 0.0 # Represents the micro recall. Required. - } - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_training_jobs.__doc__ = """Lists the non-expired training jobs created for a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-jobs - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_training_job_status.__doc__ = """Gets the status for a training job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-training-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_cancel_training_job.__doc__ = """Triggers a cancellation for a running training job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/cancel-training-job - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_project_deletion_job_status.__doc__ = """Gets the status for a project deletion job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project-deletion-status - for more information. - - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_supported_languages.__doc__ = """Lists the supported languages for the given project type. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages - for more information. - - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. - :paramtype project_kind: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "languageCode": "str", # The language code. This is BCP-47 representation of - a language. For example, "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "languageName": "str" # The language name. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_supported_prebuilt_entities.__doc__ = """Lists the supported prebuilt entities that can be used while creating composed entities. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-prebuilt-entities - for more information. - - :keyword language: The language to get supported prebuilt entities for. Required if - multilingual is false. This is BCP-47 representation of a language. For example, use "en" for - English, "en-gb" for English (UK), "es" for Spanish etc. Default value is None. - :paramtype language: str - :keyword multilingual: Whether to get the support prebuilt entities for multilingual or - monolingual projects. If true, the language parameter is ignored. Default value is None. - :paramtype multilingual: bool - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "category": "str", # The prebuilt entity category. Required. - "description": "str", # The description. Required. - "examples": "str" # English examples for the entity. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_training_config_versions.__doc__ = """Lists the support training config version for a given project type. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions - for more information. - - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. - :paramtype project_kind: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "modelExpirationDate": "2020-02-20", # Represents the training config - version expiration date. Required. - "trainingConfigVersion": "str" # Represents the version of the config. - Required. - } - """ - - -class ConversationAuthoringClientOperationsMixin(ConversationAuthoringClientOperationsMixinGenerated): - ... - - -__all__: List[str] = [ - "ConversationAuthoringClientOperationsMixin" -] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py index 279f40c7d65e..f7dd32510333 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py @@ -7,1891 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ from typing import List -from ._operations import ( - ConversationAuthoringClientOperationsMixin as ConversationAuthoringClientOperationsMixinGenerated, -) -ConversationAuthoringClientOperationsMixinGenerated.list_projects.__doc__ = """Lists the existing projects. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-projects - for more information. - - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation - datetime. Required. - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 representation of - a language. For example, use "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project - creation datetime. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last trained datetime. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent with the - highest confidence, at which the prediction will automatically be changed to - "None". Required. - } - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.create_project.__doc__ = """Creates a new project or updates an existing one. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param project: The project parameters. Is either a model type or a IO type. Required. - :type project: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: - 'application/merge-patch+json'. Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - project = { - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 representation of - a language. For example, use "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent with the - highest confidence, at which the prediction will automatically be changed to - "None". Required. - } - } - - # response body for status code(s): 200, 201 - response == { - "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation - datetime. Required. - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 representation of - a language. For example, use "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project - creation datetime. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last trained datetime. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent with the - highest confidence, at which the prediction will automatically be changed to - "None". Required. - } - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_project.__doc__ = """Gets the details of a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project for - more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # Represents the project creation - datetime. Required. - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 representation of - a language. For example, use "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last deployed datetime. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project - creation datetime. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Optional. Represents the - project last trained datetime. - "multilingual": bool, # Optional. Whether the project would be used for - multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent with the - highest confidence, at which the prediction will automatically be changed to - "None". Required. - } - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_delete_project.__doc__ = """Deletes a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-project - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_export_project.__doc__ = """Triggers a job to export a project's data. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/export for more - information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword string_index_type: Specifies the method used to interpret string offsets. For - additional information see https://aka.ms/text-analytics-offsets. "Utf16CodeUnit" Required. - :paramtype string_index_type: str - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str - :keyword asset_kind: Kind of asset to export. Default value is None. - :paramtype asset_kind: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "resultUrl": "str", # Optional. The URL to use in order to download the - exported project. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_import_project.__doc__ = """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more - information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param project: The project data to import. Is either a model type or a IO type. Required. - :type project: JSON or IO - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False - for this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - project = { - "assets": exported_project_assets, - "metadata": { - "description": "str", # Optional. The project description. - "language": "str", # The project language. This is BCP-47 - representation of a language. For example, use "en" for English, "en-gb" for - English (UK), "es" for Spanish etc. Required. - "multilingual": bool, # Optional. Whether the project would be used - for multiple languages or not. - "projectKind": "str", # Represents the project kind. Required. Known - values are: "Conversation" and "Orchestration". - "projectName": "str", # The new project name. Required. - "settings": { - "confidenceThreshold": 0.0 # The threshold of the intent - with the highest confidence, at which the prediction will automatically - be changed to "None". Required. - } - }, - "projectFileVersion": "str", # The version of the exported file. Required. - "stringIndexType": "str" # Specifies the method used to interpret string - offsets. For additional information see https://aka.ms/text-analytics-offsets. - Required. "Utf16CodeUnit" - } - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_train.__doc__ = """Triggers a training job for a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more - information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param configuration: The training input parameters. Is either a model type or a IO type. - Required. - :type configuration: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False - for this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - configuration = { - "evaluationOptions": { - "kind": "str", # Optional. Represents the evaluation kind. By - default, the evaluation kind is set to percentage. Known values are: - "percentage" and "manual". - "testingSplitPercentage": 0, # Optional. Represents the testing - dataset split percentage. Only needed in case the evaluation kind is - percentage. - "trainingSplitPercentage": 0 # Optional. Represents the training - dataset split percentage. Only needed in case the evaluation kind is - percentage. - }, - "modelLabel": "str", # Represents the output model label. Required. - "trainingConfigVersion": "str", # Optional. Represents training config - version. By default, "latest" value is used which uses the latest released - training config version. - "trainingMode": "str" # Represents the mode of the training operation. - Required. Known values are: "advanced" and "standard". - } - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_deployments.__doc__ = """Lists the deployments belonging to a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployments - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "deploymentExpirationDate": "2020-02-20", # Represents deployment expiration - date in the runtime. Required. - "deploymentName": "str", # Represents deployment name. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Represents deployment last - deployed time. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last - trained time. Required. - "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config - version. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_swap_deployments.__doc__ = """Swaps two existing deployments with each other. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployments: The job object to swap two deployments. Is either a model type or a IO - type. Required. - :type deployments: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False - for this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - deployments = { - "firstDeploymentName": "str", # Represents the first deployment name. - Required. - "secondDeploymentName": "str" # Represents the second deployment name. - Required. - } - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_deployment.__doc__ = """Gets the details of a deployment. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "deploymentExpirationDate": "2020-02-20", # Represents deployment expiration - date in the runtime. Required. - "deploymentName": "str", # Represents deployment name. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Represents deployment last - deployed time. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last - trained time. Required. - "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config - version. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_deploy_project.__doc__ = """Creates a new deployment or replaces an existing one. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param deployment: The new deployment info. Is either a model type or a IO type. Required. - :type deployment: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False - for this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - deployment = { - "trainedModelLabel": "str" # Represents the trained model label. Required. - } - - # response body for status code(s): 200 - response == { - "deploymentExpirationDate": "2020-02-20", # Represents deployment expiration - date in the runtime. Required. - "deploymentName": "str", # Represents deployment name. Required. - "lastDeployedDateTime": "2020-02-20 00:00:00", # Represents deployment last - deployed time. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last - trained time. Required. - "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config - version. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_delete_deployment.__doc__ = """Deletes a project deployment. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_deployment_job_status.__doc__ = """Gets the status of an existing deployment job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_swap_deployments_job_status.__doc__ = """Gets the status of an existing swap deployment job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_export_project_job_status.__doc__ = """Gets the status of an export job. Once job completes, returns the project metadata, and assets. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "resultUrl": "str", # Optional. The URL to use in order to download the - exported project. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_import_project_job_status.__doc__ = """Gets the status for an import. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_trained_models.__doc__ = """Lists the trained models belonging to a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "label": "str", # The trained model label. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # The last trained date time - of the model. Required. - "lastTrainingDurationInSeconds": 0, # The duration of the model's last - training request in seconds. Required. - "modelExpirationDate": "2020-02-20", # The model expiration date. Required. - "modelId": "str", # The model ID. Required. - "modelTrainingConfigVersion": "str" # The model training config version. - Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_trained_model.__doc__ = """Gets the details of a trained model. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-trained-model - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "label": "str", # The trained model label. Required. - "lastTrainedDateTime": "2020-02-20 00:00:00", # The last trained date time - of the model. Required. - "lastTrainingDurationInSeconds": 0, # The duration of the model's last - training request in seconds. Required. - "modelExpirationDate": "2020-02-20", # The model expiration date. Required. - "modelId": "str", # The model ID. Required. - "modelTrainingConfigVersion": "str" # The model training config version. - Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.delete_trained_model.__doc__ = """Deletes an existing trained model. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-trained-model - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_model_evaluation_results.__doc__ = """Gets the detailed results of the evaluation for a trained model. This includes the raw - inference results for the data included in the evaluation process. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-results - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :keyword string_index_type: Specifies the method used to interpret string offsets. For - additional information see https://aka.ms/text-analytics-offsets. "Utf16CodeUnit" Required. - :paramtype string_index_type: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "entitiesResult": { - "expectedEntities": [ - { - "category": "str", # Represents the entity category. - Required. - "length": 0, # Represents the entity length. - Required. - "offset": 0 # Represents the entity offset index - relative to the original text. Required. - } - ], - "predictedEntities": [ - { - "category": "str", # Represents the entity category. - Required. - "length": 0, # Represents the entity length. - Required. - "offset": 0 # Represents the entity offset index - relative to the original text. Required. - } - ] - }, - "intentsResult": { - "expectedIntent": "str", # Represents the utterance's expected - intent. Required. - "predictedIntent": "str" # Represents the utterance's predicted - intent. Required. - }, - "language": "str", # Represents the utterance language. This is BCP-47 - representation of a language. For example, use "en" for English, "en-gb" for - English (UK), "es" for Spanish etc. Required. - "text": "str" # Represents the utterance text. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_model_evaluation_summary.__doc__ = """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "entitiesEvaluation": { - "confusionMatrix": { - "str": { - "str": { - "normalizedValue": 0.0, # Represents - normalized value in percentages. Required. - "rawValue": 0.0 # Represents raw value. - Required. - } - } - }, - "entities": { - "str": { - "f1": 0.0, # Represents the model precision. - Required. - "falseNegativeCount": 0, # Represents the count of - false negative. Required. - "falsePositiveCount": 0, # Represents the count of - false positive. Required. - "precision": 0.0, # Represents the model recall. - Required. - "recall": 0.0, # Represents the model F1 score. - Required. - "trueNegativeCount": 0, # Represents the count of - true negative. Required. - "truePositiveCount": 0 # Represents the count of - true positive. Required. - } - }, - "macroF1": 0.0, # Represents the macro F1. Required. - "macroPrecision": 0.0, # Represents the macro precision. Required. - "macroRecall": 0.0, # Represents the macro recall. Required. - "microF1": 0.0, # Represents the micro F1. Required. - "microPrecision": 0.0, # Represents the micro precision. Required. - "microRecall": 0.0 # Represents the micro recall. Required. - }, - "evaluationOptions": { - "kind": "str", # Optional. Represents the evaluation kind. By - default, the evaluation kind is set to percentage. Known values are: - "percentage" and "manual". - "testingSplitPercentage": 0, # Optional. Represents the testing - dataset split percentage. Only needed in case the evaluation kind is - percentage. - "trainingSplitPercentage": 0 # Optional. Represents the training - dataset split percentage. Only needed in case the evaluation kind is - percentage. - }, - "intentsEvaluation": { - "confusionMatrix": { - "str": { - "str": { - "normalizedValue": 0.0, # Represents - normalized value in percentages. Required. - "rawValue": 0.0 # Represents raw value. - Required. - } - } - }, - "intents": { - "str": { - "f1": 0.0, # Represents the model precision. - Required. - "falseNegativeCount": 0, # Represents the count of - false negative. Required. - "falsePositiveCount": 0, # Represents the count of - false positive. Required. - "precision": 0.0, # Represents the model recall. - Required. - "recall": 0.0, # Represents the model F1 score. - Required. - "trueNegativeCount": 0, # Represents the count of - true negative. Required. - "truePositiveCount": 0 # Represents the count of - true positive. Required. - } - }, - "macroF1": 0.0, # Represents the macro F1. Required. - "macroPrecision": 0.0, # Represents the macro precision. Required. - "macroRecall": 0.0, # Represents the macro recall. Required. - "microF1": 0.0, # Represents the micro F1. Required. - "microPrecision": 0.0, # Represents the micro precision. Required. - "microRecall": 0.0 # Represents the micro recall. Required. - } - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_training_jobs.__doc__ = """Lists the non-expired training jobs created for a project. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-jobs - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_training_job_status.__doc__ = """Gets the status for a training job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-training-status - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.begin_cancel_training_job.__doc__ = """Triggers a cancellation for a running training job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/cancel-training-job - for more information. - - :param project_name: The name of the project to use. Required. - :type project_name: str - :param job_id: The job ID. Required. - :type job_id: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "result": { - "estimatedEndDateTime": "2020-02-20 00:00:00", # Optional. - Represents the estimated end date time for training and evaluation. - "evaluationStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - }, - "modelLabel": "str", # Represents trained model label. Required. - "trainingConfigVersion": "str", # Represents training config - version. Required. - "trainingMode": "str", # Optional. Represents the mode of the - training operation. Known values are: "advanced" and "standard". - "trainingStatus": { - "endDateTime": "2020-02-20 00:00:00", # Optional. Represents - the end date time. - "percentComplete": 0, # Represents progress percentage. - Required. - "startDateTime": "2020-02-20 00:00:00", # Optional. - Represents the start date time. - "status": "str" # Represents the status of the - sub-operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - } - }, - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.get_project_deletion_job_status.__doc__ = """Gets the status for a project deletion job. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project-deletion-status - for more information. - - :param job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date - time of the job. - "jobId": "str", # The job ID. Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job - was updated. Required. - "status": "str", # The job status. Required. Known values are: "notStarted", - "running", "succeeded", "failed", "cancelled", "cancelling", and - "partiallyCompleted". - "warnings": [ - { - "code": "str", # The warning code. Required. - "message": "str" # The warning message. Required. - } - ] - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_supported_languages.__doc__ = """Lists the supported languages for the given project type. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages - for more information. - - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. - :paramtype project_kind: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "languageCode": "str", # The language code. This is BCP-47 representation of - a language. For example, "en" for English, "en-gb" for English (UK), "es" for - Spanish etc. Required. - "languageName": "str" # The language name. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_supported_prebuilt_entities.__doc__ = """Lists the supported prebuilt entities that can be used while creating composed entities. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-prebuilt-entities - for more information. - - :keyword language: The language to get supported prebuilt entities for. Required if - multilingual is false. This is BCP-47 representation of a language. For example, use "en" for - English, "en-gb" for English (UK), "es" for Spanish etc. Default value is None. - :paramtype language: str - :keyword multilingual: Whether to get the support prebuilt entities for multilingual or - monolingual projects. If true, the language parameter is ignored. Default value is None. - :paramtype multilingual: bool - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "category": "str", # The prebuilt entity category. Required. - "description": "str", # The description. Required. - "examples": "str" # English examples for the entity. Required. - } - """ - -ConversationAuthoringClientOperationsMixinGenerated.list_training_config_versions.__doc__ = """Lists the support training config version for a given project type. - - See https://docs.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions - for more information. - - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. - :paramtype project_kind: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "modelExpirationDate": "2020-02-20", # Represents the training config - version expiration date. Required. - "trainingConfigVersion": "str" # Represents the version of the config. - Required. - } - """ - - -class ConversationAuthoringClientOperationsMixin(ConversationAuthoringClientOperationsMixinGenerated): - ... - - -__all__: List[str] = [ - "ConversationAuthoringClientOperationsMixin" -] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): From 9b2cc4876950b1526e8e8d71d3a2b8050eef19e3 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Thu, 29 Sep 2022 10:37:28 -0700 Subject: [PATCH 4/7] use swagger transforms to edit docs instead of patch --- .../conversations/_operations/_operations.py | 30 +- .../conversations/_operations/_patch.py | 313 +----------------- .../aio/_operations/_operations.py | 30 +- .../conversations/aio/_operations/_patch.py | 313 +----------------- .../conversations/authoring/_client.py | 3 +- .../conversations/authoring/aio/_client.py | 3 +- .../swagger/README.md | 12 +- 7 files changed, 55 insertions(+), 649 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py index ee040c98e01a..cb50634349f7 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py @@ -478,9 +478,13 @@ def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See - https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more - information. + executed. For examples on calling this method, see the docs. + + Conversation summarization: + https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api + Conversation PII: + https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api + Conversation sentiment analysis: TODO. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -599,9 +603,13 @@ def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See - https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more - information. + executed. For examples on calling this method, see the docs. + + Conversation summarization: + https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api + Conversation PII: + https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api + Conversation sentiment analysis: TODO. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -705,9 +713,13 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See - https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more - information. + executed. For examples on calling this method, see the docs. + + Conversation summarization: + https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api + Conversation PII: + https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api + Conversation sentiment analysis: TODO. :param task: The collection of conversations to analyze and one or more tasks to execute. Is either a model type or a IO type. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_patch.py index 9797ad2cc532..b02015d5ac49 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_patch.py @@ -7,320 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ from typing import List -from ._operations import ConversationAnalysisClientOperationsMixin as ConversationAnalysisClientOperationsMixinGenerated -ConversationAnalysisClientOperationsMixinGenerated.analyze_conversation.__doc__ = """Analyzes the input conversation utterance. - - See https://docs.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation - for more information. - - :param task: A single conversational task to execute. Is either a model type or a IO type. - Required. - :type task: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - task = { - "kind": "str", # Required. Enumeration of supported Conversation tasks. Known values are: "Conversation". - "analysisInput": { - "conversationItem": { - "id": "str", # Required. The ID of a conversation item. - "participantId": "str", # Required. The participant ID of a conversation item. - "modality": "string", # Required, Enumeration of supported conversational modalities. Known values are: "text", and "transcript". - "language": "str", # Optional. The override language of a conversation item in BCP 47 language representation. - "text": "str", # Required. The text input. - "role": "str" # Optional. The role of the participant. Known values are: "agent", "customer", and "generic". - } - }, - "parameters": { - "projectName": "str", # Required. The name of the project to use. - "deploymentName": "str", # Required. The name of the deployment to use. - "stringIndexType": "str", # Optional. Default value is - "TextElements_v8". Specifies the method used to interpret string offsets. Set - to "UnicodeCodePoint" for Python strings. Known values are: - "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit". - "verbose": "bool", # Optional. If true, the service will return more detailed information in the response. - "isLoggingEnabled": "bool", # Optional. If true, the service will keep the query for further review. - "directTarget": "str", # Optional. The name of a target project to forward the request to. - "targetProjectParameters": "dict" # Optional. A dictionary representing the parameters for each target project. - } - } - - # The response is polymorphic. The following are possible polymorphic responses based - off discriminator "kind": - - # response body for status code(s): 200 - response.json() == { - "kind": "str", # Required. Enumeration of supported conversational task results. Known values are: "ConversationResult". - "result": { - "prediction": base_prediction, - "query": "str", # The conversation utterance given by the caller. - Required. - "detectedLanguage": "str" # Optional. The system detected language - for the query in BCP 47 language representation.. - } - } - - # JSON input template for discriminator value "Conversation": - base_prediction = { - "entities": [ - { - "category": "str", # The entity category. Required. - "confidenceScore": 0.0, # The entity confidence score. - Required. - "length": 0, # The length of the text. Required. - "offset": 0, # The starting index of this entity in the - query. Required. - "text": "str", # The predicted entity text. Required. - "extraInformation": [ - base_extra_information - ], - "resolutions": [ - base_resolution - ] - } - ], - "intents": [ - { - "category": "str", # A predicted class. Required. - "confidenceScore": 0.0 # The confidence score of the class - from 0.0 to 1.0. Required. - } - ], - "projectKind": "Conversation", - "topIntent": "str" # Optional. The intent with the highest score. - } - - # JSON input template for discriminator value "Orchestration": - base_prediction = { - "intents": { - "str": target_intent_result - }, - "projectKind": "Orchestration", - "topIntent": "str" # Optional. The intent with the highest score. - } - """ - -ConversationAnalysisClientOperationsMixinGenerated.begin_conversation_analysis.__doc__ = """Submit analysis job for conversations. - - Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. - - :param task: The collection of conversations to analyze and one or more tasks to execute. Is - either a model type or a IO type. Required. - :type task: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns JSON object - :rtype: ~azure.core.polling.LROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - .. versionadded:: 2022-05-15-preview - The *begin_conversation_analysis* client method. - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - task = { - "displayName": "str", # Optional. Display name for the analysis job. - "analysisInput": { - "conversations": [ - ... # A list of text_conversation or transcript_conversation (see below) - ] - }, - "tasks": [ - { - "taskName": "str", # Optional. Associate a name with the task. - "kind": "str", # Required. Known values are "ConversationalPIITask" and "ConversationalSummarizationTask". - "parameters": { - ... # summarization_task_parameters or pii_task_parameters (see below) - } - } - ] - } - - text_conversation = { - "id": "str", # Required. Unique identifier for the conversation. - "language": "str", # Required. The language of the conversation item in BCP-47 format. - "modality": "str", # Required. Known values are: "transcript" and "text". - "domain": "str", # Optional. Known values are "finance", "healthcare", and "generic". - "conversationItems": [ # Ordered list of text conversation items in the conversation. - { - "id": "str", # Required. The ID of a conversation item. - "participantId": "str", # Required. The participant ID of a conversation item. - "modality": "string", # Required. Enumeration of supported conversational modalities. - Known values are: "text", and "transcript". - "language": "str", # Optional. The override language of a conversation item in BCP 47 language - representation. - "role": "str", # Optional. The role of the participant. Known values are: "agent", "customer", - and "generic". - "text": "str" # Required. The text input - } - ] - } - - transcript_conversation = { - "id": "str", # Required. Unique identifier for the conversation. - "language": "str", # Required. The language of the conversation item in BCP-47 format. - "modality": "str", # Required. Known values are: "transcript" and "text". - "domain": "str", # Optional. Known values are "finance", "healthcare", and "generic". - "conversationItems": [ # Ordered list of transcript conversation items in the conversation. - { - "id": "str", # Required. The ID of a conversation item. - "participantId": "str", # Required. The participant ID of a conversation item. - "modality": "string", # Required. Enumeration of supported conversational modalities. - Known values are: "text", and "transcript". - "language": "str", # Optional. The override language of a conversation item in BCP 47 language - representation. - "role": "str", # Optional. The role of the participant. Known values are: "agent", "customer", - and "generic". - "text": "str", # Optional. The display form of the recognized text from speech to text API, - with punctuation and capitalization added. - "itn": "str", # Optional. Inverse Text Normalization representation of input. The inverse - - text - normalized form is the recognized text from Microsoft's Speech to Text API, with - phone numbers, numbers, abbreviations, and other transformations applied. - "maskedItn": "str", # Optional. The Inverse Text Normalized format with profanity masking applied. - "lexical": "str", # Optional. The lexical form of the recognized text from speech to text - API with the actual words recognized. - "audioTimings": [ # Optional. The list of word level audio timing information. - { - "word": "str", # Optional. The word recognized. - "offset": "int", # Optional. Offset from start of speech audio, in ticks. 1 tick = 100 ns. - "duration": "int" # Optional. Duration of word articulation, in ticks. 1 tick = 100 ns. - } - ] - } - ] - } - - summarization_task_parameters = { - "modelVersion": "str", # Optional. The model version to use. Defaults to "latest". - "loggingOptOut": "bool", # Optional. Defaults to false. - "summaryAspects": "array" # Required. A list of summary aspects. Known values are - "issue" and "resolution". - } - - pii_task_parameters = { - "modelVersion": "str", # Optional. The model version to use. Defaults to "latest". - "loggingOptOut": "bool", # Optional. Defaults to false. - "piiCategories": "array", # Optional. Describes the PII categories to return for detection. - If not provided, 'default' categories will be returned which will vary with the language. Known values - are "Address", "CreditCard", "Email", "Name", "NumericIdentifier", "PhoneNumber", "All", "Default". - "redactionSource": "str", # Optional. Supported content types. Known values are "lexical", "itn", - "maskedItn", and "text". - "includeAudioRedaction": "bool" # Optional. Defaults to false. Flag to indicate if audio redaction - is requested. By default audio redaction will not be performed. - } - - # The response is polymorphic. The following are possible polymorphic responses based - off discriminator "kind": - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # Required. - "displayName": "str", # Optional. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. - "jobId": "str", # Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. - "nextLink": "str", # Optional. - "statistics": { - "conversationsCount": 0, # Number of conversations submitted in the - request. Required. - "erroneousConversationsCount": 0, # Number of invalid documents. - This includes empty, over-size limit or non-supported languages documents. - Required. - "transactionsCount": 0, # Number of transactions for the request. - Required. - "validConversationsCount": 0 # Number of conversations documents. - This excludes empty, over-size limit or non-supported languages documents. - Required. - }, - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". - "tasks": { - "completed": 0, # Count of tasks completed successfully. Required. - "failed": 0, # Count of tasks that failed. Required. - "inProgress": 0, # Count of tasks in progress currently. Required. - "items": [ - { - "kind": "str", # Required. Enumeration of supported Conversation Analysis task results. - Known values are: "conversationalSummarizationResults" and "conversationalPIIResults". - "taskName": "str", # Optional. Associated name with the task. - "lastUpdateDateTime": "str", # Required. The last updated time in UTC for the task. - "status": "str", # Required. The status of the task at the mentioned last update time. - Known values are: "notStarted", "running", "succeeded", "failed", "cancelled", "cancelling". - "results": [ - ... - ] # Optional. List of results from tasks (if available). - } - ], - "total": 0 # Total count of tasks submitted as part of the job. - Required. - } - } - """ - - -class ConversationAnalysisClientOperationsMixin(ConversationAnalysisClientOperationsMixinGenerated): - ... - - -__all__: List[str] = [ - "ConversationAnalysisClientOperationsMixin" -] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py index 475472bdeaa5..eefc35f61cb2 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py @@ -431,9 +431,13 @@ async def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See - https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more - information. + executed. For examples on calling this method, see the docs. + + Conversation summarization: + https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api + Conversation PII: + https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api + Conversation sentiment analysis: TODO. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -552,9 +556,13 @@ async def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See - https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more - information. + executed. For examples on calling this method, see the docs. + + Conversation summarization: + https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api + Conversation PII: + https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api + Conversation sentiment analysis: TODO. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -658,9 +666,13 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See - https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/submit-job for more - information. + executed. For examples on calling this method, see the docs. + + Conversation summarization: + https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api + Conversation PII: + https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api + Conversation sentiment analysis: TODO. :param task: The collection of conversations to analyze and one or more tasks to execute. Is either a model type or a IO type. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_patch.py index 511975a6392e..b02015d5ac49 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_patch.py @@ -7,320 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ from typing import List -from ._operations import ConversationAnalysisClientOperationsMixin as ConversationAnalysisClientOperationsMixinGenerated -ConversationAnalysisClientOperationsMixinGenerated.analyze_conversation.__doc__ = """Analyzes the input conversation utterance. - - See https://docs.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation - for more information. - - :param task: A single conversational task to execute. Is either a model type or a IO type. - Required. - :type task: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - task = { - "kind": "str", # Required. Enumeration of supported Conversation tasks. Known values are: "Conversation". - "analysisInput": { - "conversationItem": { - "id": "str", # Required. The ID of a conversation item. - "participantId": "str", # Required. The participant ID of a conversation item. - "modality": "string", # Required, Enumeration of supported conversational modalities. Known values are: "text", and "transcript". - "language": "str", # Optional. The override language of a conversation item in BCP 47 language representation. - "text": "str", # Required. The text input. - "role": "str" # Optional. The role of the participant. Known values are: "agent", "customer", and "generic". - } - }, - "parameters": { - "projectName": "str", # Required. The name of the project to use. - "deploymentName": "str", # Required. The name of the deployment to use. - "stringIndexType": "str", # Optional. Default value is - "TextElements_v8". Specifies the method used to interpret string offsets. Set - to "UnicodeCodePoint" for Python strings. Known values are: - "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit". - "verbose": "bool", # Optional. If true, the service will return more detailed information in the response. - "isLoggingEnabled": "bool", # Optional. If true, the service will keep the query for further review. - "directTarget": "str", # Optional. The name of a target project to forward the request to. - "targetProjectParameters": "dict" # Optional. A dictionary representing the parameters for each target project. - } - } - - # The response is polymorphic. The following are possible polymorphic responses based - off discriminator "kind": - - # response body for status code(s): 200 - response.json() == { - "kind": "str", # Required. Enumeration of supported conversational task results. Known values are: "ConversationResult". - "result": { - "prediction": base_prediction, - "query": "str", # The conversation utterance given by the caller. - Required. - "detectedLanguage": "str" # Optional. The system detected language - for the query in BCP 47 language representation.. - } - } - - # JSON input template for discriminator value "Conversation": - base_prediction = { - "entities": [ - { - "category": "str", # The entity category. Required. - "confidenceScore": 0.0, # The entity confidence score. - Required. - "length": 0, # The length of the text. Required. - "offset": 0, # The starting index of this entity in the - query. Required. - "text": "str", # The predicted entity text. Required. - "extraInformation": [ - base_extra_information - ], - "resolutions": [ - base_resolution - ] - } - ], - "intents": [ - { - "category": "str", # A predicted class. Required. - "confidenceScore": 0.0 # The confidence score of the class - from 0.0 to 1.0. Required. - } - ], - "projectKind": "Conversation", - "topIntent": "str" # Optional. The intent with the highest score. - } - - # JSON input template for discriminator value "Orchestration": - base_prediction = { - "intents": { - "str": target_intent_result - }, - "projectKind": "Orchestration", - "topIntent": "str" # Optional. The intent with the highest score. - } - """ - -ConversationAnalysisClientOperationsMixinGenerated.begin_conversation_analysis.__doc__ = """Submit analysis job for conversations. - - Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. - - :param task: The collection of conversations to analyze and one or more tasks to execute. Is - either a model type or a IO type. Required. - :type task: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False - for this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns JSON object - :rtype: ~azure.core.polling.AsyncLROPoller[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - .. versionadded:: 2022-05-15-preview - The *begin_conversation_analysis* client method. - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - task = { - "displayName": "str", # Optional. Display name for the analysis job. - "analysisInput": { - "conversations": [ - ... # A list of text_conversation or transcript_conversation (see below) - ] - }, - "tasks": [ - { - "taskName": "str", # Optional. Associate a name with the task. - "kind": "str", # Required. Known values are "ConversationalPIITask" and "ConversationalSummarizationTask". - "parameters": { - ... # summarization_task_parameters or pii_task_parameters (see below) - } - } - ] - } - - text_conversation = { - "id": "str", # Required. Unique identifier for the conversation. - "language": "str", # Required. The language of the conversation item in BCP-47 format. - "modality": "str", # Required. Known values are: "transcript" and "text". - "domain": "str", # Optional. Known values are "finance", "healthcare", and "generic". - "conversationItems": [ # Ordered list of text conversation items in the conversation. - { - "id": "str", # Required. The ID of a conversation item. - "participantId": "str", # Required. The participant ID of a conversation item. - "modality": "string", # Required. Enumeration of supported conversational modalities. - Known values are: "text", and "transcript". - "language": "str", # Optional. The override language of a conversation item in BCP 47 language - representation. - "role": "str", # Optional. The role of the participant. Known values are: "agent", "customer", - and "generic". - "text": "str" # Required. The text input - } - ] - } - - transcript_conversation = { - "id": "str", # Required. Unique identifier for the conversation. - "language": "str", # Required. The language of the conversation item in BCP-47 format. - "modality": "str", # Required. Known values are: "transcript" and "text". - "domain": "str", # Optional. Known values are "finance", "healthcare", and "generic". - "conversationItems": [ # Ordered list of transcript conversation items in the conversation. - { - "id": "str", # Required. The ID of a conversation item. - "participantId": "str", # Required. The participant ID of a conversation item. - "modality": "string", # Required. Enumeration of supported conversational modalities. - Known values are: "text", and "transcript". - "language": "str", # Optional. The override language of a conversation item in BCP 47 language - representation. - "role": "str", # Optional. The role of the participant. Known values are: "agent", "customer", - and "generic". - "text": "str", # Optional. The display form of the recognized text from speech to text API, - with punctuation and capitalization added. - "itn": "str", # Optional. Inverse Text Normalization representation of input. The inverse - - text - normalized form is the recognized text from Microsoft's Speech to Text API, with - phone numbers, numbers, abbreviations, and other transformations applied. - "maskedItn": "str", # Optional. The Inverse Text Normalized format with profanity masking applied. - "lexical": "str", # Optional. The lexical form of the recognized text from speech to text - API with the actual words recognized. - "audioTimings": [ # Optional. The list of word level audio timing information. - { - "word": "str", # Optional. The word recognized. - "offset": "int", # Optional. Offset from start of speech audio, in ticks. 1 tick = 100 ns. - "duration": "int" # Optional. Duration of word articulation, in ticks. 1 tick = 100 ns. - } - ] - } - ] - } - - summarization_task_parameters = { - "modelVersion": "str", # Optional. The model version to use. Defaults to "latest". - "loggingOptOut": "bool", # Optional. Defaults to false. - "summaryAspects": "array" # Required. A list of summary aspects. Known values are - "issue" and "resolution". - } - - pii_task_parameters = { - "modelVersion": "str", # Optional. The model version to use. Defaults to "latest". - "loggingOptOut": "bool", # Optional. Defaults to false. - "piiCategories": "array", # Optional. Describes the PII categories to return for detection. - If not provided, 'default' categories will be returned which will vary with the language. Known values - are "Address", "CreditCard", "Email", "Name", "NumericIdentifier", "PhoneNumber", "All", "Default". - "redactionSource": "str", # Optional. Supported content types. Known values are "lexical", "itn", - "maskedItn", and "text". - "includeAudioRedaction": "bool" # Optional. Defaults to false. Flag to indicate if audio redaction - is requested. By default audio redaction will not be performed. - } - - # The response is polymorphic. The following are possible polymorphic responses based - off discriminator "kind": - - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # Required. - "displayName": "str", # Optional. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", - "OperationNotFound", "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchIndexNotFound", "TooManyRequests", - "AzureCognitiveSearchThrottling", - "AzureCognitiveSearchIndexLimitReached", "InternalServerError", - "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and - "Warning". - "details": [ - ... - ], - "innererror": { - "code": "str", # One of a server-defined set of - error codes. Required. Known values are: "InvalidRequest", - "InvalidParameterValue", "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", - "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", - "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", - "InvalidDocumentBatch", "UnsupportedLanguageCode", and - "InvalidCountryHint". - "details": { - "str": "str" # Optional. Error details. - }, - "innererror": ..., - "message": "str", # Error message. Required. - "target": "str" # Optional. Error target. - }, - "message": "str", # A human-readable representation of the - error. Required. - "target": "str" # Optional. The target of the error. - } - ], - "expirationDateTime": "2020-02-20 00:00:00", # Optional. - "jobId": "str", # Required. - "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. - "nextLink": "str", # Optional. - "statistics": { - "conversationsCount": 0, # Number of conversations submitted in the - request. Required. - "erroneousConversationsCount": 0, # Number of invalid documents. - This includes empty, over-size limit or non-supported languages documents. - Required. - "transactionsCount": 0, # Number of transactions for the request. - Required. - "validConversationsCount": 0 # Number of conversations documents. - This excludes empty, over-size limit or non-supported languages documents. - Required. - }, - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". - "tasks": { - "completed": 0, # Count of tasks completed successfully. Required. - "failed": 0, # Count of tasks that failed. Required. - "inProgress": 0, # Count of tasks in progress currently. Required. - "items": [ - { - "kind": "str", # Required. Enumeration of supported Conversation Analysis task results. - Known values are: "conversationalSummarizationResults" and "conversationalPIIResults". - "taskName": "str", # Optional. Associated name with the task. - "lastUpdateDateTime": "str", # Required. The last updated time in UTC for the task. - "status": "str", # Required. The status of the task at the mentioned last update time. - Known values are: "notStarted", "running", "succeeded", "failed", "cancelled", "cancelling". - "results": [ - ... - ] # Optional. List of results from tasks (if available). - } - ], - "total": 0 # Total count of tasks submitted as part of the job. - Required. - } - } - """ - - -class ConversationAnalysisClientOperationsMixin(ConversationAnalysisClientOperationsMixinGenerated): - ... - - -__all__: List[str] = [ - "ConversationAnalysisClientOperationsMixin" -] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py index f22612cdaf6d..d702a4bd8273 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py @@ -28,7 +28,8 @@ class ConversationAuthoringClient( best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in :code:`https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview`. + href="https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview"> + https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview`. :param endpoint: Supported Cognitive Services endpoint (e.g., https://:code:``.cognitiveservices.azure.com). Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py index 48f9e9980d6c..fe225744457a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py @@ -28,7 +28,8 @@ class ConversationAuthoringClient( best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in :code:`https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview`. + href="https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview"> + https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview`. :param endpoint: Supported Cognitive Services endpoint (e.g., https://:code:``.cognitiveservices.azure.com). Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md index c7fd322f9077..ddcf261e4e25 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md @@ -80,11 +80,13 @@ directive: transform: | var operationId = $.operationId.replace(/_/g, "/").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); $.description = $.description + " See https://learn.microsoft.com/rest/api/language/" + operationId + " for more information."; -- from: analyzeconversations.json - where: $.paths.*.* - transform: | - var operationId = $.operationId.replace(/_/g, "/").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().split("/")[1]; - $.description = $.description + " See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/" + operationId + " for more information."; + +- where-operation: AnalyzeConversation_SubmitJob + transform: > + $.description = $.description + " For examples on calling this method, see the docs.\n\nConversation summarization: https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api \nConversation PII: https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api \nConversation sentiment analysis: TODO"; +- where-operation: ConversationAnalysis_AnalyzeConversation + transform: > + $.description = $.description + " See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information."; ``` From da2709146b5d06be336cb312edc5f0de6fde7c96 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Fri, 14 Oct 2022 13:25:02 -0700 Subject: [PATCH 5/7] regen runtime/authoring now that specs are in main --- .../conversations/_operations/_operations.py | 15 +- .../aio/_operations/_operations.py | 15 +- .../conversations/authoring/_client.py | 2 +- .../conversations/authoring/_configuration.py | 4 +- .../authoring/_operations/_operations.py | 2275 +++++++++++++++-- .../conversations/authoring/_patch.py | 5 +- .../conversations/authoring/aio/_client.py | 2 +- .../authoring/aio/_configuration.py | 4 +- .../authoring/aio/_operations/_operations.py | 1928 ++++++++++++-- .../conversations/authoring/aio/_patch.py | 5 +- .../swagger/README.md | 37 +- 11 files changed, 3882 insertions(+), 410 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py index cb50634349f7..048928c31fbe 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py @@ -524,8 +524,9 @@ def begin_conversation_analysis( "createdDateTime": "2020-02-20 00:00:00", # Required. "jobId": "str", # Required. "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "status": "str", # The status of the task at the mentioned last update time. + Required. Known values are: "notStarted", "running", "succeeded", "failed", + "cancelled", "cancelling", and "partiallyCompleted". "tasks": { "completed": 0, # Count of tasks completed successfully. Required. "failed": 0, # Count of tasks that failed. Required. @@ -636,8 +637,9 @@ def begin_conversation_analysis( "createdDateTime": "2020-02-20 00:00:00", # Required. "jobId": "str", # Required. "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "status": "str", # The status of the task at the mentioned last update time. + Required. Known values are: "notStarted", "running", "succeeded", "failed", + "cancelled", "cancelling", and "partiallyCompleted". "tasks": { "completed": 0, # Count of tasks completed successfully. Required. "failed": 0, # Count of tasks that failed. Required. @@ -746,8 +748,9 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L "createdDateTime": "2020-02-20 00:00:00", # Required. "jobId": "str", # Required. "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "status": "str", # The status of the task at the mentioned last update time. + Required. Known values are: "notStarted", "running", "succeeded", "failed", + "cancelled", "cancelling", and "partiallyCompleted". "tasks": { "completed": 0, # Count of tasks completed successfully. Required. "failed": 0, # Count of tasks that failed. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py index eefc35f61cb2..371731c23913 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py @@ -477,8 +477,9 @@ async def begin_conversation_analysis( "createdDateTime": "2020-02-20 00:00:00", # Required. "jobId": "str", # Required. "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "status": "str", # The status of the task at the mentioned last update time. + Required. Known values are: "notStarted", "running", "succeeded", "failed", + "cancelled", "cancelling", and "partiallyCompleted". "tasks": { "completed": 0, # Count of tasks completed successfully. Required. "failed": 0, # Count of tasks that failed. Required. @@ -589,8 +590,9 @@ async def begin_conversation_analysis( "createdDateTime": "2020-02-20 00:00:00", # Required. "jobId": "str", # Required. "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "status": "str", # The status of the task at the mentioned last update time. + Required. Known values are: "notStarted", "running", "succeeded", "failed", + "cancelled", "cancelling", and "partiallyCompleted". "tasks": { "completed": 0, # Count of tasks completed successfully. Required. "failed": 0, # Count of tasks that failed. Required. @@ -699,8 +701,9 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any "createdDateTime": "2020-02-20 00:00:00", # Required. "jobId": "str", # Required. "lastUpdatedDateTime": "2020-02-20 00:00:00", # Required. - "status": "str", # Required. Known values are: "notStarted", "running", - "succeeded", "partiallyCompleted", "failed", "cancelled", and "cancelling". + "status": "str", # The status of the task at the mentioned last update time. + Required. Known values are: "notStarted", "running", "succeeded", "failed", + "cancelled", "cancelling", and "partiallyCompleted". "tasks": { "completed": 0, # Count of tasks completed successfully. Required. "failed": 0, # Count of tasks that failed. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py index d702a4bd8273..0458f41b95a3 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_client.py @@ -36,7 +36,7 @@ class ConversationAuthoringClient( :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-10-01-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 diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_configuration.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_configuration.py index 986253331d76..2836eca613d3 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_configuration.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_configuration.py @@ -29,14 +29,14 @@ class ConversationAuthoringClientConfiguration(Configuration): # pylint: disabl :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: super(ConversationAuthoringClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-05-15-preview") # type: str + api_version = kwargs.pop("api_version", "2022-10-01-preview") # type: str if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py index b579e1ec2f34..e148dd2affb8 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -46,7 +46,7 @@ def build_list_projects_request(*, top: Optional[int] = None, skip: Optional[int _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_create_project_request(project_name: str, **kwargs: Any) -> HttpReques _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_project_request(project_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +120,7 @@ def build_delete_project_request(project_name: str, **kwargs: Any) -> HttpReques _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,12 +146,13 @@ def build_export_project_request( string_index_type: str, exported_project_format: Optional[str] = None, asset_kind: Optional[str] = None, + trained_model_label: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,6 +169,8 @@ def build_export_project_request( _params["stringIndexType"] = _SERIALIZER.query("string_index_type", string_index_type, "str") if asset_kind is not None: _params["assetKind"] = _SERIALIZER.query("asset_kind", asset_kind, "str") + if trained_model_label is not None: + _params["trainedModelLabel"] = _SERIALIZER.query("trained_model_label", trained_model_label, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -183,7 +186,7 @@ def build_import_project_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -212,7 +215,7 @@ def build_train_request(project_name: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +243,7 @@ def build_list_deployments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -269,7 +272,7 @@ def build_swap_deployments_request(project_name: str, **kwargs: Any) -> HttpRequ _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,7 +298,7 @@ def build_get_deployment_request(project_name: str, deployment_name: str, **kwar _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -321,7 +324,7 @@ def build_deploy_project_request(project_name: str, deployment_name: str, **kwar _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +351,7 @@ def build_delete_deployment_request(project_name: str, deployment_name: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -369,13 +372,71 @@ def build_delete_deployment_request(project_name: str, deployment_name: str, **k return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) +def build_delete_deployment_from_resources_request( + project_name: str, deployment_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}/:delete-from-resources" + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_deployment_delete_from_resources_status_request( + project_name: str, deployment_name: str, job_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}/delete-from-resources/jobs/{jobId}" # pylint: disable=line-too-long + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_get_deployment_job_status_request( project_name: str, deployment_name: str, job_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -401,7 +462,7 @@ def build_get_swap_deployments_job_status_request(project_name: str, job_id: str _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -426,7 +487,7 @@ def build_get_export_project_job_status_request(project_name: str, job_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -451,7 +512,7 @@ def build_get_import_project_job_status_request(project_name: str, job_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -478,7 +539,7 @@ def build_list_trained_models_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -506,7 +567,7 @@ def build_get_trained_model_request(project_name: str, trained_model_label: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -531,7 +592,7 @@ def build_delete_trained_model_request(project_name: str, trained_model_label: s _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -552,6 +613,31 @@ def build_delete_trained_model_request(project_name: str, trained_model_label: s return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) +def build_load_snapshot_request(project_name: str, trained_model_label: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/:load-snapshot" + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + "trainedModelLabel": _SERIALIZER.url("trained_model_label", trained_model_label, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_list_model_evaluation_results_request( project_name: str, trained_model_label: str, @@ -564,7 +650,7 @@ def build_list_model_evaluation_results_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -596,7 +682,7 @@ def build_get_model_evaluation_summary_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -619,13 +705,179 @@ def build_get_model_evaluation_summary_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_get_load_snapshot_status_request( + project_name: str, trained_model_label: str, job_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/load-snapshot/jobs/{jobId}" + ) + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + "trainedModelLabel": _SERIALIZER.url("trained_model_label", trained_model_label, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_deployment_resources_request( + project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/{projectName}/resources" + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + if top is not None: + _params["top"] = _SERIALIZER.query("top", top, "int") + if skip is not None: + _params["skip"] = _SERIALIZER.query("skip", skip, "int") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_assign_deployment_resources_request(project_name: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/{projectName}/resources/:assign" + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_unassign_deployment_resources_request(project_name: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/{projectName}/resources/:unassign" + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_assign_deployment_resources_status_request(project_name: str, job_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/{projectName}/resources/assign/jobs/{jobId}" + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_unassign_deployment_resources_status_request( + project_name: str, job_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/{projectName}/resources/unassign/jobs/{jobId}" + path_format_arguments = { + "projectName": _SERIALIZER.url("project_name", project_name, "str", max_length=100), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_list_training_jobs_request( project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -653,7 +905,7 @@ def build_get_training_job_status_request(project_name: str, job_id: str, **kwar _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -678,7 +930,7 @@ def build_cancel_training_job_request(project_name: str, job_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -703,7 +955,7 @@ def build_get_project_deletion_job_status_request(job_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -723,13 +975,38 @@ def build_get_project_deletion_job_status_request(job_id: str, **kwargs: Any) -> return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_list_assigned_resource_deployments_request( + *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/authoring/analyze-conversations/projects/global/deployments/resources" + + # Construct parameters + if top is not None: + _params["top"] = _SERIALIZER.query("top", top, "int") + if skip is not None: + _params["skip"] = _SERIALIZER.query("skip", skip, "int") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_list_supported_languages_request( *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -760,7 +1037,7 @@ def build_list_supported_prebuilt_entities_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -789,7 +1066,7 @@ def build_list_training_config_versions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-15-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -839,7 +1116,7 @@ def list_projects(self, *, top: Optional[int] = None, skip: Optional[int] = None "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -851,8 +1128,11 @@ def list_projects(self, *, top: Optional[int] = None, skip: Optional[int] = None "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ _headers = kwargs.pop("headers", {}) or {} @@ -887,10 +1167,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -951,7 +1238,7 @@ def create_project( a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "multilingual": bool, # Optional. Whether the project would be used for @@ -959,8 +1246,11 @@ def create_project( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } # response body for status code(s): 200, 201 @@ -973,7 +1263,7 @@ def create_project( "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -985,8 +1275,11 @@ def create_project( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ @@ -1022,7 +1315,7 @@ def create_project( "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -1034,8 +1327,11 @@ def create_project( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ @@ -1069,7 +1365,7 @@ def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -1081,8 +1377,11 @@ def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ error_map = { @@ -1173,7 +1472,7 @@ def get_project(self, project_name: str, **kwargs: Any) -> JSON: "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -1185,8 +1484,11 @@ def get_project(self, project_name: str, **kwargs: Any) -> JSON: "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ error_map = { @@ -1414,6 +1716,7 @@ def _export_project_initial( string_index_type: str, exported_project_format: Optional[str] = None, asset_kind: Optional[str] = None, + trained_model_label: Optional[str] = None, **kwargs: Any ) -> Optional[JSON]: error_map = { @@ -1434,6 +1737,7 @@ def _export_project_initial( string_index_type=string_index_type, exported_project_format=exported_project_format, asset_kind=asset_kind, + trained_model_label=trained_model_label, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1479,6 +1783,7 @@ def begin_export_project( string_index_type: str, exported_project_format: Optional[str] = None, asset_kind: Optional[str] = None, + trained_model_label: Optional[str] = None, **kwargs: Any ) -> LROPoller[JSON]: """Triggers a job to export a project's data. See @@ -1495,6 +1800,9 @@ def begin_export_project( :paramtype exported_project_format: str :keyword asset_kind: Kind of asset to export. Default value is None. :paramtype asset_kind: str + :keyword trained_model_label: Trained model label to export. If the trainedModelLabel is null, + the default behavior is to export the current working copy. Default value is None. + :paramtype trained_model_label: str :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal @@ -1579,6 +1887,7 @@ def begin_export_project( string_index_type=string_index_type, exported_project_format=exported_project_format, asset_kind=asset_kind, + trained_model_label=trained_model_label, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1768,6 +2077,24 @@ def begin_import_project( "category": "str" # The prebuilt entity category. Required. } + ], + "regex": { + "expressions": [ + { + "language": "str", # Optional. + Represents the language of the regex expression. This is + BCP-47 representation of a language. For example, use "en" + for English, "en-gb" for English (UK), "es" for Spanish etc. + "regexKey": "str", # Optional. The + key of the regex expression. + "regexPattern": "str" # Optional. + The regex pattern. + } + ] + }, + "requiredComponents": [ + "str" # Optional. The required components. Allowed + values are 'learned', 'list', 'prebuilts' and 'regex'. ] } ], @@ -1828,7 +2155,8 @@ def begin_import_project( representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. "projectKind": "str", # Represents the project kind. Required. Known - values are: "Conversation" and "Orchestration". + values are: "Conversation", "Orchestration", and + "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "multilingual": bool, # Optional. Whether the project would be used @@ -1836,8 +2164,11 @@ def begin_import_project( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically - be changed to "None". Required. - } + be changed to "None". The value of the threshold should be between 0 and + 1 inclusive. Required. + }, + "storageInputContainerName": "str" # Optional. The storage container + name in case of conversation summarization. }, "projectFileVersion": "str", # The version of the exported file. Required. "stringIndexType": "str", # Specifies the method used to interpret string @@ -2664,8 +2995,15 @@ def list_deployments( "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ _headers = kwargs.pop("headers", {}) or {} @@ -2701,10 +3039,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -3143,8 +3488,15 @@ def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ error_map = { @@ -3299,7 +3651,13 @@ def begin_deploy_project( # JSON input template you can fill out and use as your body input. deployment = { - "trainedModelLabel": "str" # Represents the trained model label. Required. + "trainedModelLabel": "str", # Represents the trained model label. Required. + "assignedResourceIds": [ + "str" # Optional. Represents the resource IDs to be assigned to the + deployment."n If provided, the deployment will be rolled out to + the resources provided here as well as the original resource in which the + project is created. + ] } # response body for status code(s): 200 @@ -3312,8 +3670,15 @@ def begin_deploy_project( "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ @@ -3364,8 +3729,15 @@ def begin_deploy_project( "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ @@ -3410,8 +3782,15 @@ def begin_deploy_project( "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3648,10 +4027,227 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + def _delete_deployment_from_resources_initial( # pylint: disable=inconsistent-return-statements + self, project_name: str, deployment_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = body + + request = build_delete_deployment_from_resources_request( + project_name=project_name, + deployment_name=deployment_name, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @overload + def begin_delete_deployment_from_resources( + self, + project_name: str, + deployment_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a project deployment from the specified assigned resources. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param deployment_name: The name of the specific deployment of the project to use. Required. + :type deployment_name: str + :param body: The options for deleting the deployment. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "assignedResourceIds": [ + "str" # Optional. Represents the resource IDs to delete the + deployment from."n If not provided, the deployment will be rolled + out from all the resources it is deployed to."n If provided, it + will delete the deployment only from the specified assigned resources, and + leave it for the rest. + ] + } + """ + + @overload + def begin_delete_deployment_from_resources( + self, + project_name: str, + deployment_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a project deployment from the specified assigned resources. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param deployment_name: The name of the specific deployment of the project to use. Required. + :type deployment_name: str + :param body: The options for deleting the deployment. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_delete_deployment_from_resources( + self, project_name: str, deployment_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> LROPoller[None]: + """Deletes a project deployment from the specified assigned resources. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param deployment_name: The name of the specific deployment of the project to use. Required. + :type deployment_name: str + :param body: The options for deleting the deployment. Is either a model type or a IO type. + Required. + :type body: JSON or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_deployment_from_resources_initial( # type: ignore + project_name=project_name, + deployment_name=deployment_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + @distributed_trace - def get_deployment_job_status(self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing deployment job. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status + def get_deployment_delete_from_resources_status( + self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any + ) -> JSON: + """Gets the status of an existing delete deployment from specific resources job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-delete-from-resources-status for more information. :param project_name: The name of the project to use. Required. @@ -3735,7 +4331,7 @@ def get_deployment_job_status(self, project_name: str, deployment_name: str, job cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_deployment_job_status_request( + request = build_get_deployment_delete_from_resources_status_request( project_name=project_name, deployment_name=deployment_name, job_id=job_id, @@ -3769,13 +4365,15 @@ def get_deployment_job_status(self, project_name: str, deployment_name: str, job return cast(JSON, deserialized) @distributed_trace - def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing swap deployment job. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status + def get_deployment_job_status(self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an existing deployment job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status for more information. :param project_name: The name of the project to use. Required. :type project_name: str + :param deployment_name: The name of the specific deployment of the project to use. Required. + :type deployment_name: str :param job_id: The job ID. Required. :type job_id: str :return: JSON object @@ -3853,8 +4451,9 @@ def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwar cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_swap_deployments_job_status_request( + request = build_get_deployment_job_status_request( project_name=project_name, + deployment_name=deployment_name, job_id=job_id, api_version=self._config.api_version, headers=_headers, @@ -3886,10 +4485,9 @@ def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwar return cast(JSON, deserialized) @distributed_trace - def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an export job. Once job completes, returns the project metadata, and assets. - See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status + def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an existing swap deployment job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status for more information. :param project_name: The name of the project to use. Required. @@ -3950,8 +4548,6 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "resultUrl": "str", # Optional. The URL to use in order to download the - exported project. "warnings": [ { "code": "str", # The warning code. Required. @@ -3973,7 +4569,7 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_export_project_job_status_request( + request = build_get_swap_deployments_job_status_request( project_name=project_name, job_id=job_id, api_version=self._config.api_version, @@ -4006,9 +4602,10 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs return cast(JSON, deserialized) @distributed_trace - def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for an import. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status + def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an export job. Once job completes, returns the project metadata, and assets. + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status for more information. :param project_name: The name of the project to use. Required. @@ -4069,6 +4666,8 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. + "resultUrl": "str", # Optional. The URL to use in order to download the + exported project. "warnings": [ { "code": "str", # The warning code. Required. @@ -4090,7 +4689,7 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_import_project_job_status_request( + request = build_get_export_project_job_status_request( project_name=project_name, job_id=job_id, api_version=self._config.api_version, @@ -4123,26 +4722,143 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs return cast(JSON, deserialized) @distributed_trace - def list_trained_models( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> Iterable[JSON]: - """Lists the trained models belonging to a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models + def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status for an import. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status for more information. :param project_name: The name of the project to use. Required. :type project_name: str - :keyword top: The maximum number of resources to return from the collection. Default value is - None. - :paramtype top: int - :keyword skip: An offset into the collection of the first resource to be returned. Default - value is None. - :paramtype skip: int - :return: An iterator like instance of JSON object - :rtype: ~azure.core.paging.ItemPaged[JSON] - :raises ~azure.core.exceptions.HttpResponseError: - - Example: + :param job_id: The job ID. Required. + :type job_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the + job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "errors": [ + { + "code": "str", # One of a server-defined set of error codes. + Required. Known values are: "InvalidRequest", "InvalidArgument", + "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "OperationNotFound", "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", "TooManyRequests", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached", "InternalServerError", + "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and + "Warning". + "message": "str", # A human-readable representation of the + error. Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # One of a server-defined set of + error codes. Required. Known values are: "InvalidRequest", + "InvalidParameterValue", "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", + "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", + "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", + "InvalidDocumentBatch", "UnsupportedLanguageCode", and + "InvalidCountryHint". + "message": "str", # Error message. Required. + "details": { + "str": "str" # Optional. Error details. + }, + "innererror": ..., + "target": "str" # Optional. Error target. + }, + "target": "str" # Optional. The target of the error. + } + ], + "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date + time of the job. + "warnings": [ + { + "code": "str", # The warning code. Required. + "message": "str" # The warning message. Required. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_get_import_project_job_status_request( + project_name=project_name, + job_id=job_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) + + @distributed_trace + def list_trained_models( + self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + ) -> Iterable[JSON]: + """Lists the trained models belonging to a project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :keyword top: The maximum number of resources to return from the collection. Default value is + None. + :paramtype top: int + :keyword skip: An offset into the collection of the first resource to be returned. Default + value is None. + :paramtype skip: int + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: .. code-block:: python # response body for status code(s): 200 @@ -4154,8 +4870,10 @@ def list_trained_models( training request in seconds. Required. "modelExpirationDate": "2020-02-20", # The model expiration date. Required. "modelId": "str", # The model ID. Required. - "modelTrainingConfigVersion": "str" # The model training config version. + "modelTrainingConfigVersion": "str", # The model training config version. Required. + "hasSnapshot": bool # Optional. The flag to indicate if the trained model + has a snapshot ready. } """ _headers = kwargs.pop("headers", {}) or {} @@ -4191,10 +4909,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -4253,8 +4978,10 @@ def get_trained_model(self, project_name: str, trained_model_label: str, **kwarg training request in seconds. Required. "modelExpirationDate": "2020-02-20", # The model expiration date. Required. "modelId": "str", # The model ID. Required. - "modelTrainingConfigVersion": "str" # The model training config version. + "modelTrainingConfigVersion": "str", # The model training config version. Required. + "hasSnapshot": bool # Optional. The flag to indicate if the trained model + has a snapshot ready. } """ error_map = { @@ -4356,6 +5083,115 @@ def delete_trained_model( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) + def _load_snapshot_initial( # pylint: disable=inconsistent-return-statements + self, project_name: str, trained_model_label: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_load_snapshot_request( + project_name=project_name, + trained_model_label=trained_model_label, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_load_snapshot(self, project_name: str, trained_model_label: str, **kwargs: Any) -> LROPoller[None]: + """Restores the snapshot of this trained model to be the current working directory of the project. + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/load-snapshot + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param trained_model_label: The trained model label. Required. + :type trained_model_label: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._load_snapshot_initial( # type: ignore + project_name=project_name, + trained_model_label=trained_model_label, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + @distributed_trace def list_model_evaluation_results( self, @@ -4463,10 +5299,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -4495,21 +5338,916 @@ def get_next(next_link=None): map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - return pipeline_response + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_model_evaluation_summary(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: + """Gets the evaluation summary of a trained model. The summary includes high level performance + measurements of the model e.g., F1, Precision, Recall, etc. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param trained_model_label: The trained model label. Required. + :type trained_model_label: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entitiesEvaluation": { + "confusionMatrix": { + "str": { + "str": { + "normalizedValue": 0.0, # Represents + normalized value in percentages. Required. + "rawValue": 0.0 # Represents raw value. + Required. + } + } + }, + "entities": { + "str": { + "f1": 0.0, # Represents the model precision. + Required. + "falseNegativeCount": 0, # Represents the count of + false negative. Required. + "falsePositiveCount": 0, # Represents the count of + false positive. Required. + "precision": 0.0, # Represents the model recall. + Required. + "recall": 0.0, # Represents the model F1 score. + Required. + "trueNegativeCount": 0, # Represents the count of + true negative. Required. + "truePositiveCount": 0 # Represents the count of + true positive. Required. + } + }, + "macroF1": 0.0, # Represents the macro F1. Required. + "macroPrecision": 0.0, # Represents the macro precision. Required. + "macroRecall": 0.0, # Represents the macro recall. Required. + "microF1": 0.0, # Represents the micro F1. Required. + "microPrecision": 0.0, # Represents the micro precision. Required. + "microRecall": 0.0 # Represents the micro recall. Required. + }, + "intentsEvaluation": { + "confusionMatrix": { + "str": { + "str": { + "normalizedValue": 0.0, # Represents + normalized value in percentages. Required. + "rawValue": 0.0 # Represents raw value. + Required. + } + } + }, + "intents": { + "str": { + "f1": 0.0, # Represents the model precision. + Required. + "falseNegativeCount": 0, # Represents the count of + false negative. Required. + "falsePositiveCount": 0, # Represents the count of + false positive. Required. + "precision": 0.0, # Represents the model recall. + Required. + "recall": 0.0, # Represents the model F1 score. + Required. + "trueNegativeCount": 0, # Represents the count of + true negative. Required. + "truePositiveCount": 0 # Represents the count of + true positive. Required. + } + }, + "macroF1": 0.0, # Represents the macro F1. Required. + "macroPrecision": 0.0, # Represents the macro precision. Required. + "macroRecall": 0.0, # Represents the macro recall. Required. + "microF1": 0.0, # Represents the micro F1. Required. + "microPrecision": 0.0, # Represents the micro precision. Required. + "microRecall": 0.0 # Represents the micro recall. Required. + }, + "evaluationOptions": { + "kind": "str", # Optional. Represents the evaluation kind. By + default, the evaluation kind is set to percentage. Known values are: + "percentage" and "manual". + "testingSplitPercentage": 0, # Optional. Represents the testing + dataset split percentage. Only needed in case the evaluation kind is + percentage. + "trainingSplitPercentage": 0 # Optional. Represents the training + dataset split percentage. Only needed in case the evaluation kind is + percentage. + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_get_model_evaluation_summary_request( + project_name=project_name, + trained_model_label=trained_model_label, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) + + @distributed_trace + def get_load_snapshot_status(self, project_name: str, trained_model_label: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status for loading a snapshot. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-load-snapshot-status + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param trained_model_label: The trained model label. Required. + :type trained_model_label: str + :param job_id: The job ID. Required. + :type job_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the + job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "errors": [ + { + "code": "str", # One of a server-defined set of error codes. + Required. Known values are: "InvalidRequest", "InvalidArgument", + "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "OperationNotFound", "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", "TooManyRequests", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached", "InternalServerError", + "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and + "Warning". + "message": "str", # A human-readable representation of the + error. Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # One of a server-defined set of + error codes. Required. Known values are: "InvalidRequest", + "InvalidParameterValue", "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", + "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", + "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", + "InvalidDocumentBatch", "UnsupportedLanguageCode", and + "InvalidCountryHint". + "message": "str", # Error message. Required. + "details": { + "str": "str" # Optional. Error details. + }, + "innererror": ..., + "target": "str" # Optional. Error target. + }, + "target": "str" # Optional. The target of the error. + } + ], + "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date + time of the job. + "warnings": [ + { + "code": "str", # The warning code. Required. + "message": "str" # The warning message. Required. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_get_load_snapshot_status_request( + project_name=project_name, + trained_model_label=trained_model_label, + job_id=job_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) + + @distributed_trace + def list_deployment_resources( + self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + ) -> Iterable[JSON]: + """Lists the deployments resources assigned to the project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :keyword top: The maximum number of resources to return from the collection. Default value is + None. + :paramtype top: int + :keyword skip: An offset into the collection of the first resource to be returned. Default + value is None. + :paramtype skip: int + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "azureResourceId": "str", # The resource ID. Required. + "region": "str" # The resource region. Required. + } + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_deployment_resources_request( + project_name=project_name, + top=top, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + return request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _assign_deployment_resources_initial( # pylint: disable=inconsistent-return-statements + self, project_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = body + + request = build_assign_deployment_resources_request( + project_name=project_name, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @overload + def begin_assign_deployment_resources( + self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Assign new Azure resources to a project to allow deploying new deployments to them. This API is + available only via AAD authentication and not supported via subscription key authentication. + For more details about AAD authentication, check here: + https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The new project resources info. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "resourcesMetadata": [ + { + "azureResourceId": "str", # Represents the Azure resource + ID. Required. + "customDomain": "str", # Represents the Azure resource + custom domain. Required. + "region": "str" # Represents the Azure resource region. + Required. + } + ] + } + """ + + @overload + def begin_assign_deployment_resources( + self, project_name: str, body: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Assign new Azure resources to a project to allow deploying new deployments to them. This API is + available only via AAD authentication and not supported via subscription key authentication. + For more details about AAD authentication, check here: + https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The new project resources info. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_assign_deployment_resources( + self, project_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> LROPoller[None]: + """Assign new Azure resources to a project to allow deploying new deployments to them. This API is + available only via AAD authentication and not supported via subscription key authentication. + For more details about AAD authentication, check here: + https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The new project resources info. Is either a model type or a IO type. Required. + :type body: JSON or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._assign_deployment_resources_initial( # type: ignore + project_name=project_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + def _unassign_deployment_resources_initial( # pylint: disable=inconsistent-return-statements + self, project_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = body + + request = build_unassign_deployment_resources_request( + project_name=project_name, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @overload + def begin_unassign_deployment_resources( + self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Unassign resources from a project. This disallows deploying new deployments to these resources, + and deletes existing deployments assigned to them. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The info for the deployment resources to be deleted. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "assignedResourceIds": [ + "str" # Represents the assigned resource IDs to be unassigned. + Required. + ] + } + """ + + @overload + def begin_unassign_deployment_resources( + self, project_name: str, body: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Unassign resources from a project. This disallows deploying new deployments to these resources, + and deletes existing deployments assigned to them. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The info for the deployment resources to be deleted. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_unassign_deployment_resources( + self, project_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> LROPoller[None]: + """Unassign resources from a project. This disallows deploying new deployments to these resources, + and deletes existing deployments assigned to them. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The info for the deployment resources to be deleted. Is either a model type or a + IO type. Required. + :type body: JSON or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._unassign_deployment_resources_initial( # type: ignore + project_name=project_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + @distributed_trace + def get_assign_deployment_resources_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an existing assign deployment resources job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-assign-deployment-resources-status + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param job_id: The job ID. Required. + :type job_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the + job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "errors": [ + { + "code": "str", # One of a server-defined set of error codes. + Required. Known values are: "InvalidRequest", "InvalidArgument", + "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "OperationNotFound", "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", "TooManyRequests", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached", "InternalServerError", + "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and + "Warning". + "message": "str", # A human-readable representation of the + error. Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # One of a server-defined set of + error codes. Required. Known values are: "InvalidRequest", + "InvalidParameterValue", "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", + "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", + "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", + "InvalidDocumentBatch", "UnsupportedLanguageCode", and + "InvalidCountryHint". + "message": "str", # Error message. Required. + "details": { + "str": "str" # Optional. Error details. + }, + "innererror": ..., + "target": "str" # Optional. Error target. + }, + "target": "str" # Optional. The target of the error. + } + ], + "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date + time of the job. + "warnings": [ + { + "code": "str", # The warning code. Required. + "message": "str" # The warning message. Required. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_get_assign_deployment_resources_status_request( + project_name=project_name, + job_id=job_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) - return ItemPaged(get_next, extract_data) + return cast(JSON, deserialized) @distributed_trace - def get_model_evaluation_summary(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: - """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary + def get_unassign_deployment_resources_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an existing unassign deployment resources job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-unassign-deployment-resources-status for more information. :param project_name: The name of the project to use. Required. :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str + :param job_id: The job ID. Required. + :type job_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -4519,89 +6257,57 @@ def get_model_evaluation_summary(self, project_name: str, trained_model_label: s # response body for status code(s): 200 response == { - "entitiesEvaluation": { - "confusionMatrix": { - "str": { - "str": { - "normalizedValue": 0.0, # Represents - normalized value in percentages. Required. - "rawValue": 0.0 # Represents raw value. - Required. - } - } - }, - "entities": { - "str": { - "f1": 0.0, # Represents the model precision. - Required. - "falseNegativeCount": 0, # Represents the count of - false negative. Required. - "falsePositiveCount": 0, # Represents the count of - false positive. Required. - "precision": 0.0, # Represents the model recall. - Required. - "recall": 0.0, # Represents the model F1 score. - Required. - "trueNegativeCount": 0, # Represents the count of - true negative. Required. - "truePositiveCount": 0 # Represents the count of - true positive. Required. - } - }, - "macroF1": 0.0, # Represents the macro F1. Required. - "macroPrecision": 0.0, # Represents the macro precision. Required. - "macroRecall": 0.0, # Represents the macro recall. Required. - "microF1": 0.0, # Represents the micro F1. Required. - "microPrecision": 0.0, # Represents the micro precision. Required. - "microRecall": 0.0 # Represents the micro recall. Required. - }, - "intentsEvaluation": { - "confusionMatrix": { - "str": { - "str": { - "normalizedValue": 0.0, # Represents - normalized value in percentages. Required. - "rawValue": 0.0 # Represents raw value. - Required. - } - } - }, - "intents": { - "str": { - "f1": 0.0, # Represents the model precision. - Required. - "falseNegativeCount": 0, # Represents the count of - false negative. Required. - "falsePositiveCount": 0, # Represents the count of - false positive. Required. - "precision": 0.0, # Represents the model recall. - Required. - "recall": 0.0, # Represents the model F1 score. - Required. - "trueNegativeCount": 0, # Represents the count of - true negative. Required. - "truePositiveCount": 0 # Represents the count of - true positive. Required. - } - }, - "macroF1": 0.0, # Represents the macro F1. Required. - "macroPrecision": 0.0, # Represents the macro precision. Required. - "macroRecall": 0.0, # Represents the macro recall. Required. - "microF1": 0.0, # Represents the micro F1. Required. - "microPrecision": 0.0, # Represents the micro precision. Required. - "microRecall": 0.0 # Represents the micro recall. Required. - }, - "evaluationOptions": { - "kind": "str", # Optional. Represents the evaluation kind. By - default, the evaluation kind is set to percentage. Known values are: - "percentage" and "manual". - "testingSplitPercentage": 0, # Optional. Represents the testing - dataset split percentage. Only needed in case the evaluation kind is - percentage. - "trainingSplitPercentage": 0 # Optional. Represents the training - dataset split percentage. Only needed in case the evaluation kind is - percentage. - } + "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the + job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "errors": [ + { + "code": "str", # One of a server-defined set of error codes. + Required. Known values are: "InvalidRequest", "InvalidArgument", + "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "OperationNotFound", "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", "TooManyRequests", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached", "InternalServerError", + "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and + "Warning". + "message": "str", # A human-readable representation of the + error. Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # One of a server-defined set of + error codes. Required. Known values are: "InvalidRequest", + "InvalidParameterValue", "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", + "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", + "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", + "InvalidDocumentBatch", "UnsupportedLanguageCode", and + "InvalidCountryHint". + "message": "str", # Error message. Required. + "details": { + "str": "str" # Optional. Error details. + }, + "innererror": ..., + "target": "str" # Optional. Error target. + }, + "target": "str" # Optional. The target of the error. + } + ], + "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date + time of the job. + "warnings": [ + { + "code": "str", # The warning code. Required. + "message": "str" # The warning message. Required. + } + ] } """ error_map = { @@ -4617,9 +6323,9 @@ def get_model_evaluation_summary(self, project_name: str, trained_model_label: s cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_model_evaluation_summary_request( + request = build_get_unassign_deployment_resources_status_request( project_name=project_name, - trained_model_label=trained_model_label, + job_id=job_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4793,10 +6499,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -5308,6 +7021,119 @@ def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) + @distributed_trace + def list_assigned_resource_deployments( + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + ) -> Iterable[JSON]: + """Lists the deployments to which an Azure resource is assigned. This doesn't return deployments + belonging to projects owned by this resource. It only returns deployments belonging to projects + owned by other resources. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-assigned-resource-deployments + for more information. + + :keyword top: The maximum number of resources to return from the collection. Default value is + None. + :paramtype top: int + :keyword skip: An offset into the collection of the first resource to be returned. Default + value is None. + :paramtype skip: int + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentsMetadata": [ + { + "deploymentExpirationDate": "2020-02-20", # Represents + deployment expiration date in the runtime. Required. + "deploymentName": "str", # Represents the deployment name. + Required. + "lastDeployedDateTime": "2020-02-20 00:00:00" # Represents + deployment last deployed time. Required. + } + ], + "projectName": "str" # Represents the project name. Required. + } + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_assigned_resource_deployments_request( + top=top, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + return request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def list_supported_languages( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any @@ -5316,8 +7142,8 @@ def list_supported_languages( https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages for more information. - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. + :keyword project_kind: The project kind. Known values are: "Conversation", "Orchestration", and + "CustomConversationSummarization". Required. :paramtype project_kind: str :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -5373,10 +7199,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -5484,10 +7317,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -5528,8 +7368,8 @@ def list_training_config_versions( https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions for more information. - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. + :keyword project_kind: The project kind. Known values are: "Conversation", "Orchestration", and + "CustomConversationSummarization". Required. :paramtype project_kind: str :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -5585,10 +7425,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py index ef57a03b5add..72d8cede5562 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py @@ -45,8 +45,9 @@ class ConversationAuthoringClient(GeneratedConversationAuthoringClient): This can be the an instance of AzureKeyCredential if using a Language API key or a token credential from :mod:`azure.identity`. :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Available values are "2022-05-15-preview" and "2022-05-01". Default - value is "2022-05-15-preview". Note that overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. Available values are "2022-10-01-preview", "2022-05-15-preview", + "2022-05-01". Default value is "2022-10-01-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 Retry-After header is present. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py index fe225744457a..210e72ecabf5 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py @@ -36,7 +36,7 @@ class ConversationAuthoringClient( :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-10-01-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 diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_configuration.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_configuration.py index d48440460aa9..fb75b19b2f6a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_configuration.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_configuration.py @@ -29,14 +29,14 @@ class ConversationAuthoringClientConfiguration(Configuration): # pylint: disabl :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(ConversationAuthoringClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-05-15-preview") # type: str + api_version = kwargs.pop("api_version", "2022-10-01-preview") # type: str if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py index ab315d418ddb..a008c44e86ae 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,24 +29,32 @@ from azure.core.utils import case_insensitive_dict from ..._operations._operations import ( + build_assign_deployment_resources_request, build_cancel_training_job_request, build_create_project_request, + build_delete_deployment_from_resources_request, build_delete_deployment_request, build_delete_project_request, build_delete_trained_model_request, build_deploy_project_request, build_export_project_request, + build_get_assign_deployment_resources_status_request, + build_get_deployment_delete_from_resources_status_request, build_get_deployment_job_status_request, build_get_deployment_request, build_get_export_project_job_status_request, build_get_import_project_job_status_request, + build_get_load_snapshot_status_request, build_get_model_evaluation_summary_request, build_get_project_deletion_job_status_request, build_get_project_request, build_get_swap_deployments_job_status_request, build_get_trained_model_request, build_get_training_job_status_request, + build_get_unassign_deployment_resources_status_request, build_import_project_request, + build_list_assigned_resource_deployments_request, + build_list_deployment_resources_request, build_list_deployments_request, build_list_model_evaluation_results_request, build_list_projects_request, @@ -55,8 +63,10 @@ build_list_trained_models_request, build_list_training_config_versions_request, build_list_training_jobs_request, + build_load_snapshot_request, build_swap_deployments_request, build_train_request, + build_unassign_deployment_resources_request, ) from .._vendor import MixinABC @@ -101,7 +111,7 @@ def list_projects( "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -113,8 +123,11 @@ def list_projects( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ _headers = kwargs.pop("headers", {}) or {} @@ -149,10 +162,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -213,7 +233,7 @@ async def create_project( a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "multilingual": bool, # Optional. Whether the project would be used for @@ -221,8 +241,11 @@ async def create_project( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } # response body for status code(s): 200, 201 @@ -235,7 +258,7 @@ async def create_project( "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -247,8 +270,11 @@ async def create_project( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ @@ -284,7 +310,7 @@ async def create_project( "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -296,8 +322,11 @@ async def create_project( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ @@ -331,7 +360,7 @@ async def create_project(self, project_name: str, project: Union[JSON, IO], **kw "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -343,8 +372,11 @@ async def create_project(self, project_name: str, project: Union[JSON, IO], **kw "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ error_map = { @@ -435,7 +467,7 @@ async def get_project(self, project_name: str, **kwargs: Any) -> JSON: "lastModifiedDateTime": "2020-02-20 00:00:00", # Represents the project creation datetime. Required. "projectKind": "str", # Represents the project kind. Required. Known values - are: "Conversation" and "Orchestration". + are: "Conversation", "Orchestration", and "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "lastDeployedDateTime": "2020-02-20 00:00:00", # Optional. Represents the @@ -447,8 +479,11 @@ async def get_project(self, project_name: str, **kwargs: Any) -> JSON: "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to - "None". Required. - } + "None". The value of the threshold should be between 0 and 1 inclusive. + Required. + }, + "storageInputContainerName": "str" # Optional. The storage container name in + case of conversation summarization. } """ error_map = { @@ -677,6 +712,7 @@ async def _export_project_initial( string_index_type: str, exported_project_format: Optional[str] = None, asset_kind: Optional[str] = None, + trained_model_label: Optional[str] = None, **kwargs: Any ) -> Optional[JSON]: error_map = { @@ -697,6 +733,7 @@ async def _export_project_initial( string_index_type=string_index_type, exported_project_format=exported_project_format, asset_kind=asset_kind, + trained_model_label=trained_model_label, api_version=self._config.api_version, headers=_headers, params=_params, @@ -742,6 +779,7 @@ async def begin_export_project( string_index_type: str, exported_project_format: Optional[str] = None, asset_kind: Optional[str] = None, + trained_model_label: Optional[str] = None, **kwargs: Any ) -> AsyncLROPoller[JSON]: """Triggers a job to export a project's data. See @@ -758,6 +796,9 @@ async def begin_export_project( :paramtype exported_project_format: str :keyword asset_kind: Kind of asset to export. Default value is None. :paramtype asset_kind: str + :keyword trained_model_label: Trained model label to export. If the trainedModelLabel is null, + the default behavior is to export the current working copy. Default value is None. + :paramtype trained_model_label: str :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal @@ -842,6 +883,7 @@ async def begin_export_project( string_index_type=string_index_type, exported_project_format=exported_project_format, asset_kind=asset_kind, + trained_model_label=trained_model_label, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1032,6 +1074,24 @@ async def begin_import_project( "category": "str" # The prebuilt entity category. Required. } + ], + "regex": { + "expressions": [ + { + "language": "str", # Optional. + Represents the language of the regex expression. This is + BCP-47 representation of a language. For example, use "en" + for English, "en-gb" for English (UK), "es" for Spanish etc. + "regexKey": "str", # Optional. The + key of the regex expression. + "regexPattern": "str" # Optional. + The regex pattern. + } + ] + }, + "requiredComponents": [ + "str" # Optional. The required components. Allowed + values are 'learned', 'list', 'prebuilts' and 'regex'. ] } ], @@ -1092,7 +1152,8 @@ async def begin_import_project( representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. Required. "projectKind": "str", # Represents the project kind. Required. Known - values are: "Conversation" and "Orchestration". + values are: "Conversation", "Orchestration", and + "CustomConversationSummarization". "projectName": "str", # The new project name. Required. "description": "str", # Optional. The project description. "multilingual": bool, # Optional. Whether the project would be used @@ -1100,8 +1161,11 @@ async def begin_import_project( "settings": { "confidenceThreshold": 0.0 # The threshold of the intent with the highest confidence, at which the prediction will automatically - be changed to "None". Required. - } + be changed to "None". The value of the threshold should be between 0 and + 1 inclusive. Required. + }, + "storageInputContainerName": "str" # Optional. The storage container + name in case of conversation summarization. }, "projectFileVersion": "str", # The version of the exported file. Required. "stringIndexType": "str", # Specifies the method used to interpret string @@ -1932,8 +1996,15 @@ def list_deployments( "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ _headers = kwargs.pop("headers", {}) or {} @@ -1969,10 +2040,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -2414,8 +2492,15 @@ async def get_deployment(self, project_name: str, deployment_name: str, **kwargs "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ error_map = { @@ -2570,7 +2655,13 @@ async def begin_deploy_project( # JSON input template you can fill out and use as your body input. deployment = { - "trainedModelLabel": "str" # Represents the trained model label. Required. + "trainedModelLabel": "str", # Represents the trained model label. Required. + "assignedResourceIds": [ + "str" # Optional. Represents the resource IDs to be assigned to the + deployment."n If provided, the deployment will be rolled out to + the resources provided here as well as the original resource in which the + project is created. + ] } # response body for status code(s): 200 @@ -2583,8 +2674,15 @@ async def begin_deploy_project( "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ @@ -2635,8 +2733,15 @@ async def begin_deploy_project( "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ @@ -2681,8 +2786,15 @@ async def begin_deploy_project( "lastTrainedDateTime": "2020-02-20 00:00:00", # Represents deployment last trained time. Required. "modelId": "str", # Represents deployment modelId. Required. - "modelTrainingConfigVersion": "str" # Represents model training config + "modelTrainingConfigVersion": "str", # Represents model training config version. Required. + "assignedResources": [ + { + "region": "str", # Represents the resource region. Required. + "resourceId": "str" # Represents the Azure resource Id. + Required. + } + ] } """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2925,12 +3037,228 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + async def _delete_deployment_from_resources_initial( # pylint: disable=inconsistent-return-statements + self, project_name: str, deployment_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = body + + request = build_delete_deployment_from_resources_request( + project_name=project_name, + deployment_name=deployment_name, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @overload + async def begin_delete_deployment_from_resources( + self, + project_name: str, + deployment_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a project deployment from the specified assigned resources. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param deployment_name: The name of the specific deployment of the project to use. Required. + :type deployment_name: str + :param body: The options for deleting the deployment. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "assignedResourceIds": [ + "str" # Optional. Represents the resource IDs to delete the + deployment from."n If not provided, the deployment will be rolled + out from all the resources it is deployed to."n If provided, it + will delete the deployment only from the specified assigned resources, and + leave it for the rest. + ] + } + """ + + @overload + async def begin_delete_deployment_from_resources( + self, + project_name: str, + deployment_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a project deployment from the specified assigned resources. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param deployment_name: The name of the specific deployment of the project to use. Required. + :type deployment_name: str + :param body: The options for deleting the deployment. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_delete_deployment_from_resources( + self, project_name: str, deployment_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a project deployment from the specified assigned resources. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param deployment_name: The name of the specific deployment of the project to use. Required. + :type deployment_name: str + :param body: The options for deleting the deployment. Is either a model type or a IO type. + Required. + :type body: JSON or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_deployment_from_resources_initial( # type: ignore + project_name=project_name, + deployment_name=deployment_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + @distributed_trace_async - async def get_deployment_job_status( + async def get_deployment_delete_from_resources_status( self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any ) -> JSON: - """Gets the status of an existing deployment job. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status + """Gets the status of an existing delete deployment from specific resources job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-delete-from-resources-status for more information. :param project_name: The name of the project to use. Required. @@ -3014,7 +3342,7 @@ async def get_deployment_job_status( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_deployment_job_status_request( + request = build_get_deployment_delete_from_resources_status_request( project_name=project_name, deployment_name=deployment_name, job_id=job_id, @@ -3048,13 +3376,17 @@ async def get_deployment_job_status( return cast(JSON, deserialized) @distributed_trace_async - async def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing swap deployment job. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status + async def get_deployment_job_status( + self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any + ) -> JSON: + """Gets the status of an existing deployment job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status for more information. :param project_name: The name of the project to use. Required. :type project_name: str + :param deployment_name: The name of the specific deployment of the project to use. Required. + :type deployment_name: str :param job_id: The job ID. Required. :type job_id: str :return: JSON object @@ -3132,8 +3464,9 @@ async def get_swap_deployments_job_status(self, project_name: str, job_id: str, cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_swap_deployments_job_status_request( + request = build_get_deployment_job_status_request( project_name=project_name, + deployment_name=deployment_name, job_id=job_id, api_version=self._config.api_version, headers=_headers, @@ -3165,10 +3498,9 @@ async def get_swap_deployments_job_status(self, project_name: str, job_id: str, return cast(JSON, deserialized) @distributed_trace_async - async def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an export job. Once job completes, returns the project metadata, and assets. - See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status + async def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an existing swap deployment job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status for more information. :param project_name: The name of the project to use. Required. @@ -3229,8 +3561,6 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. - "resultUrl": "str", # Optional. The URL to use in order to download the - exported project. "warnings": [ { "code": "str", # The warning code. Required. @@ -3252,7 +3582,7 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_export_project_job_status_request( + request = build_get_swap_deployments_job_status_request( project_name=project_name, job_id=job_id, api_version=self._config.api_version, @@ -3285,9 +3615,10 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** return cast(JSON, deserialized) @distributed_trace_async - async def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for an import. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status + async def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an export job. Once job completes, returns the project metadata, and assets. + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status for more information. :param project_name: The name of the project to use. Required. @@ -3348,6 +3679,8 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** ], "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date time of the job. + "resultUrl": "str", # Optional. The URL to use in order to download the + exported project. "warnings": [ { "code": "str", # The warning code. Required. @@ -3369,7 +3702,7 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_import_project_job_status_request( + request = build_get_export_project_job_status_request( project_name=project_name, job_id=job_id, api_version=self._config.api_version, @@ -3401,7 +3734,124 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** return cast(JSON, deserialized) - @distributed_trace + @distributed_trace_async + async def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status for an import. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param job_id: The job ID. Required. + :type job_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the + job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "errors": [ + { + "code": "str", # One of a server-defined set of error codes. + Required. Known values are: "InvalidRequest", "InvalidArgument", + "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "OperationNotFound", "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", "TooManyRequests", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached", "InternalServerError", + "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and + "Warning". + "message": "str", # A human-readable representation of the + error. Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # One of a server-defined set of + error codes. Required. Known values are: "InvalidRequest", + "InvalidParameterValue", "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", + "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", + "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", + "InvalidDocumentBatch", "UnsupportedLanguageCode", and + "InvalidCountryHint". + "message": "str", # Error message. Required. + "details": { + "str": "str" # Optional. Error details. + }, + "innererror": ..., + "target": "str" # Optional. Error target. + }, + "target": "str" # Optional. The target of the error. + } + ], + "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date + time of the job. + "warnings": [ + { + "code": "str", # The warning code. Required. + "message": "str" # The warning message. Required. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_get_import_project_job_status_request( + project_name=project_name, + job_id=job_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) + + @distributed_trace def list_trained_models( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: @@ -3433,8 +3883,10 @@ def list_trained_models( training request in seconds. Required. "modelExpirationDate": "2020-02-20", # The model expiration date. Required. "modelId": "str", # The model ID. Required. - "modelTrainingConfigVersion": "str" # The model training config version. + "modelTrainingConfigVersion": "str", # The model training config version. Required. + "hasSnapshot": bool # Optional. The flag to indicate if the trained model + has a snapshot ready. } """ _headers = kwargs.pop("headers", {}) or {} @@ -3470,10 +3922,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -3532,8 +3991,10 @@ async def get_trained_model(self, project_name: str, trained_model_label: str, * training request in seconds. Required. "modelExpirationDate": "2020-02-20", # The model expiration date. Required. "modelId": "str", # The model ID. Required. - "modelTrainingConfigVersion": "str" # The model training config version. + "modelTrainingConfigVersion": "str", # The model training config version. Required. + "hasSnapshot": bool # Optional. The flag to indicate if the trained model + has a snapshot ready. } """ error_map = { @@ -3635,6 +4096,118 @@ async def delete_trained_model( # pylint: disable=inconsistent-return-statement if cls: return cls(pipeline_response, None, {}) + async def _load_snapshot_initial( # pylint: disable=inconsistent-return-statements + self, project_name: str, trained_model_label: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_load_snapshot_request( + project_name=project_name, + trained_model_label=trained_model_label, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_load_snapshot( + self, project_name: str, trained_model_label: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores the snapshot of this trained model to be the current working directory of the project. + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/load-snapshot + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param trained_model_label: The trained model label. Required. + :type trained_model_label: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._load_snapshot_initial( # type: ignore + project_name=project_name, + trained_model_label=trained_model_label, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + @distributed_trace def list_model_evaluation_results( self, @@ -3742,10 +4315,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -3776,19 +4356,918 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged(get_next, extract_data) + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_model_evaluation_summary(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: + """Gets the evaluation summary of a trained model. The summary includes high level performance + measurements of the model e.g., F1, Precision, Recall, etc. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param trained_model_label: The trained model label. Required. + :type trained_model_label: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entitiesEvaluation": { + "confusionMatrix": { + "str": { + "str": { + "normalizedValue": 0.0, # Represents + normalized value in percentages. Required. + "rawValue": 0.0 # Represents raw value. + Required. + } + } + }, + "entities": { + "str": { + "f1": 0.0, # Represents the model precision. + Required. + "falseNegativeCount": 0, # Represents the count of + false negative. Required. + "falsePositiveCount": 0, # Represents the count of + false positive. Required. + "precision": 0.0, # Represents the model recall. + Required. + "recall": 0.0, # Represents the model F1 score. + Required. + "trueNegativeCount": 0, # Represents the count of + true negative. Required. + "truePositiveCount": 0 # Represents the count of + true positive. Required. + } + }, + "macroF1": 0.0, # Represents the macro F1. Required. + "macroPrecision": 0.0, # Represents the macro precision. Required. + "macroRecall": 0.0, # Represents the macro recall. Required. + "microF1": 0.0, # Represents the micro F1. Required. + "microPrecision": 0.0, # Represents the micro precision. Required. + "microRecall": 0.0 # Represents the micro recall. Required. + }, + "intentsEvaluation": { + "confusionMatrix": { + "str": { + "str": { + "normalizedValue": 0.0, # Represents + normalized value in percentages. Required. + "rawValue": 0.0 # Represents raw value. + Required. + } + } + }, + "intents": { + "str": { + "f1": 0.0, # Represents the model precision. + Required. + "falseNegativeCount": 0, # Represents the count of + false negative. Required. + "falsePositiveCount": 0, # Represents the count of + false positive. Required. + "precision": 0.0, # Represents the model recall. + Required. + "recall": 0.0, # Represents the model F1 score. + Required. + "trueNegativeCount": 0, # Represents the count of + true negative. Required. + "truePositiveCount": 0 # Represents the count of + true positive. Required. + } + }, + "macroF1": 0.0, # Represents the macro F1. Required. + "macroPrecision": 0.0, # Represents the macro precision. Required. + "macroRecall": 0.0, # Represents the macro recall. Required. + "microF1": 0.0, # Represents the micro F1. Required. + "microPrecision": 0.0, # Represents the micro precision. Required. + "microRecall": 0.0 # Represents the micro recall. Required. + }, + "evaluationOptions": { + "kind": "str", # Optional. Represents the evaluation kind. By + default, the evaluation kind is set to percentage. Known values are: + "percentage" and "manual". + "testingSplitPercentage": 0, # Optional. Represents the testing + dataset split percentage. Only needed in case the evaluation kind is + percentage. + "trainingSplitPercentage": 0 # Optional. Represents the training + dataset split percentage. Only needed in case the evaluation kind is + percentage. + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_get_model_evaluation_summary_request( + project_name=project_name, + trained_model_label=trained_model_label, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) + + @distributed_trace_async + async def get_load_snapshot_status( + self, project_name: str, trained_model_label: str, job_id: str, **kwargs: Any + ) -> JSON: + """Gets the status for loading a snapshot. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-load-snapshot-status + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param trained_model_label: The trained model label. Required. + :type trained_model_label: str + :param job_id: The job ID. Required. + :type job_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the + job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "errors": [ + { + "code": "str", # One of a server-defined set of error codes. + Required. Known values are: "InvalidRequest", "InvalidArgument", + "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "OperationNotFound", "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", "TooManyRequests", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached", "InternalServerError", + "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and + "Warning". + "message": "str", # A human-readable representation of the + error. Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # One of a server-defined set of + error codes. Required. Known values are: "InvalidRequest", + "InvalidParameterValue", "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", + "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", + "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", + "InvalidDocumentBatch", "UnsupportedLanguageCode", and + "InvalidCountryHint". + "message": "str", # Error message. Required. + "details": { + "str": "str" # Optional. Error details. + }, + "innererror": ..., + "target": "str" # Optional. Error target. + }, + "target": "str" # Optional. The target of the error. + } + ], + "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date + time of the job. + "warnings": [ + { + "code": "str", # The warning code. Required. + "message": "str" # The warning message. Required. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_get_load_snapshot_status_request( + project_name=project_name, + trained_model_label=trained_model_label, + job_id=job_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) + + @distributed_trace + def list_deployment_resources( + self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable[JSON]: + """Lists the deployments resources assigned to the project. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :keyword top: The maximum number of resources to return from the collection. Default value is + None. + :paramtype top: int + :keyword skip: An offset into the collection of the first resource to be returned. Default + value is None. + :paramtype skip: int + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "azureResourceId": "str", # The resource ID. Required. + "region": "str" # The resource region. Required. + } + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_deployment_resources_request( + project_name=project_name, + top=top, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + return request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _assign_deployment_resources_initial( # pylint: disable=inconsistent-return-statements + self, project_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = body + + request = build_assign_deployment_resources_request( + project_name=project_name, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @overload + async def begin_assign_deployment_resources( + self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Assign new Azure resources to a project to allow deploying new deployments to them. This API is + available only via AAD authentication and not supported via subscription key authentication. + For more details about AAD authentication, check here: + https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The new project resources info. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "resourcesMetadata": [ + { + "azureResourceId": "str", # Represents the Azure resource + ID. Required. + "customDomain": "str", # Represents the Azure resource + custom domain. Required. + "region": "str" # Represents the Azure resource region. + Required. + } + ] + } + """ + + @overload + async def begin_assign_deployment_resources( + self, project_name: str, body: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Assign new Azure resources to a project to allow deploying new deployments to them. This API is + available only via AAD authentication and not supported via subscription key authentication. + For more details about AAD authentication, check here: + https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The new project resources info. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_assign_deployment_resources( + self, project_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Assign new Azure resources to a project to allow deploying new deployments to them. This API is + available only via AAD authentication and not supported via subscription key authentication. + For more details about AAD authentication, check here: + https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The new project resources info. Is either a model type or a IO type. Required. + :type body: JSON or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._assign_deployment_resources_initial( # type: ignore + project_name=project_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + async def _unassign_deployment_resources_initial( # pylint: disable=inconsistent-return-statements + self, project_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = body + + request = build_unassign_deployment_resources_request( + project_name=project_name, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @overload + async def begin_unassign_deployment_resources( + self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Unassign resources from a project. This disallows deploying new deployments to these resources, + and deletes existing deployments assigned to them. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The info for the deployment resources to be deleted. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "assignedResourceIds": [ + "str" # Represents the assigned resource IDs to be unassigned. + Required. + ] + } + """ + + @overload + async def begin_unassign_deployment_resources( + self, project_name: str, body: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Unassign resources from a project. This disallows deploying new deployments to these resources, + and deletes existing deployments assigned to them. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The info for the deployment resources to be deleted. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_unassign_deployment_resources( + self, project_name: str, body: Union[JSON, IO], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Unassign resources from a project. This disallows deploying new deployments to these resources, + and deletes existing deployments assigned to them. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param body: The info for the deployment resources to be deleted. Is either a model type or a + IO type. Required. + :type body: JSON or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._unassign_deployment_resources_initial( # type: ignore + project_name=project_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + @distributed_trace_async + async def get_assign_deployment_resources_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an existing assign deployment resources job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-assign-deployment-resources-status + for more information. + + :param project_name: The name of the project to use. Required. + :type project_name: str + :param job_id: The job ID. Required. + :type job_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the + job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "errors": [ + { + "code": "str", # One of a server-defined set of error codes. + Required. Known values are: "InvalidRequest", "InvalidArgument", + "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "OperationNotFound", "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", "TooManyRequests", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached", "InternalServerError", + "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and + "Warning". + "message": "str", # A human-readable representation of the + error. Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # One of a server-defined set of + error codes. Required. Known values are: "InvalidRequest", + "InvalidParameterValue", "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", + "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", + "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", + "InvalidDocumentBatch", "UnsupportedLanguageCode", and + "InvalidCountryHint". + "message": "str", # Error message. Required. + "details": { + "str": "str" # Optional. Error details. + }, + "innererror": ..., + "target": "str" # Optional. Error target. + }, + "target": "str" # Optional. The target of the error. + } + ], + "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date + time of the job. + "warnings": [ + { + "code": "str", # The warning code. Required. + "message": "str" # The warning message. Required. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_get_assign_deployment_resources_status_request( + project_name=project_name, + job_id=job_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) @distributed_trace_async - async def get_model_evaluation_summary(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: - """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary + async def get_unassign_deployment_resources_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: + """Gets the status of an existing unassign deployment resources job. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-unassign-deployment-resources-status for more information. :param project_name: The name of the project to use. Required. :type project_name: str - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str + :param job_id: The job ID. Required. + :type job_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -3798,89 +5277,57 @@ async def get_model_evaluation_summary(self, project_name: str, trained_model_la # response body for status code(s): 200 response == { - "entitiesEvaluation": { - "confusionMatrix": { - "str": { - "str": { - "normalizedValue": 0.0, # Represents - normalized value in percentages. Required. - "rawValue": 0.0 # Represents raw value. - Required. - } - } - }, - "entities": { - "str": { - "f1": 0.0, # Represents the model precision. - Required. - "falseNegativeCount": 0, # Represents the count of - false negative. Required. - "falsePositiveCount": 0, # Represents the count of - false positive. Required. - "precision": 0.0, # Represents the model recall. - Required. - "recall": 0.0, # Represents the model F1 score. - Required. - "trueNegativeCount": 0, # Represents the count of - true negative. Required. - "truePositiveCount": 0 # Represents the count of - true positive. Required. - } - }, - "macroF1": 0.0, # Represents the macro F1. Required. - "macroPrecision": 0.0, # Represents the macro precision. Required. - "macroRecall": 0.0, # Represents the macro recall. Required. - "microF1": 0.0, # Represents the micro F1. Required. - "microPrecision": 0.0, # Represents the micro precision. Required. - "microRecall": 0.0 # Represents the micro recall. Required. - }, - "intentsEvaluation": { - "confusionMatrix": { - "str": { - "str": { - "normalizedValue": 0.0, # Represents - normalized value in percentages. Required. - "rawValue": 0.0 # Represents raw value. - Required. - } - } - }, - "intents": { - "str": { - "f1": 0.0, # Represents the model precision. - Required. - "falseNegativeCount": 0, # Represents the count of - false negative. Required. - "falsePositiveCount": 0, # Represents the count of - false positive. Required. - "precision": 0.0, # Represents the model recall. - Required. - "recall": 0.0, # Represents the model F1 score. - Required. - "trueNegativeCount": 0, # Represents the count of - true negative. Required. - "truePositiveCount": 0 # Represents the count of - true positive. Required. - } - }, - "macroF1": 0.0, # Represents the macro F1. Required. - "macroPrecision": 0.0, # Represents the macro precision. Required. - "macroRecall": 0.0, # Represents the macro recall. Required. - "microF1": 0.0, # Represents the micro F1. Required. - "microPrecision": 0.0, # Represents the micro precision. Required. - "microRecall": 0.0 # Represents the micro recall. Required. - }, - "evaluationOptions": { - "kind": "str", # Optional. Represents the evaluation kind. By - default, the evaluation kind is set to percentage. Known values are: - "percentage" and "manual". - "testingSplitPercentage": 0, # Optional. Represents the testing - dataset split percentage. Only needed in case the evaluation kind is - percentage. - "trainingSplitPercentage": 0 # Optional. Represents the training - dataset split percentage. Only needed in case the evaluation kind is - percentage. - } + "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the + job. Required. + "jobId": "str", # The job ID. Required. + "lastUpdatedDateTime": "2020-02-20 00:00:00", # The last date time the job + was updated. Required. + "status": "str", # The job status. Required. Known values are: "notStarted", + "running", "succeeded", "failed", "cancelled", "cancelling", and + "partiallyCompleted". + "errors": [ + { + "code": "str", # One of a server-defined set of error codes. + Required. Known values are: "InvalidRequest", "InvalidArgument", + "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "OperationNotFound", "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", "TooManyRequests", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached", "InternalServerError", + "ServiceUnavailable", "Timeout", "QuotaExceeded", "Conflict", and + "Warning". + "message": "str", # A human-readable representation of the + error. Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # One of a server-defined set of + error codes. Required. Known values are: "InvalidRequest", + "InvalidParameterValue", "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", "AzureCognitiveSearchThrottling", + "ExtractionFailure", "InvalidRequestBodyFormat", "EmptyRequest", + "MissingInputDocuments", "InvalidDocument", "ModelVersionIncorrect", + "InvalidDocumentBatch", "UnsupportedLanguageCode", and + "InvalidCountryHint". + "message": "str", # Error message. Required. + "details": { + "str": "str" # Optional. Error details. + }, + "innererror": ..., + "target": "str" # Optional. Error target. + }, + "target": "str" # Optional. The target of the error. + } + ], + "expirationDateTime": "2020-02-20 00:00:00", # Optional. The expiration date + time of the job. + "warnings": [ + { + "code": "str", # The warning code. Required. + "message": "str" # The warning message. Required. + } + ] } """ error_map = { @@ -3896,9 +5343,9 @@ async def get_model_evaluation_summary(self, project_name: str, trained_model_la cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_get_model_evaluation_summary_request( + request = build_get_unassign_deployment_resources_status_request( project_name=project_name, - trained_model_label=trained_model_label, + job_id=job_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4072,10 +5519,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -4588,6 +6042,119 @@ async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> J return cast(JSON, deserialized) + @distributed_trace + def list_assigned_resource_deployments( + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable[JSON]: + """Lists the deployments to which an Azure resource is assigned. This doesn't return deployments + belonging to projects owned by this resource. It only returns deployments belonging to projects + owned by other resources. See + https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-assigned-resource-deployments + for more information. + + :keyword top: The maximum number of resources to return from the collection. Default value is + None. + :paramtype top: int + :keyword skip: An offset into the collection of the first resource to be returned. Default + value is None. + :paramtype skip: int + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentsMetadata": [ + { + "deploymentExpirationDate": "2020-02-20", # Represents + deployment expiration date in the runtime. Required. + "deploymentName": "str", # Represents the deployment name. + Required. + "lastDeployedDateTime": "2020-02-20 00:00:00" # Represents + deployment last deployed time. Required. + } + ], + "projectName": "str" # Represents the project name. Required. + } + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_assigned_resource_deployments_request( + top=top, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + return request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace def list_supported_languages( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any @@ -4596,8 +6163,8 @@ def list_supported_languages( https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages for more information. - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. + :keyword project_kind: The project kind. Known values are: "Conversation", "Orchestration", and + "CustomConversationSummarization". Required. :paramtype project_kind: str :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -4653,10 +6220,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -4764,10 +6338,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True @@ -4808,8 +6389,8 @@ def list_training_config_versions( https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions for more information. - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. + :keyword project_kind: The project kind. Known values are: "Conversation", "Orchestration", and + "CustomConversationSummarization". Required. :paramtype project_kind: str :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -4865,10 +6446,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) path_format_arguments = { "Endpoint": self._serialize.url( "self._config.endpoint", self._config.endpoint, "str", skip_quote=True diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_patch.py index 3f0527768dff..a3a5eb5fda79 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_patch.py @@ -45,8 +45,9 @@ class ConversationAuthoringClient(GeneratedConversationAuthoringClient): This can be the an instance of AzureKeyCredential if using a Language API key or a token credential from :mod:`azure.identity`. :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Available values are "2022-05-15-preview" and "2022-05-01". Default - value is "2022-05-15-preview". Note that overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. Available values are "2022-10-01-preview", "2022-05-15-preview", + "2022-05-01". Default value is "2022-10-01-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 Retry-After header is present. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md index ddcf261e4e25..27e11d0a172a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md @@ -26,7 +26,6 @@ license-header: MICROSOFT_MIT_NO_VERSION clear-output-folder: true no-namespace-folders: true python: true -tag: release_2022_05_15_preview openapi-type: data-plane version-tolerant: true package-version: 1.1.0b3 @@ -50,7 +49,7 @@ batch: These settings apply only when `--tag=release_runtime_1_1_preview` is specified on the command line. ```yaml $(tag) == 'release_runtime_1_1_preview' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/374bebd0b0764ba8350cb186e010f1fee987d0b7/dev/cognitiveservices/data-plane/Language/analyzeconversations.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/40f5247a48ff1eec044c8441c422af0628a8a288/specification/cognitiveservices/data-plane/Language/preview/2022-10-01-preview/analyzeconversations.json output-folder: ../azure/ai/language/conversations title: ConversationAnalysisClient ``` @@ -60,7 +59,7 @@ title: ConversationAnalysisClient These settings apply only when `--tag=release_authoring_1_1_preview` is specified on the command line. ```yaml $(tag) == 'release_authoring_1_1_preview' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e7f37e4e43b1d12fd1988fda3ed39624c4b23303/specification/cognitiveservices/data-plane/Language/preview/2022-05-15-preview/analyzeconversations-authoring.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/40f5247a48ff1eec044c8441c422af0628a8a288/specification/cognitiveservices/data-plane/Language/preview/2022-10-01-preview/analyzeconversations-authoring.json output-folder: ../azure/ai/language/conversations/authoring title: ConversationAuthoringClient ``` @@ -394,4 +393,34 @@ directive: - rename-operation: from: ConversationalAnalysisAuthoring_ListTrainingConfigVersions to: ListTrainingConfigVersions -``` \ No newline at end of file + - rename-operation: + from: ConversationalAnalysisAuthoring_DeleteDeploymentFromResources + to: DeleteDeploymentFromResources + - rename-operation: + from: ConversationalAnalysisAuthoring_GetDeploymentDeleteFromResourcesStatus + to: GetDeploymentDeleteFromResourcesStatus + - rename-operation: + from: ConversationalAnalysisAuthoring_LoadSnapshot + to: LoadSnapshot + - rename-operation: + from: ConversationalAnalysisAuthoring_GetLoadSnapshotStatus + to: GetLoadSnapshotStatus + - rename-operation: + from: ConversationalAnalysisAuthoring_ListDeploymentResources + to: ListDeploymentResources + - rename-operation: + from: ConversationalAnalysisAuthoring_AssignDeploymentResources + to: AssignDeploymentResources + - rename-operation: + from: ConversationalAnalysisAuthoring_GetAssignDeploymentResourcesStatus + to: GetAssignDeploymentResourcesStatus + - rename-operation: + from: ConversationalAnalysisAuthoring_UnassignDeploymentResources + to: UnassignDeploymentResources + - rename-operation: + from: ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus + to: GetUnassignDeploymentResourcesStatus + - rename-operation: + from: ConversationalAnalysisAuthoring_ListAssignedResourceDeployments + to: ListAssignedResourceDeployments +``` From 8add6552b1096174e3b1ee8860a1de6723893eee Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Mon, 17 Oct 2022 15:26:46 -0700 Subject: [PATCH 6/7] rerecord and fix doc --- .../conversations/_operations/_operations.py | 27 +--- .../aio/_operations/_operations.py | 27 +--- .../swagger/README.md | 2 +- ...nversationAuthoringtest_authoring_aad.json | 32 +++-- ...ationAuthoringAsynctest_authoring_aad.json | 19 +-- ...versationalPiitest_conversational_pii.json | 74 ++++++++--- ...tionalPiiAsynctest_conversational_pii.json | 73 ++++++++--- ...tiontest_conversational_summarization.json | 101 +++++++++++---- ...synctest_conversational_summarization.json | 100 +++++++++++---- ...tConversationApptest_conversation_app.json | 16 +-- ...tionApptest_conversation_app_aad_auth.json | 118 +++--------------- ...ersationAppAsynctest_conversation_app.json | 16 +-- ...ppAsynctest_conversation_app_aad_auth.json | 14 +-- ...etest_orchestration_app_conv_response.json | 16 +-- ...ctest_orchestration_app_conv_response.json | 16 +-- ...setest_orchestration_app_qna_response.json | 12 +- ...nctest_orchestration_app_qna_response.json | 12 +- .../tests/test_authoring.py | 2 +- .../tests/test_authoring_async.py | 2 +- .../tests/test_conversation_app.py | 3 +- .../tests/test_conversation_app_async.py | 3 +- 21 files changed, 381 insertions(+), 304 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py index 048928c31fbe..02d702665157 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py @@ -478,13 +478,8 @@ def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. For examples on calling this method, see the docs. - - Conversation summarization: - https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api - Conversation PII: - https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api - Conversation sentiment analysis: TODO. + executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for + more information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -604,13 +599,8 @@ def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. For examples on calling this method, see the docs. - - Conversation summarization: - https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api - Conversation PII: - https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api - Conversation sentiment analysis: TODO. + executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for + more information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -715,13 +705,8 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. For examples on calling this method, see the docs. - - Conversation summarization: - https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api - Conversation PII: - https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api - Conversation sentiment analysis: TODO. + executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for + more information. :param task: The collection of conversations to analyze and one or more tasks to execute. Is either a model type or a IO type. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py index 371731c23913..1539b13a1aca 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py @@ -431,13 +431,8 @@ async def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. For examples on calling this method, see the docs. - - Conversation summarization: - https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api - Conversation PII: - https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api - Conversation sentiment analysis: TODO. + executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for + more information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -557,13 +552,8 @@ async def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. For examples on calling this method, see the docs. - - Conversation summarization: - https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api - Conversation PII: - https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api - Conversation sentiment analysis: TODO. + executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for + more information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -668,13 +658,8 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. For examples on calling this method, see the docs. - - Conversation summarization: - https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api - Conversation PII: - https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api - Conversation sentiment analysis: TODO. + executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for + more information. :param task: The collection of conversations to analyze and one or more tasks to execute. Is either a model type or a IO type. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md index 27e11d0a172a..d26c5248841d 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md @@ -82,7 +82,7 @@ directive: - where-operation: AnalyzeConversation_SubmitJob transform: > - $.description = $.description + " For examples on calling this method, see the docs.\n\nConversation summarization: https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/summarization/quickstart?tabs=conversation-summarization&pivots=rest-api \nConversation PII: https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/how-to-call-for-conversations?tabs=rest-api \nConversation sentiment analysis: TODO"; + $.description = $.description + " See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more information."; - where-operation: ConversationAnalysis_AnalyzeConversation transform: > $.description = $.description + " See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information."; diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_authoring.pyTestConversationAuthoringtest_authoring_aad.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_authoring.pyTestConversationAuthoringtest_authoring_aad.json index e29b0c12b32f..c8789274bac7 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_authoring.pyTestConversationAuthoringtest_authoring_aad.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_authoring.pyTestConversationAuthoringtest_authoring_aad.json @@ -7,7 +7,7 @@ "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", - "User-Agent": "azsdk-python-identity/1.11.0b4 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-identity/1.12.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, @@ -17,12 +17,12 @@ "Cache-Control": "max-age=86400, private", "Content-Length": "1753", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:07:13 GMT", + "Date": "Mon, 17 Oct 2022 22:15:35 GMT", "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", "Set-Cookie": "[set-cookie;]", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-ests-server": "2.1.13622.4 - SCUS ProdSlices", + "x-ms-ests-server": "2.1.13845.10 - EUS ProdSlices", "X-XSS-Protection": "0" }, "ResponseBody": { @@ -100,7 +100,8 @@ "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", - "User-Agent": "azsdk-python-identity/1.11.0b4 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "Cookie": "fpc=Arc2U-tyLlNNoD9R8f_RtMM; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.12.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, @@ -110,12 +111,12 @@ "Cache-Control": "max-age=86400, private", "Content-Length": "945", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:07:13 GMT", + "Date": "Mon, 17 Oct 2022 22:15:35 GMT", "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", "Set-Cookie": "[set-cookie;]", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-ests-server": "2.1.13562.12 - WUS2 ProdSlices", + "x-ms-ests-server": "2.1.13777.6 - EUS ProdSlices", "X-XSS-Protection": "0" }, "ResponseBody": { @@ -166,26 +167,26 @@ } }, { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/authoring/analyze-conversations/projects/global/prebuilt-entities?language=en\u0026api-version=2022-05-01", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/authoring/analyze-conversations/projects/global/prebuilt-entities?language=en\u0026api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b2 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "79c8f4a5-03d2-4596-b2ec-6133e031172e", - "Content-Length": "1959", + "apim-request-id": "04d9a804-a303-42cb-9b88-4ff63699cde6", + "Content-Length": "2071", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:07:15 GMT", - "request-id": "79c8f4a5-03d2-4596-b2ec-6133e031172e", + "Date": "Mon, 17 Oct 2022 22:15:36 GMT", + "request-id": "04d9a804-a303-42cb-9b88-4ff63699cde6", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "26" + "x-envoy-upstream-service-time": "16" }, "ResponseBody": { "value": [ @@ -194,6 +195,11 @@ "description": "Name of an individual", "examples": "john, Sam, Lisa" }, + { + "category": "Geography.Location", + "description": "Name of a location", + "examples": "Tokyo, Asia, JFK, Ohio, India" + }, { "category": "General.Event", "description": "Important events", diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_authoring_async.pyTestConversationAuthoringAsynctest_authoring_aad.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_authoring_async.pyTestConversationAuthoringAsynctest_authoring_aad.json index 864b81914553..9a885bbb5979 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_authoring_async.pyTestConversationAuthoringAsynctest_authoring_aad.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_authoring_async.pyTestConversationAuthoringAsynctest_authoring_aad.json @@ -1,25 +1,25 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/authoring/analyze-conversations/projects/global/prebuilt-entities?language=en\u0026api-version=2022-05-01", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/authoring/analyze-conversations/projects/global/prebuilt-entities?language=en\u0026api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Accept-Encoding": "gzip, deflate", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b2 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "cda53a07-cb42-4c8b-a701-5f86966f864a", - "Content-Length": "1959", + "apim-request-id": "44fa9ec6-f688-4efc-83d6-3c0dadd69cac", + "Content-Length": "2071", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:07:15 GMT", - "request-id": "cda53a07-cb42-4c8b-a701-5f86966f864a", + "Date": "Mon, 17 Oct 2022 22:15:52 GMT", + "request-id": "44fa9ec6-f688-4efc-83d6-3c0dadd69cac", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "25" + "x-envoy-upstream-service-time": "14" }, "ResponseBody": { "value": [ @@ -28,6 +28,11 @@ "description": "Name of an individual", "examples": "john, Sam, Lisa" }, + { + "category": "Geography.Location", + "description": "Name of a location", + "examples": "Tokyo, Asia, JFK, Ohio, India" + }, { "category": "General.Event", "description": "Important events", diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_pii_transcript_input.pyTestConversationalPiitest_conversational_pii.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_pii_transcript_input.pyTestConversationalPiitest_conversational_pii.json index 6387390759e9..985e5fe133ee 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_pii_transcript_input.pyTestConversationalPiitest_conversational_pii.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_pii_transcript_input.pyTestConversationalPiitest_conversational_pii.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -10,7 +10,7 @@ "Content-Length": "945", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "displayName": "Analyze PII in conversation", @@ -66,42 +66,80 @@ }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "d1361212-d7c5-47c8-8540-b2c8682db956", + "apim-request-id": "20062a29-eeff-41aa-b089-ddb78a58c5bb", "Content-Length": "0", - "Date": "Tue, 06 Sep 2022 19:07:16 GMT", - "operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/ca5f8f6d-194e-4aec-8ccf-2ae53e9e7324?api-version=2022-05-15-preview", + "Date": "Mon, 17 Oct 2022 22:09:46 GMT", + "operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/086294cc-8c3f-4a7b-aee0-9398ba63f0e0?api-version=2022-10-01-preview", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "408" + "x-envoy-upstream-service-time": "205" }, "ResponseBody": null }, { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/ca5f8f6d-194e-4aec-8ccf-2ae53e9e7324?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/086294cc-8c3f-4a7b-aee0-9398ba63f0e0?api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "fefd3334-343a-4349-aec1-a3c1508bf646", - "Content-Length": "1528", + "apim-request-id": "0785ce4a-d0fc-49b3-92df-60470338335a", + "Content-Length": "324", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:07:46 GMT", + "Date": "Mon, 17 Oct 2022 22:09:46 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "89" + "x-envoy-upstream-service-time": "108" }, "ResponseBody": { - "jobId": "ca5f8f6d-194e-4aec-8ccf-2ae53e9e7324", - "lastUpdatedDateTime": "2022-09-06T19:07:17Z", - "createdDateTime": "2022-09-06T19:07:16Z", - "expirationDateTime": "2022-09-07T19:07:16Z", + "jobId": "086294cc-8c3f-4a7b-aee0-9398ba63f0e0", + "lastUpdatedDateTime": "2022-10-17T22:09:46Z", + "createdDateTime": "2022-10-17T22:09:46Z", + "expirationDateTime": "2022-10-18T22:09:46Z", + "status": "running", + "errors": [], + "displayName": "Analyze PII in conversation", + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1, + "items": [] + } + } + }, + { + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/086294cc-8c3f-4a7b-aee0-9398ba63f0e0?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Ocp-Apim-Subscription-Key": "0000000000000000", + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "d97ec94d-3a0a-45fd-9af3-b4a71e427dce", + "Content-Length": "1530", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 Oct 2022 22:09:51 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "242" + }, + "ResponseBody": { + "jobId": "086294cc-8c3f-4a7b-aee0-9398ba63f0e0", + "lastUpdatedDateTime": "2022-10-17T22:09:47Z", + "createdDateTime": "2022-10-17T22:09:46Z", + "expirationDateTime": "2022-10-18T22:09:46Z", "status": "succeeded", "errors": [], "displayName": "Analyze PII in conversation", @@ -113,12 +151,12 @@ "items": [ { "kind": "conversationalPIIResults", - "lastUpdateDateTime": "2022-09-06T19:07:17.6745128Z", + "lastUpdateDateTime": "2022-10-17T22:09:47.1628107Z", "status": "succeeded", "results": { "conversations": [ { - "id": "1", + "id": "1.0", "conversationItems": [ { "id": "1", diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_pii_transcript_input_async.pyTestConversationalPiiAsynctest_conversational_pii.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_pii_transcript_input_async.pyTestConversationalPiiAsynctest_conversational_pii.json index 788cac966699..e9bb6f7d0b54 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_pii_transcript_input_async.pyTestConversationalPiiAsynctest_conversational_pii.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_pii_transcript_input_async.pyTestConversationalPiiAsynctest_conversational_pii.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -9,7 +9,7 @@ "Content-Length": "945", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "displayName": "Analyze PII in conversation", @@ -65,41 +65,78 @@ }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "8db09768-ac12-4baa-89d9-fd9114ab9bdc", + "apim-request-id": "4853f800-1dbe-408c-ad7d-854c0a0e0f2d", "Content-Length": "0", - "Date": "Tue, 06 Sep 2022 19:07:47 GMT", - "operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/ce985d51-0534-428f-9afc-514d9b6dbd0f?api-version=2022-05-15-preview", + "Date": "Mon, 17 Oct 2022 22:09:52 GMT", + "operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/32504518-601b-4126-a03d-1d4ba4b73cdb?api-version=2022-10-01-preview", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "208" + "x-envoy-upstream-service-time": "233" }, "ResponseBody": null }, { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/ce985d51-0534-428f-9afc-514d9b6dbd0f?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/32504518-601b-4126-a03d-1d4ba4b73cdb?api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "47cb20fe-0cd1-4159-a972-a371913cd5af", - "Content-Length": "1528", + "apim-request-id": "f5b547fd-bc59-48eb-bb96-3dd85f281fe8", + "Content-Length": "324", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:08:17 GMT", + "Date": "Mon, 17 Oct 2022 22:09:52 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "40" + "x-envoy-upstream-service-time": "138" }, "ResponseBody": { - "jobId": "ce985d51-0534-428f-9afc-514d9b6dbd0f", - "lastUpdatedDateTime": "2022-09-06T19:07:48Z", - "createdDateTime": "2022-09-06T19:07:47Z", - "expirationDateTime": "2022-09-07T19:07:47Z", + "jobId": "32504518-601b-4126-a03d-1d4ba4b73cdb", + "lastUpdatedDateTime": "2022-10-17T22:09:53Z", + "createdDateTime": "2022-10-17T22:09:52Z", + "expirationDateTime": "2022-10-18T22:09:52Z", + "status": "running", + "errors": [], + "displayName": "Analyze PII in conversation", + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1, + "items": [] + } + } + }, + { + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/32504518-601b-4126-a03d-1d4ba4b73cdb?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Ocp-Apim-Subscription-Key": "0000000000000000", + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "ab90cc66-81a8-4668-9f70-b2f56f902afd", + "Content-Length": "1529", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 Oct 2022 22:09:57 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "92" + }, + "ResponseBody": { + "jobId": "32504518-601b-4126-a03d-1d4ba4b73cdb", + "lastUpdatedDateTime": "2022-10-17T22:09:53Z", + "createdDateTime": "2022-10-17T22:09:52Z", + "expirationDateTime": "2022-10-18T22:09:52Z", "status": "succeeded", "errors": [], "displayName": "Analyze PII in conversation", @@ -111,12 +148,12 @@ "items": [ { "kind": "conversationalPIIResults", - "lastUpdateDateTime": "2022-09-06T19:07:48.0750104Z", + "lastUpdateDateTime": "2022-10-17T22:09:53.527091Z", "status": "succeeded", "results": { "conversations": [ { - "id": "1", + "id": "1.0", "conversationItems": [ { "id": "1", diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_summarization.pyTestConversationalSummarizationtest_conversational_summarization.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_summarization.pyTestConversationalSummarizationtest_conversational_summarization.json index 100558261c6e..3a55ce312e08 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_summarization.pyTestConversationalSummarizationtest_conversational_summarization.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_summarization.pyTestConversationalSummarizationtest_conversational_summarization.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -10,7 +10,7 @@ "Content-Length": "692", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "displayName": "Analyze conversations from xxx", @@ -57,42 +57,80 @@ }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "a994e213-581b-47c4-b1ad-325b6e8fb2c7", + "apim-request-id": "3f5270da-dc02-43b5-bc36-7e6644bdd1f2", "Content-Length": "0", - "Date": "Tue, 06 Sep 2022 19:08:18 GMT", - "operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/191e8239-00a6-4c34-a775-121eb654d665?api-version=2022-05-15-preview", + "Date": "Mon, 17 Oct 2022 22:09:58 GMT", + "operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/2b72ef0f-d157-4f53-ad76-bcd05260cd0d?api-version=2022-10-01-preview", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "165" + "x-envoy-upstream-service-time": "130" }, "ResponseBody": null }, { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/191e8239-00a6-4c34-a775-121eb654d665?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/2b72ef0f-d157-4f53-ad76-bcd05260cd0d?api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "1a1cd267-02c5-4a5d-8f4f-792dd61ca2d6", - "Content-Length": "756", + "apim-request-id": "c67b4ae9-1818-4816-bba6-f3d51561763e", + "Content-Length": "330", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:08:47 GMT", + "Date": "Mon, 17 Oct 2022 22:09:58 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "170" + "x-envoy-upstream-service-time": "8" }, "ResponseBody": { - "jobId": "191e8239-00a6-4c34-a775-121eb654d665", - "lastUpdatedDateTime": "2022-09-06T19:08:20Z", - "createdDateTime": "2022-09-06T19:08:18Z", - "expirationDateTime": "2022-09-07T19:08:18Z", + "jobId": "2b72ef0f-d157-4f53-ad76-bcd05260cd0d", + "lastUpdatedDateTime": "2022-10-17T22:09:59Z", + "createdDateTime": "2022-10-17T22:09:59Z", + "expirationDateTime": "2022-10-18T22:09:59Z", + "status": "notStarted", + "errors": [], + "displayName": "Analyze conversations from xxx", + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1, + "items": [] + } + } + }, + { + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/2b72ef0f-d157-4f53-ad76-bcd05260cd0d?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Ocp-Apim-Subscription-Key": "0000000000000000", + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "bba29e4f-29ec-4047-9963-98a34531598c", + "Content-Length": "807", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 Oct 2022 22:10:04 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31" + }, + "ResponseBody": { + "jobId": "2b72ef0f-d157-4f53-ad76-bcd05260cd0d", + "lastUpdatedDateTime": "2022-10-17T22:10:00Z", + "createdDateTime": "2022-10-17T22:09:59Z", + "expirationDateTime": "2022-10-18T22:09:59Z", "status": "succeeded", "errors": [], "displayName": "Analyze conversations from xxx", @@ -105,27 +143,40 @@ { "kind": "conversationalSummarizationResults", "taskName": "analyze 1", - "lastUpdateDateTime": "2022-09-06T19:08:20.2969073Z", + "lastUpdateDateTime": "2022-10-17T22:10:00.8411219Z", "status": "succeeded", "results": { "conversations": [ { - "id": "conversation1", "summaries": [ { - "aspect": "issue", - "text": "Customer wants to upgrade Office" - }, - { - "aspect": "resolution", - "text": "Asked for the error message | Asked for help to upgrade Office" + "aspect": "chapterTitle", + "text": "How to Upgrade Office", + "contexts": [ + { + "conversationItemId": "1", + "offset": 0, + "length": 26 + }, + { + "conversationItemId": "2", + "offset": 0, + "length": 65 + }, + { + "conversationItemId": "3", + "offset": 0, + "length": 74 + } + ] } ], + "id": "conversation1", "warnings": [] } ], "errors": [], - "modelVersion": "2022-05-15-preview" + "modelVersion": "latest" } } ] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_summarization_async.pyTestConversationalSummarizationAsynctest_conversational_summarization.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_summarization_async.pyTestConversationalSummarizationAsynctest_conversational_summarization.json index e09b70b7a225..22ee40f6e5f1 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_summarization_async.pyTestConversationalSummarizationAsynctest_conversational_summarization.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conv_summarization_async.pyTestConversationalSummarizationAsynctest_conversational_summarization.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -9,7 +9,7 @@ "Content-Length": "692", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "displayName": "Analyze conversations from xxx", @@ -56,41 +56,78 @@ }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "a8e5035d-2acc-419a-b820-7f1042ad7a04", + "apim-request-id": "1a7d6c01-5e86-4cf1-8729-981ec07d1c2f", "Content-Length": "0", - "Date": "Tue, 06 Sep 2022 19:08:49 GMT", - "operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/e299ce63-1fb5-40eb-b53d-0abe9883cbd7?api-version=2022-05-15-preview", + "Date": "Mon, 17 Oct 2022 22:10:04 GMT", + "operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/e3e2175e-8ff4-44bd-844c-69938cfafbb6?api-version=2022-10-01-preview", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "312" + "x-envoy-upstream-service-time": "106" }, "ResponseBody": null }, { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/e299ce63-1fb5-40eb-b53d-0abe9883cbd7?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/e3e2175e-8ff4-44bd-844c-69938cfafbb6?api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "1ff0008c-a795-42b5-b8a3-64e1d0b8a21b", - "Content-Length": "756", + "apim-request-id": "62bff25e-a45d-420a-80b6-d3a171eb5a22", + "Content-Length": "330", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:09:19 GMT", + "Date": "Mon, 17 Oct 2022 22:10:04 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "144" + "x-envoy-upstream-service-time": "8" }, "ResponseBody": { - "jobId": "e299ce63-1fb5-40eb-b53d-0abe9883cbd7", - "lastUpdatedDateTime": "2022-09-06T19:08:51Z", - "createdDateTime": "2022-09-06T19:08:48Z", - "expirationDateTime": "2022-09-07T19:08:48Z", + "jobId": "e3e2175e-8ff4-44bd-844c-69938cfafbb6", + "lastUpdatedDateTime": "2022-10-17T22:10:05Z", + "createdDateTime": "2022-10-17T22:10:04Z", + "expirationDateTime": "2022-10-18T22:10:04Z", + "status": "notStarted", + "errors": [], + "displayName": "Analyze conversations from xxx", + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1, + "items": [] + } + } + }, + { + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/e3e2175e-8ff4-44bd-844c-69938cfafbb6?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Ocp-Apim-Subscription-Key": "0000000000000000", + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "4c140fb4-1634-4d32-9e42-651eaa54ce85", + "Content-Length": "807", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 Oct 2022 22:10:10 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "125" + }, + "ResponseBody": { + "jobId": "e3e2175e-8ff4-44bd-844c-69938cfafbb6", + "lastUpdatedDateTime": "2022-10-17T22:10:06Z", + "createdDateTime": "2022-10-17T22:10:04Z", + "expirationDateTime": "2022-10-18T22:10:04Z", "status": "succeeded", "errors": [], "displayName": "Analyze conversations from xxx", @@ -103,27 +140,40 @@ { "kind": "conversationalSummarizationResults", "taskName": "analyze 1", - "lastUpdateDateTime": "2022-09-06T19:08:51.2518056Z", + "lastUpdateDateTime": "2022-10-17T22:10:06.6652137Z", "status": "succeeded", "results": { "conversations": [ { - "id": "conversation1", "summaries": [ { - "aspect": "issue", - "text": "Customer wants to upgrade Office" - }, - { - "aspect": "resolution", - "text": "Asked for the error message | Asked for help to upgrade Office" + "aspect": "chapterTitle", + "text": "How to Upgrade Office", + "contexts": [ + { + "conversationItemId": "1", + "offset": 0, + "length": 26 + }, + { + "conversationItemId": "2", + "offset": 0, + "length": 65 + }, + { + "conversationItemId": "3", + "offset": 0, + "length": 74 + } + ] } ], + "id": "conversation1", "warnings": [] } ], "errors": [], - "modelVersion": "2022-05-15-preview" + "modelVersion": "latest" } } ] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app.pyTestConversationApptest_conversation_app.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app.pyTestConversationApptest_conversation_app.json index 197a12c8e85e..c6434543bd44 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app.pyTestConversationApptest_conversation_app.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app.pyTestConversationApptest_conversation_app.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -10,7 +10,7 @@ "Content-Length": "314", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "kind": "Conversation", @@ -32,17 +32,17 @@ }, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "0bab0976-7917-4982-879a-5cb86b70dbeb", + "apim-request-id": "918dadc7-70a8-465c-886c-3084901597da", "Cache-Control": "no-store, proxy-revalidate, no-cache, max-age=0, private", "Content-Type": "application/json; charset=utf-8", "csp-billing-usage": "CognitiveServices.TextAnalytics.Language.ConversationalLanguageUnderstanding.Prediction=1", - "Date": "Tue, 06 Sep 2022 19:09:20 GMT", + "Date": "Mon, 17 Oct 2022 22:10:11 GMT", "Pragma": "no-cache", - "request-id": "0bab0976-7917-4982-879a-5cb86b70dbeb", + "request-id": "918dadc7-70a8-465c-886c-3084901597da", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "1095" + "x-envoy-upstream-service-time": "954" }, "ResponseBody": { "kind": "ConversationResult", @@ -113,8 +113,8 @@ { "resolutionKind": "DateTimeResolution", "dateTimeSubKind": "Date", - "timex": "2022-09-07", - "value": "2022-09-07" + "timex": "2022-10-18", + "value": "2022-10-18" } ], "extraInformation": [ diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app.pyTestConversationApptest_conversation_app_aad_auth.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app.pyTestConversationApptest_conversation_app_aad_auth.json index 302abc509489..d01ee102aae8 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app.pyTestConversationApptest_conversation_app_aad_auth.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app.pyTestConversationApptest_conversation_app_aad_auth.json @@ -7,7 +7,7 @@ "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", - "User-Agent": "azsdk-python-identity/1.11.0b4 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-identity/1.12.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, @@ -17,12 +17,12 @@ "Cache-Control": "max-age=86400, private", "Content-Length": "1753", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:09:21 GMT", + "Date": "Mon, 17 Oct 2022 22:16:34 GMT", "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", "Set-Cookie": "[set-cookie;]", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-ests-server": "2.1.13622.4 - NCUS ProdSlices", + "x-ms-ests-server": "2.1.13845.10 - SCUS ProdSlices", "X-XSS-Protection": "0" }, "ResponseBody": { @@ -100,7 +100,8 @@ "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", - "User-Agent": "azsdk-python-identity/1.11.0b4 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "Cookie": "fpc=AtedNJ6kcrlPteM1g0ztO_g; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.12.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": null, "StatusCode": 200, @@ -110,12 +111,12 @@ "Cache-Control": "max-age=86400, private", "Content-Length": "945", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 19:09:21 GMT", + "Date": "Mon, 17 Oct 2022 22:16:34 GMT", "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", "Set-Cookie": "[set-cookie;]", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-ests-server": "2.1.13562.12 - EUS ProdSlices", + "x-ms-ests-server": "2.1.13845.10 - SCUS ProdSlices", "X-XSS-Protection": "0" }, "ResponseBody": { @@ -166,7 +167,7 @@ } }, { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-05-01", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -174,7 +175,7 @@ "Connection": "keep-alive", "Content-Length": "314", "Content-Type": "application/json", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "kind": "Conversation", @@ -194,102 +195,19 @@ "verbose": true } }, - "StatusCode": 200, + "StatusCode": 400, "ResponseHeaders": { - "apim-request-id": "0b30f86a-91f7-4fc2-a518-4ce5bc976907", - "Cache-Control": "no-store, proxy-revalidate, no-cache, max-age=0, private", - "Content-Type": "application/json; charset=utf-8", - "csp-billing-usage": "CognitiveServices.TextAnalytics.Language.ConversationalLanguageUnderstanding.Prediction=1", - "Date": "Tue, 06 Sep 2022 19:09:21 GMT", - "Pragma": "no-cache", - "request-id": "0b30f86a-91f7-4fc2-a518-4ce5bc976907", + "apim-request-id": "bc42c361-4863-4ea4-a711-c4ad92a286d1", + "Content-Length": "203", + "Content-Type": "application/json", + "Date": "Mon, 17 Oct 2022 22:16:35 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "537" + "X-Content-Type-Options": "nosniff" }, "ResponseBody": { - "kind": "ConversationResult", - "result": { - "query": "Send an email to Carol about the tomorrow\u0027s demo", - "prediction": { - "topIntent": "Send", - "projectKind": "Conversation", - "intents": [ - { - "category": "Send", - "confidenceScore": 0.9053172 - }, - { - "category": "Read", - "confidenceScore": 0.44011447 - }, - { - "category": "Setup", - "confidenceScore": 0.41303915 - }, - { - "category": "Set", - "confidenceScore": 0.21186642 - }, - { - "category": "None", - "confidenceScore": 0.20198277 - }, - { - "category": "Find", - "confidenceScore": 0.19216746 - }, - { - "category": "Call", - "confidenceScore": 0.16446844 - }, - { - "category": "Play", - "confidenceScore": 0.15655291 - }, - { - "category": "Open", - "confidenceScore": 0.08699014 - } - ], - "entities": [ - { - "category": "Contact", - "text": "Carol", - "offset": 17, - "length": 5, - "confidenceScore": 1, - "extraInformation": [ - { - "extraInformationKind": "EntitySubtype", - "value": "person.name" - } - ] - }, - { - "category": "MeetingDate", - "text": "tomorrow", - "offset": 33, - "length": 8, - "confidenceScore": 1, - "resolutions": [ - { - "resolutionKind": "DateTimeResolution", - "dateTimeSubKind": "Date", - "timex": "2022-09-07", - "value": "2022-09-07" - } - ], - "extraInformation": [ - { - "extraInformationKind": "EntitySubtype", - "value": "datetime.date" - } - ] - } - ] - } + "error": { + "code": "API operation not supported for token authentication", + "message": "ApiId Language-2022-10-01-preview OperationId ConversationAnalysis_AnalyzeConversation not supported for CheckAccess." } } } diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app_async.pyTestConversationAppAsynctest_conversation_app.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app_async.pyTestConversationAppAsynctest_conversation_app.json index 973c503ba04c..0be7a57ce551 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app_async.pyTestConversationAppAsynctest_conversation_app.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app_async.pyTestConversationAppAsynctest_conversation_app.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -9,7 +9,7 @@ "Content-Length": "314", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "kind": "Conversation", @@ -31,17 +31,17 @@ }, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "fd31a60d-a439-4e24-9de1-e581fc9ef141", + "apim-request-id": "1582278d-6d06-41c9-ba54-afa14dda99e4", "Cache-Control": "no-store, proxy-revalidate, no-cache, max-age=0, private", "Content-Type": "application/json; charset=utf-8", "csp-billing-usage": "CognitiveServices.TextAnalytics.Language.ConversationalLanguageUnderstanding.Prediction=1", - "Date": "Tue, 06 Sep 2022 19:09:22 GMT", + "Date": "Mon, 17 Oct 2022 22:10:13 GMT", "Pragma": "no-cache", - "request-id": "fd31a60d-a439-4e24-9de1-e581fc9ef141", + "request-id": "1582278d-6d06-41c9-ba54-afa14dda99e4", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "471" + "x-envoy-upstream-service-time": "383" }, "ResponseBody": { "kind": "ConversationResult", @@ -112,8 +112,8 @@ { "resolutionKind": "DateTimeResolution", "dateTimeSubKind": "Date", - "timex": "2022-09-07", - "value": "2022-09-07" + "timex": "2022-10-18", + "value": "2022-10-18" } ], "extraInformation": [ diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app_async.pyTestConversationAppAsynctest_conversation_app_aad_auth.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app_async.pyTestConversationAppAsynctest_conversation_app_aad_auth.json index f08ad73d4656..612ee7e4d392 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app_async.pyTestConversationAppAsynctest_conversation_app_aad_auth.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_conversation_app_async.pyTestConversationAppAsynctest_conversation_app_aad_auth.json @@ -8,7 +8,7 @@ "Accept-Encoding": "gzip, deflate", "Content-Length": "314", "Content-Type": "application/json", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "kind": "Conversation", @@ -30,17 +30,17 @@ }, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "b30476d8-f5b6-4cbd-afef-ca3bbd99b8b7", + "apim-request-id": "b9f68be8-306a-4750-beb7-899ad7073a20", "Cache-Control": "no-store, proxy-revalidate, no-cache, max-age=0, private", "Content-Type": "application/json; charset=utf-8", "csp-billing-usage": "CognitiveServices.TextAnalytics.Language.ConversationalLanguageUnderstanding.Prediction=1", - "Date": "Tue, 06 Sep 2022 19:09:22 GMT", + "Date": "Mon, 17 Oct 2022 22:10:14 GMT", "Pragma": "no-cache", - "request-id": "b30476d8-f5b6-4cbd-afef-ca3bbd99b8b7", + "request-id": "b9f68be8-306a-4750-beb7-899ad7073a20", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "105" + "x-envoy-upstream-service-time": "136" }, "ResponseBody": { "kind": "ConversationResult", @@ -111,8 +111,8 @@ { "resolutionKind": "DateTimeResolution", "dateTimeSubKind": "Date", - "timex": "2022-09-07", - "value": "2022-09-07" + "timex": "2022-10-18", + "value": "2022-10-18" } ], "extraInformation": [ diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_conv_response.pyTestOrchestrationAppConvResponsetest_orchestration_app_conv_response.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_conv_response.pyTestOrchestrationAppConvResponsetest_orchestration_app_conv_response.json index 5c1b124b9d8e..699511a351e9 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_conv_response.pyTestOrchestrationAppConvResponsetest_orchestration_app_conv_response.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_conv_response.pyTestOrchestrationAppConvResponsetest_orchestration_app_conv_response.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -10,7 +10,7 @@ "Content-Length": "314", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "kind": "Conversation", @@ -32,17 +32,17 @@ }, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "0a66cdfa-67c6-4df7-bfc4-9a3526094a46", + "apim-request-id": "6535b9c5-0e48-4282-bce4-6dddef4047ec", "Cache-Control": "no-store, proxy-revalidate, no-cache, max-age=0, private", "Content-Type": "application/json; charset=utf-8", "csp-billing-usage": "CognitiveServices.TextAnalytics.Language.OrchestrationWorkflow.Prediction=1", - "Date": "Tue, 06 Sep 2022 19:09:23 GMT", + "Date": "Mon, 17 Oct 2022 22:10:15 GMT", "Pragma": "no-cache", - "request-id": "0a66cdfa-67c6-4df7-bfc4-9a3526094a46", + "request-id": "6535b9c5-0e48-4282-bce4-6dddef4047ec", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "499" + "x-envoy-upstream-service-time": "1008" }, "ResponseBody": { "kind": "ConversationResult", @@ -122,8 +122,8 @@ { "resolutionKind": "DateTimeResolution", "dateTimeSubKind": "Date", - "timex": "2022-09-07", - "value": "2022-09-07" + "timex": "2022-10-18", + "value": "2022-10-18" } ], "extraInformation": [ diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_conv_response_async.pyTestOrchestrationAppConvResponseAsynctest_orchestration_app_conv_response.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_conv_response_async.pyTestOrchestrationAppConvResponseAsynctest_orchestration_app_conv_response.json index c3e43ecce66c..5123ef7afb0a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_conv_response_async.pyTestOrchestrationAppConvResponseAsynctest_orchestration_app_conv_response.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_conv_response_async.pyTestOrchestrationAppConvResponseAsynctest_orchestration_app_conv_response.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -9,7 +9,7 @@ "Content-Length": "314", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "kind": "Conversation", @@ -31,17 +31,17 @@ }, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "d02363f2-7a5f-4f47-a27c-446b0b716b63", + "apim-request-id": "811d0874-bd41-426e-9c67-749352832128", "Cache-Control": "no-store, proxy-revalidate, no-cache, max-age=0, private", "Content-Type": "application/json; charset=utf-8", "csp-billing-usage": "CognitiveServices.TextAnalytics.Language.OrchestrationWorkflow.Prediction=1", - "Date": "Tue, 06 Sep 2022 19:09:23 GMT", + "Date": "Mon, 17 Oct 2022 22:10:16 GMT", "Pragma": "no-cache", - "request-id": "d02363f2-7a5f-4f47-a27c-446b0b716b63", + "request-id": "811d0874-bd41-426e-9c67-749352832128", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "162" + "x-envoy-upstream-service-time": "365" }, "ResponseBody": { "kind": "ConversationResult", @@ -121,8 +121,8 @@ { "resolutionKind": "DateTimeResolution", "dateTimeSubKind": "Date", - "timex": "2022-09-07", - "value": "2022-09-07" + "timex": "2022-10-18", + "value": "2022-10-18" } ], "extraInformation": [ diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_qna_response.pyTestOrchestrationAppQnaResponsetest_orchestration_app_qna_response.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_qna_response.pyTestOrchestrationAppQnaResponsetest_orchestration_app_qna_response.json index 4236b77d47bb..0586b2c69ddb 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_qna_response.pyTestOrchestrationAppQnaResponsetest_orchestration_app_qna_response.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_qna_response.pyTestOrchestrationAppQnaResponsetest_orchestration_app_qna_response.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -10,7 +10,7 @@ "Content-Length": "278", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "kind": "Conversation", @@ -32,17 +32,17 @@ }, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "4103ff35-8748-44bb-b0b8-3c2dbe45509e", + "apim-request-id": "1a8cb47d-4ccb-450c-9a74-00a138221648", "Cache-Control": "no-store, proxy-revalidate, no-cache, max-age=0, private", "Content-Type": "application/json; charset=utf-8", "csp-billing-usage": "CognitiveServices.TextAnalytics.Language.OrchestrationWorkflow.Prediction=1", - "Date": "Tue, 06 Sep 2022 19:09:25 GMT", + "Date": "Mon, 17 Oct 2022 22:10:17 GMT", "Pragma": "no-cache", - "request-id": "4103ff35-8748-44bb-b0b8-3c2dbe45509e", + "request-id": "1a8cb47d-4ccb-450c-9a74-00a138221648", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "854" + "x-envoy-upstream-service-time": "1427" }, "ResponseBody": { "kind": "ConversationResult", diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_qna_response_async.pyTestOrchestrationAppQnaResponseAsynctest_orchestration_app_qna_response.json b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_qna_response_async.pyTestOrchestrationAppQnaResponseAsynctest_orchestration_app_qna_response.json index a72acbaeda52..4c477ccd0632 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_qna_response_async.pyTestOrchestrationAppQnaResponseAsynctest_orchestration_app_qna_response.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/recordings/test_orchestration_app_qna_response_async.pyTestOrchestrationAppQnaResponseAsynctest_orchestration_app_qna_response.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-05-15-preview", + "RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/:analyze-conversations?api-version=2022-10-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", @@ -9,7 +9,7 @@ "Content-Length": "278", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "0000000000000000", - "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.6 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)" + "User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)" }, "RequestBody": { "kind": "Conversation", @@ -31,17 +31,17 @@ }, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "b9035499-1cfc-405f-bd1a-41b2cac4d0a8", + "apim-request-id": "5c520c32-c303-4bc0-8f4f-190f3fa1ad14", "Cache-Control": "no-store, proxy-revalidate, no-cache, max-age=0, private", "Content-Type": "application/json; charset=utf-8", "csp-billing-usage": "CognitiveServices.TextAnalytics.Language.OrchestrationWorkflow.Prediction=1", - "Date": "Tue, 06 Sep 2022 19:09:26 GMT", + "Date": "Mon, 17 Oct 2022 22:10:19 GMT", "Pragma": "no-cache", - "request-id": "b9035499-1cfc-405f-bd1a-41b2cac4d0a8", + "request-id": "5c520c32-c303-4bc0-8f4f-190f3fa1ad14", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "907" + "x-envoy-upstream-service-time": "548" }, "ResponseBody": { "kind": "ConversationResult", diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_authoring.py b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_authoring.py index 8c3fd4b6ae21..d62bcf11d4bf 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_authoring.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_authoring.py @@ -20,7 +20,7 @@ def test_polling_interval(self, conversation_creds): def test_authoring_aad(self, recorded_test, conversation_creds): token = self.get_credential(ConversationAuthoringClient) - client = ConversationAuthoringClient(conversation_creds["endpoint"], token, api_version="2022-05-01") + client = ConversationAuthoringClient(conversation_creds["endpoint"], token) entities = client.list_supported_prebuilt_entities(language="en") for entity in entities: assert entity diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_authoring_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_authoring_async.py index 0b1a2be92497..e66a177c4fdc 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_authoring_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_authoring_async.py @@ -22,7 +22,7 @@ def test_polling_interval(self, conversation_creds): @pytest.mark.asyncio async def test_authoring_aad(self, recorded_test, conversation_creds): token = self.get_credential(ConversationAuthoringClient, is_async=True) - client = ConversationAuthoringClient(conversation_creds["endpoint"], token, api_version="2022-05-01") + client = ConversationAuthoringClient(conversation_creds["endpoint"], token) entities = client.list_supported_prebuilt_entities(language="en") async for entity in entities: assert entity diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app.py b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app.py index a480914d5019..4b199c8df07f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app.py @@ -62,9 +62,10 @@ def test_conversation_app(self, recorded_test, conversation_creds): assert result["result"]["prediction"]["entities"][0]["text"] == 'Carol' assert result["result"]["prediction"]["entities"][0]["confidenceScore"] > 0 + @pytest.mark.skip("no runtime AAD yet for 2022-10-01-preview") def test_conversation_app_aad_auth(self, recorded_test, conversation_creds): token = self.get_credential(ConversationAnalysisClient) - client = ConversationAnalysisClient(conversation_creds["endpoint"], token, api_version="2022-05-01") + client = ConversationAnalysisClient(conversation_creds["endpoint"], token) with client: query = "Send an email to Carol about the tomorrow's demo" result = client.analyze_conversation( diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app_async.py index 39c9d99e7bc0..28ac8140011b 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app_async.py @@ -63,10 +63,11 @@ async def test_conversation_app(self, recorded_test, conversation_creds): assert result["result"]["prediction"]["entities"][0]["text"] == 'Carol' assert result["result"]["prediction"]["entities"][0]["confidenceScore"] > 0 + @pytest.mark.skip("no runtime AAD yet for 2022-10-01-preview") @pytest.mark.asyncio async def test_conversation_app_aad_auth(self, recorded_test, conversation_creds): token = self.get_credential(ConversationAnalysisClient, is_async=True) - client = ConversationAnalysisClient(conversation_creds["endpoint"], token, api_version="2022-05-01") + client = ConversationAnalysisClient(conversation_creds["endpoint"], token) async with client: query = "Send an email to Carol about the tomorrow's demo" result = await client.analyze_conversation( From a809b13f7b2938961a9d505efdff10db2275c880 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Mon, 17 Oct 2022 16:29:08 -0700 Subject: [PATCH 7/7] add separation between doc comment and link --- .../conversations/_operations/_operations.py | 30 ++- .../aio/_operations/_operations.py | 30 ++- .../authoring/_operations/_operations.py | 225 +++++++++++++----- .../authoring/aio/_operations/_operations.py | 225 +++++++++++++----- .../swagger/README.md | 6 +- 5 files changed, 365 insertions(+), 151 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py index 02d702665157..ca5adacbe66c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_operations/_operations.py @@ -87,7 +87,9 @@ def build_conversation_analysis_request(**kwargs: Any) -> HttpRequest: class ConversationAnalysisClientOperationsMixin(MixinABC): @overload def analyze_conversation(self, task: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. See + """Analyzes the input conversation utterance. + + See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information. @@ -204,7 +206,9 @@ def analyze_conversation(self, task: JSON, *, content_type: str = "application/j @overload def analyze_conversation(self, task: IO, *, content_type: str = "application/json", **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. See + """Analyzes the input conversation utterance. + + See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information. @@ -279,7 +283,9 @@ def analyze_conversation(self, task: IO, *, content_type: str = "application/jso @distributed_trace def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. See + """Analyzes the input conversation utterance. + + See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information. @@ -478,8 +484,10 @@ def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for - more information. + executed. + + See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -599,8 +607,10 @@ def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for - more information. + executed. + + See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -705,8 +715,10 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for - more information. + executed. + + See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Is either a model type or a IO type. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py index 1539b13a1aca..9c1b6fe12ef1 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_operations/_operations.py @@ -40,7 +40,9 @@ class ConversationAnalysisClientOperationsMixin(MixinABC): @overload async def analyze_conversation(self, task: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. See + """Analyzes the input conversation utterance. + + See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information. @@ -157,7 +159,9 @@ async def analyze_conversation(self, task: JSON, *, content_type: str = "applica @overload async def analyze_conversation(self, task: IO, *, content_type: str = "application/json", **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. See + """Analyzes the input conversation utterance. + + See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information. @@ -232,7 +236,9 @@ async def analyze_conversation(self, task: IO, *, content_type: str = "applicati @distributed_trace_async async def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JSON: - """Analyzes the input conversation utterance. See + """Analyzes the input conversation utterance. + + See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information. @@ -431,8 +437,10 @@ async def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for - more information. + executed. + + See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -552,8 +560,10 @@ async def begin_conversation_analysis( """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for - more information. + executed. + + See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Required. @@ -658,8 +668,10 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any """Submit analysis job for conversations. Submit a collection of conversations for analysis. Specify one or more unique tasks to be - executed. See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for - more information. + executed. + + See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more + information. :param task: The collection of conversations to analyze and one or more tasks to execute. Is either a model type or a IO type. Required. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py index e148dd2affb8..d2a4eca62eca 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_operations.py @@ -1089,7 +1089,9 @@ def build_list_training_config_versions_request( class ConversationAuthoringClientOperationsMixin(MixinABC): # pylint: disable=too-many-public-methods @distributed_trace def list_projects(self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any) -> Iterable[JSON]: - """Lists the existing projects. See + """Lists the existing projects. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-projects for more information. @@ -1214,7 +1216,9 @@ def get_next(next_link=None): def create_project( self, project_name: str, project: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Creates a new project or updates an existing one. See + """Creates a new project or updates an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project for more information. @@ -1287,7 +1291,9 @@ def create_project( def create_project( self, project_name: str, project: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Creates a new project or updates an existing one. See + """Creates a new project or updates an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project for more information. @@ -1337,7 +1343,9 @@ def create_project( @distributed_trace def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: Any) -> JSON: - """Creates a new project or updates an existing one. See + """Creates a new project or updates an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project for more information. @@ -1449,9 +1457,10 @@ def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: @distributed_trace def get_project(self, project_name: str, **kwargs: Any) -> JSON: - """Gets the details of a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project for - more information. + """Gets the details of a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1590,7 +1599,9 @@ def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Optional[ @distributed_trace def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[JSON]: - """Deletes a project. See + """Deletes a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-project for more information. @@ -1786,9 +1797,10 @@ def begin_export_project( trained_model_label: Optional[str] = None, **kwargs: Any ) -> LROPoller[JSON]: - """Triggers a job to export a project's data. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/export for more - information. + """Triggers a job to export a project's data. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/export for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2010,9 +2022,10 @@ def begin_import_project( **kwargs: Any ) -> LROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more - information. + that project is replaced. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2244,9 +2257,10 @@ def begin_import_project( **kwargs: Any ) -> LROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more - information. + that project is replaced. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2338,9 +2352,10 @@ def begin_import_project( **kwargs: Any ) -> LROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more - information. + that project is replaced. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2542,9 +2557,10 @@ def _train_initial(self, project_name: str, configuration: Union[JSON, IO], **kw def begin_train( self, project_name: str, configuration: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Triggers a training job for a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more - information. + """Triggers a training job for a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2681,9 +2697,10 @@ def begin_train( def begin_train( self, project_name: str, configuration: IO, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Triggers a training job for a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more - information. + """Triggers a training job for a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2797,9 +2814,10 @@ def begin_train( @distributed_trace def begin_train(self, project_name: str, configuration: Union[JSON, IO], **kwargs: Any) -> LROPoller[JSON]: - """Triggers a training job for a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more - information. + """Triggers a training job for a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -2966,7 +2984,9 @@ def get_long_running_output(pipeline_response): def list_deployments( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the deployments belonging to a project. See + """Lists the deployments belonging to a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployments for more information. @@ -3153,7 +3173,9 @@ def _swap_deployments_initial( def begin_swap_deployments( self, project_name: str, deployments: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Swaps two existing deployments with each other. See + """Swaps two existing deployments with each other. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments for more information. @@ -3246,7 +3268,9 @@ def begin_swap_deployments( def begin_swap_deployments( self, project_name: str, deployments: IO, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Swaps two existing deployments with each other. See + """Swaps two existing deployments with each other. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments for more information. @@ -3329,7 +3353,9 @@ def begin_swap_deployments( @distributed_trace def begin_swap_deployments(self, project_name: str, deployments: Union[JSON, IO], **kwargs: Any) -> LROPoller[JSON]: - """Swaps two existing deployments with each other. See + """Swaps two existing deployments with each other. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments for more information. @@ -3463,7 +3489,9 @@ def get_long_running_output(pipeline_response): @distributed_trace def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> JSON: - """Gets the details of a deployment. See + """Gets the details of a deployment. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment for more information. @@ -3622,7 +3650,9 @@ def begin_deploy_project( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Creates a new deployment or replaces an existing one. See + """Creates a new deployment or replaces an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project for more information. @@ -3692,7 +3722,9 @@ def begin_deploy_project( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[JSON]: - """Creates a new deployment or replaces an existing one. See + """Creates a new deployment or replaces an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project for more information. @@ -3745,7 +3777,9 @@ def begin_deploy_project( def begin_deploy_project( self, project_name: str, deployment_name: str, deployment: Union[JSON, IO], **kwargs: Any ) -> LROPoller[JSON]: - """Creates a new deployment or replaces an existing one. See + """Creates a new deployment or replaces an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project for more information. @@ -3901,7 +3935,9 @@ def _delete_deployment_initial(self, project_name: str, deployment_name: str, ** @distributed_trace def begin_delete_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> LROPoller[JSON]: - """Deletes a project deployment. See + """Deletes a project deployment. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment for more information. @@ -4093,7 +4129,9 @@ def begin_delete_deployment_from_resources( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Deletes a project deployment from the specified assigned resources. See + """Deletes a project deployment from the specified assigned resources. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources for more information. @@ -4142,7 +4180,9 @@ def begin_delete_deployment_from_resources( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Deletes a project deployment from the specified assigned resources. See + """Deletes a project deployment from the specified assigned resources. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources for more information. @@ -4171,7 +4211,9 @@ def begin_delete_deployment_from_resources( def begin_delete_deployment_from_resources( self, project_name: str, deployment_name: str, body: Union[JSON, IO], **kwargs: Any ) -> LROPoller[None]: - """Deletes a project deployment from the specified assigned resources. See + """Deletes a project deployment from the specified assigned resources. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources for more information. @@ -4246,7 +4288,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def get_deployment_delete_from_resources_status( self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any ) -> JSON: - """Gets the status of an existing delete deployment from specific resources job. See + """Gets the status of an existing delete deployment from specific resources job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-delete-from-resources-status for more information. @@ -4366,7 +4410,9 @@ def get_deployment_delete_from_resources_status( @distributed_trace def get_deployment_job_status(self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing deployment job. See + """Gets the status of an existing deployment job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status for more information. @@ -4486,7 +4532,9 @@ def get_deployment_job_status(self, project_name: str, deployment_name: str, job @distributed_trace def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing swap deployment job. See + """Gets the status of an existing swap deployment job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status for more information. @@ -4604,6 +4652,7 @@ def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwar @distributed_trace def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: """Gets the status of an export job. Once job completes, returns the project metadata, and assets. + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status for more information. @@ -4723,7 +4772,9 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs @distributed_trace def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for an import. See + """Gets the status for an import. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status for more information. @@ -4842,7 +4893,9 @@ def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs def list_trained_models( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the trained models belonging to a project. See + """Lists the trained models belonging to a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models for more information. @@ -4954,7 +5007,9 @@ def get_next(next_link=None): @distributed_trace def get_trained_model(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: - """Gets the details of a trained model. See + """Gets the details of a trained model. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-trained-model for more information. @@ -5033,7 +5088,9 @@ def get_trained_model(self, project_name: str, trained_model_label: str, **kwarg def delete_trained_model( # pylint: disable=inconsistent-return-statements self, project_name: str, trained_model_label: str, **kwargs: Any ) -> None: - """Deletes an existing trained model. See + """Deletes an existing trained model. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-trained-model for more information. @@ -5130,6 +5187,7 @@ def _load_snapshot_initial( # pylint: disable=inconsistent-return-statements @distributed_trace def begin_load_snapshot(self, project_name: str, trained_model_label: str, **kwargs: Any) -> LROPoller[None]: """Restores the snapshot of this trained model to be the current working directory of the project. + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/load-snapshot for more information. @@ -5204,7 +5262,9 @@ def list_model_evaluation_results( **kwargs: Any ) -> Iterable[JSON]: """Gets the detailed results of the evaluation for a trained model. This includes the raw - inference results for the data included in the evaluation process. See + inference results for the data included in the evaluation process. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-results for more information. @@ -5345,7 +5405,9 @@ def get_next(next_link=None): @distributed_trace def get_model_evaluation_summary(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. See + measurements of the model e.g., F1, Precision, Recall, etc. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary for more information. @@ -5494,7 +5556,9 @@ def get_model_evaluation_summary(self, project_name: str, trained_model_label: s @distributed_trace def get_load_snapshot_status(self, project_name: str, trained_model_label: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for loading a snapshot. See + """Gets the status for loading a snapshot. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-load-snapshot-status for more information. @@ -5616,7 +5680,9 @@ def get_load_snapshot_status(self, project_name: str, trained_model_label: str, def list_deployment_resources( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the deployments resources assigned to the project. See + """Lists the deployments resources assigned to the project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployment-resources for more information. @@ -5780,6 +5846,7 @@ def begin_assign_deployment_resources( available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources for more information. @@ -5828,6 +5895,7 @@ def begin_assign_deployment_resources( available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources for more information. @@ -5859,6 +5927,7 @@ def begin_assign_deployment_resources( available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources for more information. @@ -5986,7 +6055,9 @@ def begin_unassign_deployment_resources( self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. See + and deletes existing deployments assigned to them. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources for more information. @@ -6025,7 +6096,9 @@ def begin_unassign_deployment_resources( self, project_name: str, body: IO, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. See + and deletes existing deployments assigned to them. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources for more information. @@ -6053,7 +6126,9 @@ def begin_unassign_deployment_resources( self, project_name: str, body: Union[JSON, IO], **kwargs: Any ) -> LROPoller[None]: """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. See + and deletes existing deployments assigned to them. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources for more information. @@ -6123,7 +6198,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get_assign_deployment_resources_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing assign deployment resources job. See + """Gets the status of an existing assign deployment resources job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-assign-deployment-resources-status for more information. @@ -6240,7 +6317,9 @@ def get_assign_deployment_resources_status(self, project_name: str, job_id: str, @distributed_trace def get_unassign_deployment_resources_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing unassign deployment resources job. See + """Gets the status of an existing unassign deployment resources job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-unassign-deployment-resources-status for more information. @@ -6359,7 +6438,9 @@ def get_unassign_deployment_resources_status(self, project_name: str, job_id: st def list_training_jobs( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the non-expired training jobs created for a project. See + """Lists the non-expired training jobs created for a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-jobs for more information. @@ -6544,7 +6625,9 @@ def get_next(next_link=None): @distributed_trace def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a training job. See + """Gets the status for a training job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-training-status for more information. @@ -6748,7 +6831,9 @@ def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: @distributed_trace def begin_cancel_training_job(self, project_name: str, job_id: str, **kwargs: Any) -> LROPoller[JSON]: - """Triggers a cancellation for a running training job. See + """Triggers a cancellation for a running training job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/cancel-training-job for more information. @@ -6909,7 +6994,9 @@ def get_long_running_output(pipeline_response): @distributed_trace def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a project deletion job. See + """Gets the status for a project deletion job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project-deletion-status for more information. @@ -7027,7 +7114,9 @@ def list_assigned_resource_deployments( ) -> Iterable[JSON]: """Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects - owned by other resources. See + owned by other resources. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-assigned-resource-deployments for more information. @@ -7138,7 +7227,9 @@ def get_next(next_link=None): def list_supported_languages( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the supported languages for the given project type. See + """Lists the supported languages for the given project type. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages for more information. @@ -7252,7 +7343,9 @@ def list_supported_prebuilt_entities( skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the supported prebuilt entities that can be used while creating composed entities. See + """Lists the supported prebuilt entities that can be used while creating composed entities. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-prebuilt-entities for more information. @@ -7364,7 +7457,9 @@ def get_next(next_link=None): def list_training_config_versions( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> Iterable[JSON]: - """Lists the support training config version for a given project type. See + """Lists the support training config version for a given project type. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions for more information. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py index a008c44e86ae..dd6813311944 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_operations.py @@ -84,7 +84,9 @@ class ConversationAuthoringClientOperationsMixin(MixinABC): # pylint: disable=t def list_projects( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the existing projects. See + """Lists the existing projects. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-projects for more information. @@ -209,7 +211,9 @@ async def get_next(next_link=None): async def create_project( self, project_name: str, project: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Creates a new project or updates an existing one. See + """Creates a new project or updates an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project for more information. @@ -282,7 +286,9 @@ async def create_project( async def create_project( self, project_name: str, project: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Creates a new project or updates an existing one. See + """Creates a new project or updates an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project for more information. @@ -332,7 +338,9 @@ async def create_project( @distributed_trace_async async def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: Any) -> JSON: - """Creates a new project or updates an existing one. See + """Creates a new project or updates an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/create-project for more information. @@ -444,9 +452,10 @@ async def create_project(self, project_name: str, project: Union[JSON, IO], **kw @distributed_trace_async async def get_project(self, project_name: str, **kwargs: Any) -> JSON: - """Gets the details of a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project for - more information. + """Gets the details of a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project + for more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -585,7 +594,9 @@ async def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Opt @distributed_trace_async async def begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncLROPoller[JSON]: - """Deletes a project. See + """Deletes a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-project for more information. @@ -782,9 +793,10 @@ async def begin_export_project( trained_model_label: Optional[str] = None, **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Triggers a job to export a project's data. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/export for more - information. + """Triggers a job to export a project's data. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/export for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1007,9 +1019,10 @@ async def begin_import_project( **kwargs: Any ) -> AsyncLROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more - information. + that project is replaced. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1241,9 +1254,10 @@ async def begin_import_project( **kwargs: Any ) -> AsyncLROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more - information. + that project is replaced. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1335,9 +1349,10 @@ async def begin_import_project( **kwargs: Any ) -> AsyncLROPoller[JSON]: """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for more - information. + that project is replaced. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/import for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1540,9 +1555,10 @@ async def _train_initial(self, project_name: str, configuration: Union[JSON, IO] async def begin_train( self, project_name: str, configuration: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Triggers a training job for a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more - information. + """Triggers a training job for a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1679,9 +1695,10 @@ async def begin_train( async def begin_train( self, project_name: str, configuration: IO, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Triggers a training job for a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more - information. + """Triggers a training job for a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1797,9 +1814,10 @@ async def begin_train( async def begin_train( self, project_name: str, configuration: Union[JSON, IO], **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Triggers a training job for a project. See - https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for more - information. + """Triggers a training job for a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/train for + more information. :param project_name: The name of the project to use. Required. :type project_name: str @@ -1967,7 +1985,9 @@ def get_long_running_output(pipeline_response): def list_deployments( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the deployments belonging to a project. See + """Lists the deployments belonging to a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployments for more information. @@ -2154,7 +2174,9 @@ async def _swap_deployments_initial( async def begin_swap_deployments( self, project_name: str, deployments: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Swaps two existing deployments with each other. See + """Swaps two existing deployments with each other. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments for more information. @@ -2247,7 +2269,9 @@ async def begin_swap_deployments( async def begin_swap_deployments( self, project_name: str, deployments: IO, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Swaps two existing deployments with each other. See + """Swaps two existing deployments with each other. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments for more information. @@ -2332,7 +2356,9 @@ async def begin_swap_deployments( async def begin_swap_deployments( self, project_name: str, deployments: Union[JSON, IO], **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Swaps two existing deployments with each other. See + """Swaps two existing deployments with each other. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/swap-deployments for more information. @@ -2467,7 +2493,9 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> JSON: - """Gets the details of a deployment. See + """Gets the details of a deployment. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment for more information. @@ -2626,7 +2654,9 @@ async def begin_deploy_project( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Creates a new deployment or replaces an existing one. See + """Creates a new deployment or replaces an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project for more information. @@ -2696,7 +2726,9 @@ async def begin_deploy_project( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Creates a new deployment or replaces an existing one. See + """Creates a new deployment or replaces an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project for more information. @@ -2749,7 +2781,9 @@ async def begin_deploy_project( async def begin_deploy_project( self, project_name: str, deployment_name: str, deployment: Union[JSON, IO], **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Creates a new deployment or replaces an existing one. See + """Creates a new deployment or replaces an existing one. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/deploy-project for more information. @@ -2910,7 +2944,9 @@ async def _delete_deployment_initial( async def begin_delete_deployment( self, project_name: str, deployment_name: str, **kwargs: Any ) -> AsyncLROPoller[JSON]: - """Deletes a project deployment. See + """Deletes a project deployment. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment for more information. @@ -3103,7 +3139,9 @@ async def begin_delete_deployment_from_resources( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a project deployment from the specified assigned resources. See + """Deletes a project deployment from the specified assigned resources. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources for more information. @@ -3152,7 +3190,9 @@ async def begin_delete_deployment_from_resources( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a project deployment from the specified assigned resources. See + """Deletes a project deployment from the specified assigned resources. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources for more information. @@ -3181,7 +3221,9 @@ async def begin_delete_deployment_from_resources( async def begin_delete_deployment_from_resources( self, project_name: str, deployment_name: str, body: Union[JSON, IO], **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a project deployment from the specified assigned resources. See + """Deletes a project deployment from the specified assigned resources. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-deployment-from-resources for more information. @@ -3257,7 +3299,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def get_deployment_delete_from_resources_status( self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any ) -> JSON: - """Gets the status of an existing delete deployment from specific resources job. See + """Gets the status of an existing delete deployment from specific resources job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-delete-from-resources-status for more information. @@ -3379,7 +3423,9 @@ async def get_deployment_delete_from_resources_status( async def get_deployment_job_status( self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any ) -> JSON: - """Gets the status of an existing deployment job. See + """Gets the status of an existing deployment job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-deployment-status for more information. @@ -3499,7 +3545,9 @@ async def get_deployment_job_status( @distributed_trace_async async def get_swap_deployments_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing swap deployment job. See + """Gets the status of an existing swap deployment job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-swap-deployments-status for more information. @@ -3617,6 +3665,7 @@ async def get_swap_deployments_job_status(self, project_name: str, job_id: str, @distributed_trace_async async def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: """Gets the status of an export job. Once job completes, returns the project metadata, and assets. + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-export-status for more information. @@ -3736,7 +3785,9 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** @distributed_trace_async async def get_import_project_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for an import. See + """Gets the status for an import. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-import-status for more information. @@ -3855,7 +3906,9 @@ async def get_import_project_job_status(self, project_name: str, job_id: str, ** def list_trained_models( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the trained models belonging to a project. See + """Lists the trained models belonging to a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-trained-models for more information. @@ -3967,7 +4020,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get_trained_model(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: - """Gets the details of a trained model. See + """Gets the details of a trained model. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-trained-model for more information. @@ -4046,7 +4101,9 @@ async def get_trained_model(self, project_name: str, trained_model_label: str, * async def delete_trained_model( # pylint: disable=inconsistent-return-statements self, project_name: str, trained_model_label: str, **kwargs: Any ) -> None: - """Deletes an existing trained model. See + """Deletes an existing trained model. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/delete-trained-model for more information. @@ -4145,6 +4202,7 @@ async def begin_load_snapshot( self, project_name: str, trained_model_label: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Restores the snapshot of this trained model to be the current working directory of the project. + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/load-snapshot for more information. @@ -4220,7 +4278,9 @@ def list_model_evaluation_results( **kwargs: Any ) -> AsyncIterable[JSON]: """Gets the detailed results of the evaluation for a trained model. This includes the raw - inference results for the data included in the evaluation process. See + inference results for the data included in the evaluation process. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-results for more information. @@ -4361,7 +4421,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get_model_evaluation_summary(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. See + measurements of the model e.g., F1, Precision, Recall, etc. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-model-evaluation-summary for more information. @@ -4512,7 +4574,9 @@ async def get_model_evaluation_summary(self, project_name: str, trained_model_la async def get_load_snapshot_status( self, project_name: str, trained_model_label: str, job_id: str, **kwargs: Any ) -> JSON: - """Gets the status for loading a snapshot. See + """Gets the status for loading a snapshot. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-load-snapshot-status for more information. @@ -4634,7 +4698,9 @@ async def get_load_snapshot_status( def list_deployment_resources( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the deployments resources assigned to the project. See + """Lists the deployments resources assigned to the project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-deployment-resources for more information. @@ -4798,6 +4864,7 @@ async def begin_assign_deployment_resources( available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources for more information. @@ -4846,6 +4913,7 @@ async def begin_assign_deployment_resources( available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources for more information. @@ -4877,6 +4945,7 @@ async def begin_assign_deployment_resources( available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/assign-deployment-resources for more information. @@ -5005,7 +5074,9 @@ async def begin_unassign_deployment_resources( self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. See + and deletes existing deployments assigned to them. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources for more information. @@ -5044,7 +5115,9 @@ async def begin_unassign_deployment_resources( self, project_name: str, body: IO, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. See + and deletes existing deployments assigned to them. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources for more information. @@ -5072,7 +5145,9 @@ async def begin_unassign_deployment_resources( self, project_name: str, body: Union[JSON, IO], **kwargs: Any ) -> AsyncLROPoller[None]: """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. See + and deletes existing deployments assigned to them. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/unassign-deployment-resources for more information. @@ -5143,7 +5218,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get_assign_deployment_resources_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing assign deployment resources job. See + """Gets the status of an existing assign deployment resources job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-assign-deployment-resources-status for more information. @@ -5260,7 +5337,9 @@ async def get_assign_deployment_resources_status(self, project_name: str, job_id @distributed_trace_async async def get_unassign_deployment_resources_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status of an existing unassign deployment resources job. See + """Gets the status of an existing unassign deployment resources job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-unassign-deployment-resources-status for more information. @@ -5379,7 +5458,9 @@ async def get_unassign_deployment_resources_status(self, project_name: str, job_ def list_training_jobs( self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the non-expired training jobs created for a project. See + """Lists the non-expired training jobs created for a project. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-jobs for more information. @@ -5564,7 +5645,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a training job. See + """Gets the status for a training job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-training-status for more information. @@ -5768,7 +5851,9 @@ async def _cancel_training_job_initial(self, project_name: str, job_id: str, **k @distributed_trace_async async def begin_cancel_training_job(self, project_name: str, job_id: str, **kwargs: Any) -> AsyncLROPoller[JSON]: - """Triggers a cancellation for a running training job. See + """Triggers a cancellation for a running training job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/cancel-training-job for more information. @@ -5930,7 +6015,9 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a project deletion job. See + """Gets the status for a project deletion job. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-project-deletion-status for more information. @@ -6048,7 +6135,9 @@ def list_assigned_resource_deployments( ) -> AsyncIterable[JSON]: """Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects - owned by other resources. See + owned by other resources. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-assigned-resource-deployments for more information. @@ -6159,7 +6248,9 @@ async def get_next(next_link=None): def list_supported_languages( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the supported languages for the given project type. See + """Lists the supported languages for the given project type. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-languages for more information. @@ -6273,7 +6364,9 @@ def list_supported_prebuilt_entities( skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the supported prebuilt entities that can be used while creating composed entities. See + """Lists the supported prebuilt entities that can be used while creating composed entities. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/get-supported-prebuilt-entities for more information. @@ -6385,7 +6478,9 @@ async def get_next(next_link=None): def list_training_config_versions( self, *, project_kind: str, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncIterable[JSON]: - """Lists the support training config version for a given project type. See + """Lists the support training config version for a given project type. + + See https://learn.microsoft.com/rest/api/language/conversational-analysis-authoring/list-training-config-versions for more information. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md index d26c5248841d..58be91388e05 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md @@ -78,14 +78,14 @@ directive: where: $.paths.*.* transform: | var operationId = $.operationId.replace(/_/g, "/").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); - $.description = $.description + " See https://learn.microsoft.com/rest/api/language/" + operationId + " for more information."; + $.description = $.description + "\n\nSee https://learn.microsoft.com/rest/api/language/" + operationId + " for more information."; - where-operation: AnalyzeConversation_SubmitJob transform: > - $.description = $.description + " See https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more information."; + $.description = $.description + "\n\nSee https://learn.microsoft.com/rest/api/language/analyze-conversation/submit-job for more information."; - where-operation: ConversationAnalysis_AnalyzeConversation transform: > - $.description = $.description + " See https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information."; + $.description = $.description + "\n\nSee https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information."; ```