Skip to content

Commit 848cc57

Browse files
authored
[qna] address heath's comments (Azure#20998)
1 parent ebce185 commit 848cc57

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

sdk/cognitivelanguage/azure-ai-language-questionanswering/CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
* The filters model `StrictFilters` is renamed to `QueryFilters`
1313
* Enum `CompoundOperationKind` is renamed to `LogicalOperationKind`
1414
* We have removed the `string_index_type` input to all models and operations. We have also removed the `StringIndexType` enum.
15-
* The type of input `metadata` to `MetadataFilter` has changed from a dictionary of strings to a list of key-value tuples.
16-
For example, the input has changed from `{"key": "value"}` to `[("key", "value")]`.
17-
* The input to the `query_knowledge_base` and `query_text` overloads that take in a positional model for the body should be
18-
considered positional only.
15+
* 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")]`.
16+
* 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.
1917

2018
### Features Added
2119

2220
* The method `QuestionAnsweringClient.query_text` now supports a list of records as strings, where the ID value will be automatically populated.
23-
* Added keyword argument `default_language` onto `QuestionAnsweringClient`, which has default value `'en'`. The default language for any operation call will
24-
be this default language value.
21+
* 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.
2522

2623

2724
## 1.0.0b1 (2021-07-27)

sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_patch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ def _verify_qna_id_and_question(query_knowledgebase_options):
6060
raise TypeError(
6161
"You need to pass in either `qna_id` or `question`."
6262
)
63+
if qna_id and question:
64+
raise TypeError("You can not specify both `qna_id` and `question`.")

sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_question_answering_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class QuestionAnsweringClient(QuestionAnsweringClientOperationsMixin):
3333
:param credential: Credential needed for the client to connect to Azure.
3434
:type credential: ~azure.core.credentials.AzureKeyCredential
3535
:keyword str default_language: Sets the default language to use for all operations.
36-
Defaults to "en".
3736
"""
3837

3938
def __init__(
@@ -51,7 +50,7 @@ def __init__(
5150
self._serialize = Serializer(client_models)
5251
self._deserialize = Deserializer(client_models)
5352
self._serialize.client_side_validation = False
54-
self._default_language = kwargs.pop("default_language", "en")
53+
self._default_language = kwargs.pop("default_language", None)
5554

5655
def send_request(
5756
self,

sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class QuestionAnsweringClient(QuestionAnsweringClientOperationsMixin):
2828
:param credential: Credential needed for the client to connect to Azure.
2929
:type credential: ~azure.core.credentials.AzureKeyCredential
3030
:keyword str default_language: Sets the default language to use for all operations.
31-
Defaults to "en".
3231
"""
3332

3433
def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None:
@@ -40,7 +39,7 @@ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any)
4039
self._serialize = Serializer(client_models)
4140
self._deserialize = Deserializer(client_models)
4241
self._serialize.client_side_validation = False
43-
self._default_language = kwargs.pop("default_language", "en")
42+
self._default_language = kwargs.pop("default_language", None)
4443

4544
def send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
4645
"""Runs the network request through the client's chained policies.

0 commit comments

Comments
 (0)