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..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 @@ -42,7 +40,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..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 @@ -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 @@ -88,6 +89,10 @@ class ConversationAnalysisClientOperationsMixin(MixinABC): def analyze_conversation(self, task: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: """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 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -108,12 +113,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 +127,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 +153,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 """ @@ -164,6 +208,10 @@ def analyze_conversation(self, task: JSON, *, content_type: str = "application/j def analyze_conversation(self, task: IO, *, content_type: str = "application/json", **kwargs: Any) -> JSON: """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 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -182,14 +230,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 """ @@ -198,6 +285,10 @@ def analyze_conversation(self, task: IO, *, content_type: str = "application/jso def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JSON: """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. :type task: JSON or IO @@ -217,18 +308,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 +414,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 {}) @@ -346,6 +486,9 @@ def begin_conversation_analysis( 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. + :param task: The collection of conversations to analyze and one or more tasks to execute. Required. :type task: JSON @@ -373,16 +516,30 @@ 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", # 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. + "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 +552,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 +566,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. } } """ @@ -459,6 +609,9 @@ def begin_conversation_analysis( 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. + :param task: The collection of conversations to analyze and one or more tasks to execute. Required. :type task: IO @@ -482,6 +635,21 @@ 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", # 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. + "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 +662,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 +676,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. } } """ @@ -556,6 +717,9 @@ def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any) -> L 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. + :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 @@ -579,6 +743,21 @@ 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", # 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. + "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 +770,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 +784,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 75005a5ede9a..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,299 +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: "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": { - "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". - } - } - } - """ - -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/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/_patch.py index 5e8fa623c3ec..f3b96a5948e5 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 @@ -41,9 +41,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 " @@ -70,8 +68,9 @@ class ConversationAnalysisClient(GeneratedConversationAnalysisClient): 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. @@ -82,13 +81,12 @@ 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)), polling_interval=kwargs.pop("polling_interval", POLLING_INTERVAL_DEFAULT), - **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..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 @@ -42,7 +40,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..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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -41,6 +42,10 @@ class ConversationAnalysisClientOperationsMixin(MixinABC): async def analyze_conversation(self, task: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: """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 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -61,12 +66,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 +80,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 +106,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 """ @@ -117,6 +161,10 @@ async def analyze_conversation(self, task: JSON, *, content_type: str = "applica async def analyze_conversation(self, task: IO, *, content_type: str = "application/json", **kwargs: Any) -> JSON: """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 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -135,14 +183,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 """ @@ -151,6 +238,10 @@ async def analyze_conversation(self, task: IO, *, content_type: str = "applicati async def analyze_conversation(self, task: Union[JSON, IO], **kwargs: Any) -> JSON: """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. :type task: JSON or IO @@ -170,18 +261,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 +367,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 {}) @@ -299,6 +439,9 @@ async def begin_conversation_analysis( 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. + :param task: The collection of conversations to analyze and one or more tasks to execute. Required. :type task: JSON @@ -326,16 +469,30 @@ 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", # 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. + "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 +505,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 +519,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. } } """ @@ -412,6 +562,9 @@ async def begin_conversation_analysis( 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. + :param task: The collection of conversations to analyze and one or more tasks to execute. Required. :type task: IO @@ -435,6 +588,21 @@ 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", # 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. + "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 +615,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 +629,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. } } """ @@ -509,6 +670,9 @@ async def begin_conversation_analysis(self, task: Union[JSON, IO], **kwargs: Any 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. + :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 @@ -532,6 +696,21 @@ 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", # 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. + "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 +723,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 +737,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 6842d47d506e..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,299 +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: "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": { - "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". - } - } - } - """ - -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/aio/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/aio/_patch.py index 3bc75cef524b..12e123195fb0 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 @@ -41,9 +41,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 " @@ -70,8 +68,9 @@ class ConversationAnalysisClient(GeneratedConversationAnalysisClient): 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. @@ -84,13 +83,12 @@ 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)), polling_interval=kwargs.pop("polling_interval", POLLING_INTERVAL_DEFAULT), - **kwargs + **kwargs, ) 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 21325c93b311..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 @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials import TokenCredential @@ -38,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 b7b88e632ac6..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 @@ -8,13 +8,14 @@ # -------------------------------------------------------------------------- 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, HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -45,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 @@ -69,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 @@ -95,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 @@ -119,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 @@ -145,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 @@ -167,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 @@ -175,13 +179,14 @@ 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 + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,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 @@ -238,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 @@ -267,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 @@ -293,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 @@ -319,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 @@ -346,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 @@ -367,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 @@ -399,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 @@ -424,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 @@ -449,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 @@ -476,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 @@ -504,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 @@ -529,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 @@ -550,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, @@ -562,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 @@ -594,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 @@ -617,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 @@ -651,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 @@ -676,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 @@ -701,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 @@ -721,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 @@ -758,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 @@ -787,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 @@ -812,6 +1091,10 @@ class ConversationAuthoringClientOperationsMixin(MixinABC): # pylint: disable=t def list_projects(self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any) -> Iterable[JSON]: """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. :paramtype top: int @@ -829,26 +1112,29 @@ 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", "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 + 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 - "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 {} @@ -856,7 +1142,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): @@ -878,10 +1169,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)) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + _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 @@ -920,6 +1218,10 @@ def create_project( ) -> JSON: """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 :param project: The project parameters. Required. @@ -936,46 +1238,52 @@ 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". + 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 + 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 - "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 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", "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 + 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 - "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. } """ @@ -985,6 +1293,10 @@ def create_project( ) -> JSON: """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 :param project: The project parameters. Required. @@ -1003,26 +1315,29 @@ 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", "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 + 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 - "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. } """ @@ -1030,6 +1345,10 @@ def create_project( def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: Any) -> JSON: """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 :param project: The project parameters. Is either a model type or a IO type. Required. @@ -1048,29 +1367,37 @@ 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", "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 + 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 - "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 = {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 {}) @@ -1132,6 +1459,9 @@ def create_project(self, project_name: str, project: Union[JSON, IO], **kwargs: 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. + :param project_name: The name of the project to use. Required. :type project_name: str :return: JSON object @@ -1145,29 +1475,37 @@ 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", "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 + 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 - "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 = {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 +1545,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 {} @@ -1258,6 +1601,10 @@ def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Optional[ def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[JSON]: """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 :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -1278,6 +1625,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 +1642,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 +1656,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. @@ -1380,9 +1727,15 @@ 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 = {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 {} @@ -1395,6 +1748,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, @@ -1440,10 +1794,14 @@ 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 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 :keyword string_index_type: Specifies the method used to interpret string offsets. For @@ -1454,6 +1812,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 @@ -1472,6 +1833,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 +1850,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 +1864,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. @@ -1538,6 +1899,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, @@ -1584,7 +1946,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 {}) @@ -1657,6 +2024,9 @@ def begin_import_project( """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. + :param project_name: The name of the project to use. Required. :type project_name: str :param project: The project data to import. Required. @@ -1681,35 +2051,155 @@ 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. + } + ], + "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'. + ] + } + ], + "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". + 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 + 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 "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 + "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 +2211,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 +2225,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. @@ -1775,6 +2259,9 @@ def begin_import_project( """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. + :param project_name: The name of the project to use. Required. :type project_name: str :param project: The project data to import. Required. @@ -1803,6 +2290,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 +2307,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 +2321,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. @@ -1867,6 +2354,9 @@ def begin_import_project( """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. + :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. @@ -1895,6 +2385,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 +2402,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 +2416,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 +2489,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 {}) @@ -2064,6 +2559,9 @@ def begin_train( ) -> LROPoller[JSON]: """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 :param configuration: The training input parameters. Required. @@ -2087,6 +2585,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 +2599,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 +2658,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 +2672,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. @@ -2201,6 +2699,9 @@ def begin_train( ) -> LROPoller[JSON]: """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 :param configuration: The training input parameters. Required. @@ -2226,6 +2727,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 +2777,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 +2791,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. @@ -2315,6 +2816,9 @@ def begin_train( 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. + :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. @@ -2341,6 +2845,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 +2895,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 +2909,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. @@ -2482,6 +2986,10 @@ def list_deployments( ) -> Iterable[JSON]: """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 :keyword top: The maximum number of resources to return from the collection. Default value is @@ -2507,8 +3015,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 {} @@ -2516,7 +3031,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): @@ -2539,10 +3059,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 @@ -2578,7 +3105,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 {}) @@ -2643,6 +3175,10 @@ def begin_swap_deployments( ) -> LROPoller[JSON]: """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 :param deployments: The job object to swap two deployments. Required. @@ -2676,6 +3212,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 +3229,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 +3243,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. @@ -2734,6 +3270,10 @@ def begin_swap_deployments( ) -> LROPoller[JSON]: """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 :param deployments: The job object to swap two deployments. Required. @@ -2759,6 +3299,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 +3316,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 +3330,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. @@ -2815,6 +3355,10 @@ def begin_swap_deployments( def begin_swap_deployments(self, project_name: str, deployments: Union[JSON, IO], **kwargs: Any) -> LROPoller[JSON]: """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 :param deployments: The job object to swap two deployments. Is either a model type or a IO @@ -2841,6 +3385,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 +3402,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 +3416,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. @@ -2947,6 +3491,10 @@ def get_long_running_output(pipeline_response): def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> JSON: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -2968,11 +3516,23 @@ 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 = {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 +3575,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 {}) @@ -3087,6 +3652,10 @@ def begin_deploy_project( ) -> LROPoller[JSON]: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -3112,7 +3681,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 @@ -3125,8 +3700,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. + } + ] } """ @@ -3142,6 +3724,10 @@ def begin_deploy_project( ) -> LROPoller[JSON]: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -3175,9 +3761,16 @@ 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. + } + ] + } """ @distributed_trace @@ -3186,6 +3779,10 @@ def begin_deploy_project( ) -> LROPoller[JSON]: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -3219,8 +3816,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 {}) @@ -3276,7 +3880,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 {} @@ -3328,6 +3937,10 @@ def _delete_deployment_initial(self, project_name: str, deployment_name: str, ** def begin_delete_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> LROPoller[JSON]: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -3350,6 +3963,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 +3980,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 +3994,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. @@ -3450,9 +4063,236 @@ 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. + 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. :type project_name: str @@ -3471,6 +4311,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 +4328,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 +4342,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 +4362,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 {} @@ -3530,7 +4375,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, @@ -3564,11 +4409,17 @@ 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. + 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 @@ -3582,6 +4433,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 +4450,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 +4464,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 +4484,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 {} @@ -3641,8 +4497,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, @@ -3674,8 +4531,12 @@ 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. + 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. :type project_name: str @@ -3692,17 +4553,25 @@ 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. - "errors": [ - { - "code": "str", # One of a server-defined set of error codes. - Required. Known values are: "InvalidRequest", "InvalidArgument", - "Unauthorized", "Forbidden", "NotFound", "ProjectNotFound", + "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": [ ... ], @@ -3715,28 +4584,139 @@ 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. + "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_swap_deployments_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 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 + :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. - "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". + "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. + "resultUrl": "str", # Optional. The URL to use in order to download the + exported project. "warnings": [ { "code": "str", # The warning code. Required. @@ -3745,7 +4725,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 {} @@ -3789,6 +4774,10 @@ def get_export_project_job_status(self, project_name: str, job_id: str, **kwargs 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. @@ -3804,6 +4793,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 +4810,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 +4824,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 +4844,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 {} @@ -3901,6 +4895,10 @@ def list_trained_models( ) -> 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 @@ -3925,8 +4923,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 {} @@ -3934,7 +4934,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): @@ -3957,10 +4962,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 @@ -3997,6 +5009,10 @@ def get_next(next_link=None): def get_trained_model(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: """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 :param trained_model_label: The trained model label. Required. @@ -4017,11 +5033,18 @@ 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 = {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 {} @@ -4067,6 +5090,10 @@ def delete_trained_model( # pylint: disable=inconsistent-return-statements ) -> None: """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 :param trained_model_label: The trained model label. Required. @@ -4075,7 +5102,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 {} @@ -4108,6 +5140,116 @@ 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, @@ -4122,6 +5264,10 @@ def list_model_evaluation_results( """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://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 :param trained_model_label: The trained model label. Required. @@ -4183,7 +5329,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): @@ -4208,10 +5359,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 @@ -4249,6 +5407,10 @@ def get_model_evaluation_summary(self, project_name: str, trained_model_label: s """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. @@ -4298,17 +5460,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 +5495,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 {} @@ -4388,21 +5555,21 @@ def get_model_evaluation_summary(self, project_name: str, trained_model_label: s return cast(JSON, deserialized) @distributed_trace - 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. + 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 - :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] + :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: @@ -4412,6 +5579,12 @@ 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. + "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 +5596,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 +5610,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. @@ -4496,18 +5630,100 @@ def list_training_jobs( ] } """ + 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} + 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_training_jobs_request( + request = build_list_deployment_resources_request( project_name=project_name, top=top, skip=skip, @@ -4524,10 +5740,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 @@ -4560,25 +5783,908 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace - def get_training_job_status(self, project_name: str, job_id: str, **kwargs: Any) -> JSON: - """Gets the status for a training job. + 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 job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON + :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 - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. + # 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 cast(JSON, deserialized) + + @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 + 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 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_unassign_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 cast(JSON, deserialized) + + @distributed_trace + 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 + 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 + :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. + "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. + 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. + } + ] + } + """ + _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_training_jobs_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) + + @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 + 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 + :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. + "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 +6696,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 +6710,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 +6730,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 +6776,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 {} @@ -4756,6 +6833,10 @@ def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: 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 + 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 :param job_id: The job ID. Required. @@ -4778,6 +6859,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 +6909,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 +6923,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. @@ -4915,6 +6996,10 @@ def get_long_running_output(pipeline_response): def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: """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 :return: JSON object @@ -4928,6 +7013,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 +7030,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 +7044,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 +7064,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 {} @@ -5018,14 +7108,133 @@ 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 ) -> Iterable[JSON]: """Lists the supported languages for the given project type. - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. + 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", "Orchestration", and + "CustomConversationSummarization". Required. :paramtype project_kind: str :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -5053,7 +7262,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): @@ -5076,10 +7290,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 @@ -5124,6 +7345,10 @@ def list_supported_prebuilt_entities( ) -> Iterable[JSON]: """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 English, "en-gb" for English (UK), "es" for Spanish etc. Default value is None. @@ -5156,7 +7381,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): @@ -5180,10 +7410,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 @@ -5222,8 +7459,12 @@ def list_training_config_versions( ) -> Iterable[JSON]: """Lists the support training config version for a given project type. - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. + 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", "Orchestration", and + "CustomConversationSummarization". Required. :paramtype project_kind: str :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -5251,7 +7492,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): @@ -5274,10 +7520,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/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_operations/_patch.py index 7a7d36782fb0..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 @@ -6,1919 +6,10 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -# pylint: disable=too-many-lines 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/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/_patch.py index 5a35e7d6e0c5..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 @@ -19,9 +19,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 " @@ -47,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. @@ -59,13 +58,12 @@ 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)), polling_interval=kwargs.pop("polling_interval", POLLING_INTERVAL_DEFAULT), - **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/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_client.py index 9d36660518ae..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 @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials_async import AsyncTokenCredential @@ -38,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 e023ff47ad92..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 @@ -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 ( @@ -16,6 +16,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -28,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, @@ -54,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 @@ -75,6 +86,10 @@ def list_projects( ) -> AsyncIterable[JSON]: """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. :paramtype top: int @@ -92,26 +107,29 @@ 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", "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 + 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 - "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 {} @@ -119,7 +137,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): @@ -141,10 +164,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 @@ -183,6 +213,10 @@ async def create_project( ) -> JSON: """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 :param project: The project parameters. Required. @@ -199,46 +233,52 @@ 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". + 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 + 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 - "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 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", "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 + 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 - "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. } """ @@ -248,6 +288,10 @@ async def create_project( ) -> JSON: """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 :param project: The project parameters. Required. @@ -266,26 +310,29 @@ 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", "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 + 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 - "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. } """ @@ -293,6 +340,10 @@ async def create_project( 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 + 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 :param project: The project parameters. Is either a model type or a IO type. Required. @@ -311,29 +362,37 @@ 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", "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 + 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 - "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 = {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 {}) @@ -395,6 +454,9 @@ async def create_project(self, project_name: str, project: Union[JSON, IO], **kw 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. + :param project_name: The name of the project to use. Required. :type project_name: str :return: JSON object @@ -408,29 +470,37 @@ 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", "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 + 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 - "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 = {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 +540,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 {} @@ -521,6 +596,10 @@ async def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Opt async def begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncLROPoller[JSON]: """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 :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -541,6 +620,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 +637,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 +651,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. @@ -644,9 +723,15 @@ 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 = {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 {} @@ -659,6 +744,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, @@ -704,10 +790,14 @@ 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 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 :keyword string_index_type: Specifies the method used to interpret string offsets. For @@ -718,6 +808,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 @@ -736,6 +829,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 +846,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 +860,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. @@ -802,6 +895,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, @@ -849,7 +943,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 {}) @@ -922,6 +1021,9 @@ async def begin_import_project( """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. + :param project_name: The name of the project to use. Required. :type project_name: str :param project: The project data to import. Required. @@ -946,35 +1048,155 @@ 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. + } + ], + "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'. + ] + } + ], + "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". + 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 + 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 "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 + "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 +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": [ ... ], @@ -998,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. @@ -1040,6 +1256,9 @@ async def begin_import_project( """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. + :param project_name: The name of the project to use. Required. :type project_name: str :param project: The project data to import. Required. @@ -1068,6 +1287,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 +1304,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 +1318,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. @@ -1132,6 +1351,9 @@ async def begin_import_project( """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. + :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. @@ -1160,6 +1382,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 +1399,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 +1413,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 +1487,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 {}) @@ -1330,6 +1557,9 @@ async def begin_train( ) -> AsyncLROPoller[JSON]: """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 :param configuration: The training input parameters. Required. @@ -1353,6 +1583,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 +1597,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 +1656,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 +1670,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. @@ -1467,6 +1697,9 @@ async def begin_train( ) -> AsyncLROPoller[JSON]: """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 :param configuration: The training input parameters. Required. @@ -1492,6 +1725,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 +1775,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 +1789,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. @@ -1583,6 +1816,9 @@ async def begin_train( ) -> AsyncLROPoller[JSON]: """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 :param configuration: The training input parameters. Is either a model type or a IO type. @@ -1609,6 +1845,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 +1895,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 +1909,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. @@ -1751,6 +1987,10 @@ def list_deployments( ) -> AsyncIterable[JSON]: """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 :keyword top: The maximum number of resources to return from the collection. Default value is @@ -1776,8 +2016,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 {} @@ -1785,7 +2032,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): @@ -1808,10 +2060,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 @@ -1847,7 +2106,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 {}) @@ -1912,6 +2176,10 @@ async def begin_swap_deployments( ) -> AsyncLROPoller[JSON]: """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 :param deployments: The job object to swap two deployments. Required. @@ -1945,6 +2213,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 +2230,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 +2244,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. @@ -2003,6 +2271,10 @@ async def begin_swap_deployments( ) -> AsyncLROPoller[JSON]: """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 :param deployments: The job object to swap two deployments. Required. @@ -2028,6 +2300,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 +2317,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 +2331,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. @@ -2086,6 +2358,10 @@ async def begin_swap_deployments( ) -> AsyncLROPoller[JSON]: """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 :param deployments: The job object to swap two deployments. Is either a model type or a IO @@ -2112,6 +2388,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 +2405,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 +2419,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. @@ -2219,6 +2495,10 @@ def get_long_running_output(pipeline_response): async def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> JSON: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -2240,11 +2520,23 @@ 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 = {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 +2579,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 {}) @@ -2359,6 +2656,10 @@ async def begin_deploy_project( ) -> AsyncLROPoller[JSON]: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -2384,7 +2685,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 @@ -2397,8 +2704,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. + } + ] } """ @@ -2414,6 +2728,10 @@ async def begin_deploy_project( ) -> AsyncLROPoller[JSON]: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -2447,8 +2765,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. + } + ] } """ @@ -2458,6 +2783,10 @@ async def begin_deploy_project( ) -> AsyncLROPoller[JSON]: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -2491,8 +2820,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 {}) @@ -2551,7 +2887,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 {} @@ -2605,6 +2946,10 @@ async def begin_delete_deployment( ) -> AsyncLROPoller[JSON]: """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 :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -2627,6 +2972,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 +2989,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 +3003,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. @@ -2728,11 +3073,237 @@ 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. + """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. :type project_name: str @@ -2751,6 +3322,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 +3339,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 +3353,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 +3373,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 {} @@ -2810,7 +3386,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, @@ -2844,11 +3420,19 @@ 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. + 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 @@ -2862,6 +3446,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 +3463,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 +3477,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 +3497,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 {} @@ -2921,8 +3510,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, @@ -2954,8 +3544,12 @@ 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. + 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. :type project_name: str @@ -2972,6 +3566,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 +3583,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 +3597,139 @@ 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. + "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_swap_deployments_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_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 + :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. - "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". + "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. + "resultUrl": "str", # Optional. The URL to use in order to download the + exported project. "warnings": [ { "code": "str", # The warning code. Required. @@ -3025,7 +3738,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 {} @@ -3069,6 +3787,10 @@ async def get_export_project_job_status(self, project_name: str, job_id: str, ** 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. @@ -3084,6 +3806,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 +3823,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 +3837,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 +3857,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 {} @@ -3181,6 +3908,10 @@ def list_trained_models( ) -> AsyncIterable[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 @@ -3205,8 +3936,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 {} @@ -3214,7 +3947,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): @@ -3237,10 +3975,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 @@ -3277,6 +4022,10 @@ async def get_next(next_link=None): async def get_trained_model(self, project_name: str, trained_model_label: str, **kwargs: Any) -> JSON: """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 :param trained_model_label: The trained model label. Required. @@ -3297,11 +4046,18 @@ 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 = {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 {} @@ -3347,6 +4103,10 @@ async def delete_trained_model( # pylint: disable=inconsistent-return-statement ) -> None: """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 :param trained_model_label: The trained model label. Required. @@ -3355,7 +4115,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 {} @@ -3388,6 +4153,119 @@ 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, @@ -3402,6 +4280,10 @@ def list_model_evaluation_results( """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://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 :param trained_model_label: The trained model label. Required. @@ -3463,7 +4345,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): @@ -3488,10 +4375,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 @@ -3529,6 +4423,10 @@ async def get_model_evaluation_summary(self, project_name: str, trained_model_la """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. @@ -3578,17 +4476,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 +4511,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 {} @@ -3667,22 +4570,24 @@ async def get_model_evaluation_summary(self, project_name: str, trained_model_la return cast(JSON, deserialized) - @distributed_trace - 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. + @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 - :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] + :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: @@ -3692,6 +4597,12 @@ 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. + "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 +4614,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 +4628,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. @@ -3776,18 +4648,100 @@ def list_training_jobs( ] } """ + 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} + 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_training_jobs_request( + request = build_list_deployment_resources_request( project_name=project_name, top=top, skip=skip, @@ -3804,10 +4758,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 @@ -3840,25 +4801,910 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @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. + 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 job_id: The job ID. Required. - :type job_id: str - :return: JSON object - :rtype: JSON + :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 - # response body for status code(s): 200 - response == { - "createdDateTime": "2020-02-20 00:00:00", # The creation date time of the - job. Required. + # 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_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 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_unassign_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 + 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 + 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 + :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. + "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. + 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. + } + ] + } + """ + _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_training_jobs_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) + + @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 + 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 + :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. + "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 +5716,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 +5730,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 +5750,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 +5796,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 {} @@ -4036,6 +5853,10 @@ async def _cancel_training_job_initial(self, project_name: str, job_id: str, **k 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 + 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 :param job_id: The job ID. Required. @@ -4058,6 +5879,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 +5929,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 +5943,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. @@ -4196,6 +6017,10 @@ def get_long_running_output(pipeline_response): async def get_project_deletion_job_status(self, job_id: str, **kwargs: Any) -> JSON: """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 :return: JSON object @@ -4209,6 +6034,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 +6051,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 +6065,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 +6085,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 {} @@ -4299,14 +6129,133 @@ 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 ) -> AsyncIterable[JSON]: """Lists the supported languages for the given project type. - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. + 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", "Orchestration", and + "CustomConversationSummarization". Required. :paramtype project_kind: str :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -4334,7 +6283,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): @@ -4357,10 +6311,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 @@ -4405,6 +6366,10 @@ def list_supported_prebuilt_entities( ) -> AsyncIterable[JSON]: """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 English, "en-gb" for English (UK), "es" for Spanish etc. Default value is None. @@ -4437,7 +6402,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): @@ -4461,10 +6431,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 @@ -4503,8 +6480,12 @@ def list_training_config_versions( ) -> AsyncIterable[JSON]: """Lists the support training config version for a given project type. - :keyword project_kind: The project kind. Known values are: "Conversation" and "Orchestration". - Required. + 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", "Orchestration", and + "CustomConversationSummarization". Required. :paramtype project_kind: str :keyword top: The maximum number of resources to return from the collection. Default value is None. @@ -4532,7 +6513,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): @@ -4555,10 +6541,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/_operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/authoring/aio/_operations/_patch.py index e73758ff0d4d..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 @@ -6,1915 +6,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - -# pylint: disable=too-many-lines 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(): 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 1dfa2f0de5f6..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 @@ -19,9 +19,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 " @@ -47,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. @@ -61,13 +60,12 @@ 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)), polling_interval=kwargs.pop("polling_interval", POLLING_INTERVAL_DEFAULT), - **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..58be91388e05 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations/swagger/README.md @@ -26,10 +26,9 @@ 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.0b2 +package-version: 1.1.0b3 add-credential: true credential-scopes: https://cognitiveservices.azure.com/.default black: true @@ -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/e7f37e4e43b1d12fd1988fda3ed39624c4b23303/specification/cognitiveservices/data-plane/Language/preview/2022-05-15-preview/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 ``` @@ -71,6 +70,26 @@ 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 + "\n\nSee https://learn.microsoft.com/rest/api/language/" + operationId + " for more information."; + +- where-operation: AnalyzeConversation_SubmitJob + transform: > + $.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 + "\n\nSee https://learn.microsoft.com/rest/api/language/conversation-analysis-runtime/analyze-conversation for more information."; +``` + + + ```yaml directive: # Support automatically generating code for key credentials. @@ -374,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 +``` 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(