Skip to content

Commit

Permalink
[qna] address heath's comments (#20998)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Sep 30, 2021
1 parent ebce185 commit 848cc57
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`.")
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down

0 comments on commit 848cc57

Please sign in to comment.