diff --git a/sdk/cognitivelanguage/azure-ai-language-questionanswering/CHANGELOG.md b/sdk/cognitivelanguage/azure-ai-language-questionanswering/CHANGELOG.md index ec9dd35f032e..15558180c1de 100644 --- a/sdk/cognitivelanguage/azure-ai-language-questionanswering/CHANGELOG.md +++ b/sdk/cognitivelanguage/azure-ai-language-questionanswering/CHANGELOG.md @@ -12,16 +12,13 @@ * The filters model `StrictFilters` is renamed to `QueryFilters` * Enum `CompoundOperationKind` is renamed to `LogicalOperationKind` * We have removed the `string_index_type` input to all models and operations. We have also removed the `StringIndexType` enum. -* The type of input `metadata` to `MetadataFilter` has changed from a dictionary of strings to a list of key-value tuples. -For example, the input has changed from `{"key": "value"}` to `[("key", "value")]`. -* The input to the `query_knowledge_base` and `query_text` overloads that take in a positional model for the body should be -considered positional only. +* The type of input `metadata` to `MetadataFilter` has changed from a dictionary of strings to a list of key-value tuples. For example, the input has changed from `{"key": "value"}` to `[("key", "value")]`. +* The input to the `query_knowledge_base` and `query_text` overloads that take in a positional model for the body should be considered positional only. ### Features Added * The method `QuestionAnsweringClient.query_text` now supports a list of records as strings, where the ID value will be automatically populated. -* Added keyword argument `default_language` onto `QuestionAnsweringClient`, which has default value `'en'`. The default language for any operation call will -be this default language value. +* Added keyword argument `default_language` onto `QuestionAnsweringClient`, which has default value `'en'`. The default language for any operation call will be this default language value. ## 1.0.0b1 (2021-07-27) diff --git a/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_patch.py b/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_patch.py index c6d13a81ffd0..44a5cd3f4d5c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_patch.py @@ -60,3 +60,5 @@ def _verify_qna_id_and_question(query_knowledgebase_options): raise TypeError( "You need to pass in either `qna_id` or `question`." ) + if qna_id and question: + raise TypeError("You can not specify both `qna_id` and `question`.") diff --git a/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_question_answering_client.py b/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_question_answering_client.py index 0ec3d5a66199..96c7eb2e28fc 100644 --- a/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_question_answering_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_question_answering_client.py @@ -33,7 +33,6 @@ class QuestionAnsweringClient(QuestionAnsweringClientOperationsMixin): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.AzureKeyCredential :keyword str default_language: Sets the default language to use for all operations. - Defaults to "en". """ def __init__( @@ -51,7 +50,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self._default_language = kwargs.pop("default_language", "en") + self._default_language = kwargs.pop("default_language", None) def send_request( self, diff --git a/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py b/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py index c9bc4a2edd2a..a506cabb9960 100644 --- a/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py @@ -28,7 +28,6 @@ class QuestionAnsweringClient(QuestionAnsweringClientOperationsMixin): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.AzureKeyCredential :keyword str default_language: Sets the default language to use for all operations. - Defaults to "en". """ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: @@ -40,7 +39,7 @@ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self._default_language = kwargs.pop("default_language", "en") + self._default_language = kwargs.pop("default_language", None) def send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies.