azure-ai-textanalytics 5.3.0b2__py3-none-any.whl → 6.0.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of azure-ai-textanalytics might be problematic. Click here for more details.

Files changed (128) hide show
  1. azure/ai/textanalytics/__init__.py +26 -193
  2. azure/ai/textanalytics/_client.py +111 -0
  3. azure/ai/textanalytics/_configuration.py +73 -0
  4. azure/ai/textanalytics/{_generated/v2022_05_01/operations → _operations}/__init__.py +13 -8
  5. azure/ai/textanalytics/_operations/_operations.py +716 -0
  6. azure/ai/textanalytics/{_generated/v2022_05_01/models → _operations}/_patch.py +8 -6
  7. azure/ai/textanalytics/_patch.py +350 -0
  8. azure/ai/textanalytics/{_generated/aio → _utils}/__init__.py +1 -5
  9. azure/ai/textanalytics/_utils/model_base.py +1237 -0
  10. azure/ai/textanalytics/{_generated/_serialization.py → _utils/serialization.py} +640 -616
  11. azure/ai/textanalytics/{_generated/v2022_05_01/aio/_vendor.py → _utils/utils.py} +10 -12
  12. azure/ai/textanalytics/_version.py +8 -7
  13. azure/ai/textanalytics/aio/__init__.py +25 -14
  14. azure/ai/textanalytics/aio/_client.py +115 -0
  15. azure/ai/textanalytics/aio/_configuration.py +75 -0
  16. azure/ai/textanalytics/{_generated/v2022_10_01_preview/aio/operations → aio/_operations}/__init__.py +13 -8
  17. azure/ai/textanalytics/aio/_operations/_operations.py +623 -0
  18. azure/ai/textanalytics/{_generated/v2022_05_01 → aio/_operations}/_patch.py +8 -6
  19. azure/ai/textanalytics/aio/_patch.py +344 -0
  20. azure/ai/textanalytics/models/__init__.py +402 -0
  21. azure/ai/textanalytics/models/_enums.py +1979 -0
  22. azure/ai/textanalytics/models/_models.py +6641 -0
  23. azure/ai/textanalytics/{_generated/v2022_05_01/aio → models}/_patch.py +8 -6
  24. azure/ai/textanalytics/py.typed +1 -0
  25. {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/METADATA +668 -403
  26. azure_ai_textanalytics-6.0.0b1.dist-info/RECORD +29 -0
  27. {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/WHEEL +1 -1
  28. azure/ai/textanalytics/_base_client.py +0 -113
  29. azure/ai/textanalytics/_check.py +0 -22
  30. azure/ai/textanalytics/_dict_mixin.py +0 -57
  31. azure/ai/textanalytics/_generated/__init__.py +0 -16
  32. azure/ai/textanalytics/_generated/_configuration.py +0 -70
  33. azure/ai/textanalytics/_generated/_operations_mixin.py +0 -795
  34. azure/ai/textanalytics/_generated/_text_analytics_client.py +0 -126
  35. azure/ai/textanalytics/_generated/_version.py +0 -8
  36. azure/ai/textanalytics/_generated/aio/_configuration.py +0 -66
  37. azure/ai/textanalytics/_generated/aio/_operations_mixin.py +0 -776
  38. azure/ai/textanalytics/_generated/aio/_text_analytics_client.py +0 -124
  39. azure/ai/textanalytics/_generated/models.py +0 -8
  40. azure/ai/textanalytics/_generated/v2022_05_01/__init__.py +0 -20
  41. azure/ai/textanalytics/_generated/v2022_05_01/_configuration.py +0 -72
  42. azure/ai/textanalytics/_generated/v2022_05_01/_text_analytics_client.py +0 -100
  43. azure/ai/textanalytics/_generated/v2022_05_01/_vendor.py +0 -45
  44. azure/ai/textanalytics/_generated/v2022_05_01/aio/__init__.py +0 -20
  45. azure/ai/textanalytics/_generated/v2022_05_01/aio/_configuration.py +0 -71
  46. azure/ai/textanalytics/_generated/v2022_05_01/aio/_text_analytics_client.py +0 -97
  47. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/__init__.py +0 -18
  48. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/_patch.py +0 -121
  49. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/_text_analytics_client_operations.py +0 -603
  50. azure/ai/textanalytics/_generated/v2022_05_01/models/__init__.py +0 -281
  51. azure/ai/textanalytics/_generated/v2022_05_01/models/_models_py3.py +0 -5722
  52. azure/ai/textanalytics/_generated/v2022_05_01/models/_text_analytics_client_enums.py +0 -439
  53. azure/ai/textanalytics/_generated/v2022_05_01/operations/_patch.py +0 -120
  54. azure/ai/textanalytics/_generated/v2022_05_01/operations/_text_analytics_client_operations.py +0 -744
  55. azure/ai/textanalytics/_generated/v2022_10_01_preview/__init__.py +0 -20
  56. azure/ai/textanalytics/_generated/v2022_10_01_preview/_configuration.py +0 -72
  57. azure/ai/textanalytics/_generated/v2022_10_01_preview/_patch.py +0 -19
  58. azure/ai/textanalytics/_generated/v2022_10_01_preview/_text_analytics_client.py +0 -100
  59. azure/ai/textanalytics/_generated/v2022_10_01_preview/_vendor.py +0 -45
  60. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/__init__.py +0 -20
  61. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_configuration.py +0 -71
  62. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_patch.py +0 -19
  63. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_text_analytics_client.py +0 -97
  64. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_vendor.py +0 -27
  65. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/operations/_patch.py +0 -121
  66. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/operations/_text_analytics_client_operations.py +0 -603
  67. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/__init__.py +0 -405
  68. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_models_py3.py +0 -8420
  69. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_patch.py +0 -486
  70. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_text_analytics_client_enums.py +0 -729
  71. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/__init__.py +0 -18
  72. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/_patch.py +0 -120
  73. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/_text_analytics_client_operations.py +0 -744
  74. azure/ai/textanalytics/_generated/v3_0/__init__.py +0 -20
  75. azure/ai/textanalytics/_generated/v3_0/_configuration.py +0 -66
  76. azure/ai/textanalytics/_generated/v3_0/_patch.py +0 -31
  77. azure/ai/textanalytics/_generated/v3_0/_text_analytics_client.py +0 -96
  78. azure/ai/textanalytics/_generated/v3_0/_vendor.py +0 -33
  79. azure/ai/textanalytics/_generated/v3_0/aio/__init__.py +0 -20
  80. azure/ai/textanalytics/_generated/v3_0/aio/_configuration.py +0 -65
  81. azure/ai/textanalytics/_generated/v3_0/aio/_patch.py +0 -31
  82. azure/ai/textanalytics/_generated/v3_0/aio/_text_analytics_client.py +0 -93
  83. azure/ai/textanalytics/_generated/v3_0/aio/_vendor.py +0 -27
  84. azure/ai/textanalytics/_generated/v3_0/aio/operations/__init__.py +0 -18
  85. azure/ai/textanalytics/_generated/v3_0/aio/operations/_patch.py +0 -19
  86. azure/ai/textanalytics/_generated/v3_0/aio/operations/_text_analytics_client_operations.py +0 -428
  87. azure/ai/textanalytics/_generated/v3_0/models/__init__.py +0 -81
  88. azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py +0 -1467
  89. azure/ai/textanalytics/_generated/v3_0/models/_patch.py +0 -19
  90. azure/ai/textanalytics/_generated/v3_0/models/_text_analytics_client_enums.py +0 -58
  91. azure/ai/textanalytics/_generated/v3_0/operations/__init__.py +0 -18
  92. azure/ai/textanalytics/_generated/v3_0/operations/_patch.py +0 -19
  93. azure/ai/textanalytics/_generated/v3_0/operations/_text_analytics_client_operations.py +0 -604
  94. azure/ai/textanalytics/_generated/v3_1/__init__.py +0 -20
  95. azure/ai/textanalytics/_generated/v3_1/_configuration.py +0 -66
  96. azure/ai/textanalytics/_generated/v3_1/_patch.py +0 -31
  97. azure/ai/textanalytics/_generated/v3_1/_text_analytics_client.py +0 -98
  98. azure/ai/textanalytics/_generated/v3_1/_vendor.py +0 -45
  99. azure/ai/textanalytics/_generated/v3_1/aio/__init__.py +0 -20
  100. azure/ai/textanalytics/_generated/v3_1/aio/_configuration.py +0 -65
  101. azure/ai/textanalytics/_generated/v3_1/aio/_patch.py +0 -31
  102. azure/ai/textanalytics/_generated/v3_1/aio/_text_analytics_client.py +0 -95
  103. azure/ai/textanalytics/_generated/v3_1/aio/_vendor.py +0 -27
  104. azure/ai/textanalytics/_generated/v3_1/aio/operations/__init__.py +0 -18
  105. azure/ai/textanalytics/_generated/v3_1/aio/operations/_patch.py +0 -19
  106. azure/ai/textanalytics/_generated/v3_1/aio/operations/_text_analytics_client_operations.py +0 -1291
  107. azure/ai/textanalytics/_generated/v3_1/models/__init__.py +0 -205
  108. azure/ai/textanalytics/_generated/v3_1/models/_models_py3.py +0 -3976
  109. azure/ai/textanalytics/_generated/v3_1/models/_patch.py +0 -19
  110. azure/ai/textanalytics/_generated/v3_1/models/_text_analytics_client_enums.py +0 -367
  111. azure/ai/textanalytics/_generated/v3_1/operations/__init__.py +0 -18
  112. azure/ai/textanalytics/_generated/v3_1/operations/_patch.py +0 -19
  113. azure/ai/textanalytics/_generated/v3_1/operations/_text_analytics_client_operations.py +0 -1709
  114. azure/ai/textanalytics/_lro.py +0 -553
  115. azure/ai/textanalytics/_models.py +0 -3158
  116. azure/ai/textanalytics/_policies.py +0 -66
  117. azure/ai/textanalytics/_request_handlers.py +0 -104
  118. azure/ai/textanalytics/_response_handlers.py +0 -583
  119. azure/ai/textanalytics/_text_analytics_client.py +0 -2081
  120. azure/ai/textanalytics/_user_agent.py +0 -8
  121. azure/ai/textanalytics/_validate.py +0 -113
  122. azure/ai/textanalytics/aio/_base_client_async.py +0 -98
  123. azure/ai/textanalytics/aio/_lro_async.py +0 -503
  124. azure/ai/textanalytics/aio/_response_handlers_async.py +0 -94
  125. azure/ai/textanalytics/aio/_text_analytics_client_async.py +0 -2077
  126. azure_ai_textanalytics-5.3.0b2.dist-info/RECORD +0 -115
  127. {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info/licenses}/LICENSE +0 -0
  128. {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/top_level.txt +0 -0
@@ -1,126 +0,0 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- # Copyright (c) Microsoft Corporation. All rights reserved.
4
- # Licensed under the MIT License. See License.txt in the project root for
5
- # license information.
6
- #
7
- # Code generated by Microsoft (R) AutoRest Code Generator.
8
- # Changes may cause incorrect behavior and will be lost if the code is
9
- # regenerated.
10
- # --------------------------------------------------------------------------
11
-
12
- from typing import TYPE_CHECKING
13
-
14
- from azure.core import PipelineClient
15
- from azure.profiles import KnownProfiles, ProfileDefinition
16
- from azure.profiles.multiapiclient import MultiApiClientMixin
17
-
18
- from ._configuration import TextAnalyticsClientConfiguration
19
- from ._operations_mixin import TextAnalyticsClientOperationsMixin
20
- from ._serialization import Deserializer, Serializer
21
-
22
- if TYPE_CHECKING:
23
- # pylint: disable=unused-import,ungrouped-imports
24
- from typing import Any, Optional
25
-
26
- from azure.core.credentials import TokenCredential
27
-
28
- class _SDKClient(object):
29
- def __init__(self, *args, **kwargs):
30
- """This is a fake class to support current implemetation of MultiApiClientMixin."
31
- Will be removed in final version of multiapi azure-core based client
32
- """
33
- pass
34
-
35
- class TextAnalyticsClient(TextAnalyticsClientOperationsMixin, MultiApiClientMixin, _SDKClient):
36
- """The Text Analytics API is a suite of natural language processing (NLP) services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. Further documentation can be found in :code:`<a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview</a>`.
37
-
38
- This ready contains multiple API versions, to help you deal with all of the Azure clouds
39
- (Azure Stack, Azure Government, Azure China, etc.).
40
- By default, it uses the latest API version available on public Azure.
41
- For production, you should stick to a particular api-version and/or profile.
42
- The profile sets a mapping between an operation group and its API version.
43
- The api-version parameter sets the default API version if the operation
44
- group is not described in the profile.
45
-
46
- :param credential: Credential needed for the client to connect to Azure. Required.
47
- :type credential: ~azure.core.credentials.TokenCredential
48
- :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). Required.
49
- :type endpoint: str
50
- :param api_version: API version to use if no profile is provided, or if missing in profile.
51
- :type api_version: str
52
- :param profile: A profile definition, from KnownProfiles to dict.
53
- :type profile: azure.profiles.KnownProfiles
54
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
55
- """
56
-
57
- DEFAULT_API_VERSION = 'v3.1'
58
- _PROFILE_TAG = "azure.ai.textanalytics.TextAnalyticsClient"
59
- LATEST_PROFILE = ProfileDefinition({
60
- _PROFILE_TAG: {
61
- None: DEFAULT_API_VERSION,
62
- 'analyze_text': '2022-05-01',
63
- 'analyze_text_job_status': '2022-05-01',
64
- 'begin_analyze_text_cancel_job': '2022-05-01',
65
- 'begin_analyze_text_submit_job': '2022-05-01',
66
- }},
67
- _PROFILE_TAG + " latest"
68
- )
69
-
70
- def __init__(
71
- self,
72
- credential, # type: "TokenCredential"
73
- endpoint, # type: str
74
- api_version=None, # type: Optional[str]
75
- profile=KnownProfiles.default, # type: KnownProfiles
76
- **kwargs # type: Any
77
- ):
78
- if api_version == '2022-05-01' or api_version == '2022-10-01-preview':
79
- base_url = '{Endpoint}/language'
80
- elif api_version == 'v3.0':
81
- base_url = '{Endpoint}/text/analytics/v3.0'
82
- elif api_version == 'v3.1':
83
- base_url = '{Endpoint}/text/analytics/v3.1'
84
- else:
85
- raise ValueError("API version {} is not available".format(api_version))
86
- self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs)
87
- self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
88
- super(TextAnalyticsClient, self).__init__(
89
- api_version=api_version,
90
- profile=profile
91
- )
92
-
93
- @classmethod
94
- def _models_dict(cls, api_version):
95
- return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
96
-
97
- @classmethod
98
- def models(cls, api_version=DEFAULT_API_VERSION):
99
- """Module depends on the API version:
100
-
101
- * 2022-05-01: :mod:`v2022_05_01.models<azure.ai.textanalytics.v2022_05_01.models>`
102
- * 2022-10-01-preview: :mod:`v2022_10_01_preview.models<azure.ai.textanalytics.v2022_10_01_preview.models>`
103
- * v3.0: :mod:`v3_0.models<azure.ai.textanalytics.v3_0.models>`
104
- * v3.1: :mod:`v3_1.models<azure.ai.textanalytics.v3_1.models>`
105
- """
106
- if api_version == '2022-05-01':
107
- from .v2022_05_01 import models
108
- return models
109
- elif api_version == '2022-10-01-preview':
110
- from .v2022_10_01_preview import models
111
- return models
112
- elif api_version == 'v3.0':
113
- from .v3_0 import models
114
- return models
115
- elif api_version == 'v3.1':
116
- from .v3_1 import models
117
- return models
118
- raise ValueError("API version {} is not available".format(api_version))
119
-
120
- def close(self):
121
- self._client.close()
122
- def __enter__(self):
123
- self._client.__enter__()
124
- return self
125
- def __exit__(self, *exc_details):
126
- self._client.__exit__(*exc_details)
@@ -1,8 +0,0 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- # Copyright (c) Microsoft Corporation. All rights reserved.
4
- # Licensed under the MIT License. See License.txt in the project root for
5
- # license information.
6
- # --------------------------------------------------------------------------
7
-
8
- VERSION = "0.1.0"
@@ -1,66 +0,0 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- # Copyright (c) Microsoft Corporation. All rights reserved.
4
- # Licensed under the MIT License. See License.txt in the project root for
5
- # license information.
6
- #
7
- # Code generated by Microsoft (R) AutoRest Code Generator.
8
- # Changes may cause incorrect behavior and will be lost if the code is
9
- # regenerated.
10
- # --------------------------------------------------------------------------
11
- from typing import Any, TYPE_CHECKING
12
-
13
- from azure.core.configuration import Configuration
14
- from azure.core.pipeline import policies
15
-
16
- from .._version import VERSION
17
-
18
- if TYPE_CHECKING:
19
- # pylint: disable=unused-import,ungrouped-imports
20
- from azure.core.credentials_async import AsyncTokenCredential
21
-
22
- class TextAnalyticsClientConfiguration(Configuration):
23
- """Configuration for TextAnalyticsClient.
24
-
25
- Note that all parameters used to create this instance are saved as instance
26
- attributes.
27
-
28
- :param credential: Credential needed for the client to connect to Azure. Required.
29
- :type credential: ~azure.core.credentials_async.AsyncTokenCredential
30
- :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). Required.
31
- :type endpoint: str
32
- """
33
-
34
- def __init__(
35
- self,
36
- credential: "AsyncTokenCredential",
37
- endpoint: str,
38
- **kwargs # type: Any
39
- ) -> None:
40
- if credential is None:
41
- raise ValueError("Parameter 'credential' must not be None.")
42
- if endpoint is None:
43
- raise ValueError("Parameter 'endpoint' must not be None.")
44
- super(TextAnalyticsClientConfiguration, self).__init__(**kwargs)
45
-
46
- self.credential = credential
47
- self.endpoint = endpoint
48
- self.credential_scopes = kwargs.pop('credential_scopes', ['https://cognitiveservices.azure.com/.default'])
49
- kwargs.setdefault('sdk_moniker', 'azure-ai-textanalytics/{}'.format(VERSION))
50
- self._configure(**kwargs)
51
-
52
- def _configure(
53
- self,
54
- **kwargs: Any
55
- ) -> None:
56
- self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
57
- self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
58
- self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
59
- self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
60
- self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
61
- self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
62
- self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
63
- self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
64
- self.authentication_policy = kwargs.get('authentication_policy')
65
- if self.credential and not self.authentication_policy:
66
- self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)