Skip to content

Commit cbdaf08

Browse files
authored
[qna] regenerate with 2021-07-15-preview (Azure#20764)
1 parent 8a7ae28 commit cbdaf08

File tree

50 files changed

+853
-1141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+853
-1141
lines changed

eng/.docsettings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ known_content_issues:
7878
- ['sdk/servicebus/azure-servicebus/tests/perf_tests/README.md', '#4554']
7979
- ['sdk/servicefabric/azure-servicefabric/README.md', '#4554']
8080
- ['sdk/storage/azure-storage-blob/swagger/README.md', '#4554']
81+
- ['cognitivelanguage/azure-ai-language-questionanswering/swagger/README.md', '#4554']
8182
- ['sdk/storage/azure-storage-file-datalake/swagger/README.md', '#4554']
8283
- ['sdk/storage/azure-storage-file-share/swagger/README.md', '#4554']
8384
- ['sdk/storage/azure-storage/README.md', '#4554']

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## 1.0.0b2 (unreleased)
44

5+
* We are now targeting service version `2021-07-15-preview`
6+
57
### Breaking changes
68
* The method `QuestionAnsweringClient.query_knowledgebase` has been renamed to `query_knowledge_base`.
79

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ class QuestionAnsweringClientConfiguration(Configuration):
2626
Note that all parameters used to create this instance are saved as instance
2727
attributes.
2828
29-
:param credential: Credential needed for the client to connect to Azure.
30-
:type credential: ~azure.core.credentials.AzureKeyCredential
3129
:param endpoint: Supported Cognitive Services endpoint (e.g., https://:code:`<resource-name>`.api.cognitiveservices.azure.com).
3230
:type endpoint: str
31+
:param credential: Credential needed for the client to connect to Azure.
32+
:type credential: ~azure.core.credentials.AzureKeyCredential
3333
"""
3434

3535
def __init__(
3636
self,
37-
credential, # type: AzureKeyCredential
3837
endpoint, # type: str
38+
credential, # type: AzureKeyCredential
3939
**kwargs # type: Any
4040
):
4141
# type: (...) -> None
42-
if credential is None:
43-
raise ValueError("Parameter 'credential' must not be None.")
4442
if endpoint is None:
4543
raise ValueError("Parameter 'endpoint' must not be None.")
44+
if credential is None:
45+
raise ValueError("Parameter 'credential' must not be None.")
4646
super(QuestionAnsweringClientConfiguration, self).__init__(**kwargs)
4747

48-
self.credential = credential
4948
self.endpoint = endpoint
50-
self.api_version = "2021-05-01-preview"
49+
self.credential = credential
50+
self.api_version = "2021-07-15-preview"
5151
kwargs.setdefault("sdk_moniker", "ai-language-questionanswering/{}".format(VERSION))
5252
self._configure(**kwargs)
5353

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818

1919
if TYPE_CHECKING:
2020
# pylint: disable=unused-import,ungrouped-imports
21-
from typing import Any
21+
from typing import Any, Optional
2222

2323
from azure.core.credentials import AzureKeyCredential
2424
from azure.core.rest import HttpRequest, HttpResponse
2525

2626

2727
class QuestionAnsweringClient(QuestionAnsweringClientOperationsMixin):
28-
"""The language service API is a suite of natural language processing (NLP) skills 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, language detection and question answering. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview.
28+
"""The language service API is a suite of natural language processing (NLP) skills 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, language detection and question answering. 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>`.
2929
3030
:param endpoint: Supported Cognitive Services endpoint (e.g.,
31-
https://<resource-name>.api.cognitiveservices.azure.com).
31+
https://:code:`<resource-name>`.api.cognitiveservices.azure.com).
3232
:type endpoint: str
3333
:param credential: Credential needed for the client to connect to Azure.
3434
:type credential: ~azure.core.credentials.AzureKeyCredential
@@ -41,9 +41,9 @@ def __init__(
4141
**kwargs # type: Any
4242
):
4343
# type: (...) -> None
44-
base_url = "{Endpoint}/language"
45-
self._config = QuestionAnsweringClientConfiguration(credential, endpoint, **kwargs)
46-
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
44+
_endpoint = "{Endpoint}/language"
45+
self._config = QuestionAnsweringClientConfiguration(endpoint, credential, **kwargs)
46+
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
4747

4848
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
4949
self._serialize = Serializer(client_models)
@@ -57,6 +57,13 @@ def send_request(
5757
):
5858
# type: (...) -> HttpResponse
5959
"""Runs the network request through the client's chained policies.
60+
61+
>>> from azure.core.rest import HttpRequest
62+
>>> request = HttpRequest("GET", "https://www.example.org/")
63+
<HttpRequest [GET], url: 'https://www.example.org/'>
64+
>>> response = client.send_request(request)
65+
<HttpResponse: 200 OK>
66+
6067
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
6168
6269
:param request: The network request you want to make. Required.
@@ -70,6 +77,7 @@ def send_request(
7077
path_format_arguments = {
7178
"Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
7279
}
80+
7381
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
7482
return self._client.send_request(request_copy, **kwargs)
7583

sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_rest/__init__.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_rest/_request_builders.py

Lines changed: 0 additions & 229 deletions
This file was deleted.

0 commit comments

Comments
 (0)