diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py index c90fbe6be4d3..69bc3f31a5c6 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py @@ -24,10 +24,10 @@ from .language_batch_result_py3 import LanguageBatchResult from .sentiment_batch_result_item_py3 import SentimentBatchResultItem from .sentiment_batch_result_py3 import SentimentBatchResult - from .match_record_py3 import MatchRecord - from .entity_record_py3 import EntityRecord - from .entities_batch_result_item_py3 import EntitiesBatchResultItem - from .entities_batch_result_py3 import EntitiesBatchResult + from .match_record_v2dot1_py3 import MatchRecordV2dot1 + from .entity_record_v2dot1_py3 import EntityRecordV2dot1 + from .entities_batch_result_item_v2dot1_py3 import EntitiesBatchResultItemV2dot1 + from .entities_batch_result_v2dot1_py3 import EntitiesBatchResultV2dot1 except (SyntaxError, ImportError): from .multi_language_input import MultiLanguageInput from .multi_language_batch_input import MultiLanguageBatchInput @@ -43,10 +43,10 @@ from .language_batch_result import LanguageBatchResult from .sentiment_batch_result_item import SentimentBatchResultItem from .sentiment_batch_result import SentimentBatchResult - from .match_record import MatchRecord - from .entity_record import EntityRecord - from .entities_batch_result_item import EntitiesBatchResultItem - from .entities_batch_result import EntitiesBatchResult + from .match_record_v2dot1 import MatchRecordV2dot1 + from .entity_record_v2dot1 import EntityRecordV2dot1 + from .entities_batch_result_item_v2dot1 import EntitiesBatchResultItemV2dot1 + from .entities_batch_result_v2dot1 import EntitiesBatchResultV2dot1 __all__ = [ 'MultiLanguageInput', @@ -63,8 +63,8 @@ 'LanguageBatchResult', 'SentimentBatchResultItem', 'SentimentBatchResult', - 'MatchRecord', - 'EntityRecord', - 'EntitiesBatchResultItem', - 'EntitiesBatchResult', + 'MatchRecordV2dot1', + 'EntityRecordV2dot1', + 'EntitiesBatchResultItemV2dot1', + 'EntitiesBatchResultV2dot1', ] diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_v2dot1.py similarity index 81% rename from azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py rename to azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_v2dot1.py index 9a35dfcefe52..fd1ec79eff3c 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_v2dot1.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class EntitiesBatchResultItem(Model): - """EntitiesBatchResultItem. +class EntitiesBatchResultItemV2dot1(Model): + """EntitiesBatchResultItemV2dot1. Variables are only populated by the server, and will be ignored when sending a request. @@ -22,7 +22,7 @@ class EntitiesBatchResultItem(Model): :vartype id: str :ivar entities: Recognized entities in the document. :vartype entities: - list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord] + list[~azure.cognitiveservices.language.textanalytics.models.EntityRecordV2dot1] """ _validation = { @@ -32,10 +32,10 @@ class EntitiesBatchResultItem(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[EntityRecord]'}, + 'entities': {'key': 'entities', 'type': '[EntityRecordV2dot1]'}, } def __init__(self, **kwargs): - super(EntitiesBatchResultItem, self).__init__(**kwargs) + super(EntitiesBatchResultItemV2dot1, self).__init__(**kwargs) self.id = None self.entities = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_v2dot1_py3.py similarity index 81% rename from azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py rename to azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_v2dot1_py3.py index fa346acd6c4d..ec3a2474e488 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_v2dot1_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class EntitiesBatchResultItem(Model): - """EntitiesBatchResultItem. +class EntitiesBatchResultItemV2dot1(Model): + """EntitiesBatchResultItemV2dot1. Variables are only populated by the server, and will be ignored when sending a request. @@ -22,7 +22,7 @@ class EntitiesBatchResultItem(Model): :vartype id: str :ivar entities: Recognized entities in the document. :vartype entities: - list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord] + list[~azure.cognitiveservices.language.textanalytics.models.EntityRecordV2dot1] """ _validation = { @@ -32,10 +32,10 @@ class EntitiesBatchResultItem(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[EntityRecord]'}, + 'entities': {'key': 'entities', 'type': '[EntityRecordV2dot1]'}, } def __init__(self, **kwargs) -> None: - super(EntitiesBatchResultItem, self).__init__(**kwargs) + super(EntitiesBatchResultItemV2dot1, self).__init__(**kwargs) self.id = None self.entities = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_v2dot1.py similarity index 86% rename from azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py rename to azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_v2dot1.py index 93a5a85d51b0..98cf0726b3f3 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_v2dot1.py @@ -12,15 +12,15 @@ from msrest.serialization import Model -class EntitiesBatchResult(Model): - """EntitiesBatchResult. +class EntitiesBatchResultV2dot1(Model): + """EntitiesBatchResultV2dot1. Variables are only populated by the server, and will be ignored when sending a request. :ivar documents: :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem] + list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItemV2dot1] :ivar errors: :vartype errors: list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] @@ -32,11 +32,11 @@ class EntitiesBatchResult(Model): } _attribute_map = { - 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'}, + 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItemV2dot1]'}, 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, } def __init__(self, **kwargs): - super(EntitiesBatchResult, self).__init__(**kwargs) + super(EntitiesBatchResultV2dot1, self).__init__(**kwargs) self.documents = None self.errors = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_v2dot1_py3.py similarity index 86% rename from azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py rename to azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_v2dot1_py3.py index a39265c0e6a2..3cd68eb931fe 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_v2dot1_py3.py @@ -12,15 +12,15 @@ from msrest.serialization import Model -class EntitiesBatchResult(Model): - """EntitiesBatchResult. +class EntitiesBatchResultV2dot1(Model): + """EntitiesBatchResultV2dot1. Variables are only populated by the server, and will be ignored when sending a request. :ivar documents: :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem] + list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItemV2dot1] :ivar errors: :vartype errors: list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] @@ -32,11 +32,11 @@ class EntitiesBatchResult(Model): } _attribute_map = { - 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'}, + 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItemV2dot1]'}, 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, } def __init__(self, **kwargs) -> None: - super(EntitiesBatchResult, self).__init__(**kwargs) + super(EntitiesBatchResultV2dot1, self).__init__(**kwargs) self.documents = None self.errors = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_v2dot1.py similarity index 73% rename from azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py rename to azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_v2dot1.py index e4751b5dde80..92b879bfdc67 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_v2dot1.py @@ -12,17 +12,17 @@ from msrest.serialization import Model -class EntityRecord(Model): - """EntityRecord. +class EntityRecordV2dot1(Model): + """EntityRecordV2dot1. Variables are only populated by the server, and will be ignored when sending a request. :param name: Entity formal name. :type name: str - :ivar matches: List of instances this entity appears in the text. - :vartype matches: - list[~azure.cognitiveservices.language.textanalytics.models.MatchRecord] + :param matches: List of instances this entity appears in the text. + :type matches: + list[~azure.cognitiveservices.language.textanalytics.models.MatchRecordV2dot1] :param wikipedia_language: Wikipedia language for which the WikipediaId and WikipediaUrl refers to. :type wikipedia_language: str @@ -34,27 +34,34 @@ class EntityRecord(Model): conjunction with the Bing Entity Search API to fetch additional relevant information. :type bing_id: str + :param type: Entity type from Named Entity Recognition model + :type type: str + :param sub_type: Entity sub type from Named Entity Recognition model + :type sub_type: str """ _validation = { - 'matches': {'readonly': True}, 'wikipedia_url': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '[MatchRecord]'}, + 'matches': {'key': 'matches', 'type': '[MatchRecordV2dot1]'}, 'wikipedia_language': {'key': 'wikipediaLanguage', 'type': 'str'}, 'wikipedia_id': {'key': 'wikipediaId', 'type': 'str'}, 'wikipedia_url': {'key': 'wikipediaUrl', 'type': 'str'}, 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sub_type': {'key': 'subType', 'type': 'str'}, } def __init__(self, **kwargs): - super(EntityRecord, self).__init__(**kwargs) + super(EntityRecordV2dot1, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.matches = None + self.matches = kwargs.get('matches', None) self.wikipedia_language = kwargs.get('wikipedia_language', None) self.wikipedia_id = kwargs.get('wikipedia_id', None) self.wikipedia_url = None self.bing_id = kwargs.get('bing_id', None) + self.type = kwargs.get('type', None) + self.sub_type = kwargs.get('sub_type', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_v2dot1_py3.py similarity index 68% rename from azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py rename to azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_v2dot1_py3.py index d0f25f93e96e..3155f2279e92 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_v2dot1_py3.py @@ -12,17 +12,17 @@ from msrest.serialization import Model -class EntityRecord(Model): - """EntityRecord. +class EntityRecordV2dot1(Model): + """EntityRecordV2dot1. Variables are only populated by the server, and will be ignored when sending a request. :param name: Entity formal name. :type name: str - :ivar matches: List of instances this entity appears in the text. - :vartype matches: - list[~azure.cognitiveservices.language.textanalytics.models.MatchRecord] + :param matches: List of instances this entity appears in the text. + :type matches: + list[~azure.cognitiveservices.language.textanalytics.models.MatchRecordV2dot1] :param wikipedia_language: Wikipedia language for which the WikipediaId and WikipediaUrl refers to. :type wikipedia_language: str @@ -34,27 +34,34 @@ class EntityRecord(Model): conjunction with the Bing Entity Search API to fetch additional relevant information. :type bing_id: str + :param type: Entity type from Named Entity Recognition model + :type type: str + :param sub_type: Entity sub type from Named Entity Recognition model + :type sub_type: str """ _validation = { - 'matches': {'readonly': True}, 'wikipedia_url': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '[MatchRecord]'}, + 'matches': {'key': 'matches', 'type': '[MatchRecordV2dot1]'}, 'wikipedia_language': {'key': 'wikipediaLanguage', 'type': 'str'}, 'wikipedia_id': {'key': 'wikipediaId', 'type': 'str'}, 'wikipedia_url': {'key': 'wikipediaUrl', 'type': 'str'}, 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sub_type': {'key': 'subType', 'type': 'str'}, } - def __init__(self, *, name: str=None, wikipedia_language: str=None, wikipedia_id: str=None, bing_id: str=None, **kwargs) -> None: - super(EntityRecord, self).__init__(**kwargs) + def __init__(self, *, name: str=None, matches=None, wikipedia_language: str=None, wikipedia_id: str=None, bing_id: str=None, type: str=None, sub_type: str=None, **kwargs) -> None: + super(EntityRecordV2dot1, self).__init__(**kwargs) self.name = name - self.matches = None + self.matches = matches self.wikipedia_language = wikipedia_language self.wikipedia_id = wikipedia_id self.wikipedia_url = None self.bing_id = bing_id + self.type = type + self.sub_type = sub_type diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_v2dot1.py similarity index 90% rename from azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py rename to azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_v2dot1.py index bd8df34f6779..ac8629105872 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_v2dot1.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class MatchRecord(Model): - """MatchRecord. +class MatchRecordV2dot1(Model): + """MatchRecordV2dot1. :param text: Entity text as appears in the request. :type text: str @@ -31,7 +31,7 @@ class MatchRecord(Model): } def __init__(self, **kwargs): - super(MatchRecord, self).__init__(**kwargs) + super(MatchRecordV2dot1, self).__init__(**kwargs) self.text = kwargs.get('text', None) self.offset = kwargs.get('offset', None) self.length = kwargs.get('length', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_v2dot1_py3.py similarity index 91% rename from azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py rename to azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_v2dot1_py3.py index f539fb7b220f..2ebe64a82c0f 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_v2dot1_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class MatchRecord(Model): - """MatchRecord. +class MatchRecordV2dot1(Model): + """MatchRecordV2dot1. :param text: Entity text as appears in the request. :type text: str @@ -31,7 +31,7 @@ class MatchRecord(Model): } def __init__(self, *, text: str=None, offset: int=None, length: int=None, **kwargs) -> None: - super(MatchRecord, self).__init__(**kwargs) + super(MatchRecordV2dot1, self).__init__(**kwargs) self.text = text self.offset = offset self.length = length diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py index ee6526a34d06..b11f307ed1ae 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py @@ -36,7 +36,7 @@ def __init__( raise ValueError("Parameter 'endpoint' must not be None.") if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") - base_url = '{Endpoint}/text/analytics/v2.0' + base_url = '{Endpoint}/text/analytics/v2.1-preview' super(TextAnalyticsClientConfiguration, self).__init__(base_url) @@ -67,7 +67,7 @@ def __init__( super(TextAnalyticsClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = 'v2.0' + self.api_version = 'v2.1-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -111,6 +111,7 @@ def key_phrases( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) @@ -119,9 +120,8 @@ def key_phrases( body_content = self._serialize.body(input, 'MultiLanguageBatchInput') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -175,6 +175,7 @@ def detect_language( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) @@ -183,9 +184,8 @@ def detect_language( body_content = self._serialize.body(input, 'BatchInput') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -242,6 +242,7 @@ def sentiment( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) @@ -250,9 +251,8 @@ def sentiment( body_content = self._serialize.body(input, 'MultiLanguageBatchInput') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -273,9 +273,22 @@ def entities( self, documents=None, custom_headers=None, raw=False, **operation_config): """The API returns a list of recognized entities in a given document. - To get even more information on each recognized entity we recommend - using the Bing Entity Search API by querying for the recognized - entities names. See the Supported + languages in Text Analytics API for the list of enabled + languages.The API returns a list of known entities and general named + entities ("Person", "Location", "Organization" etc) in a given + document. Known entities are returned with Wikipedia Id and Wikipedia + link, and also Bing Id which can be used in Bing Entity Search API. + General named entities are returned with entity types. If a general + named entity is also a known entity, then all information regarding it + (Wikipedia Id, Bing Id, entity type etc) will be returned. See the Supported + Entity Types in Text Analytics API for the list of supported Entity + Types. See the Supported languages in Text Analytics API for the list of enabled languages. @@ -287,9 +300,9 @@ def entities( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: EntitiesBatchResult or ClientRawResponse if raw=true + :return: EntitiesBatchResultV2dot1 or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResult + ~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultV2dot1 or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -308,6 +321,7 @@ def entities( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) @@ -316,9 +330,8 @@ def entities( body_content = self._serialize.body(input, 'MultiLanguageBatchInput') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -326,7 +339,7 @@ def entities( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('EntitiesBatchResult', response) + deserialized = self._deserialize('EntitiesBatchResultV2dot1', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/version.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/version.py index 9bd1dfac7ecb..8140355c0985 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/version.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.0" +VERSION = "v2.1-preview"