Skip to content

Commit 479769a

Browse files
committed
fix disable_service_logs check and remove en-us from links
1 parent b1cadd2 commit 479769a

File tree

3 files changed

+38
-38
lines changed

3 files changed

+38
-38
lines changed

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ class RecognizeEntitiesAction(DictMixin):
14451445
disables input logging and may limit our ability to remediate issues that occur. Please see
14461446
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
14471447
additional details, and Microsoft Responsible AI principles at
1448-
https://www.microsoft.com/en-us/ai/responsible-ai.
1448+
https://www.microsoft.com/ai/responsible-ai.
14491449
:ivar str model_version: The model version to use for the analysis.
14501450
:ivar str string_index_type: Specifies the method used to interpret string offsets.
14511451
`UnicodeCodePoint`, the Python encoding, is the default. To override the Python default,
@@ -1458,7 +1458,7 @@ class RecognizeEntitiesAction(DictMixin):
14581458
disables input logging and may limit our ability to remediate issues that occur. Please see
14591459
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
14601460
additional details, and Microsoft Responsible AI principles at
1461-
https://www.microsoft.com/en-us/ai/responsible-ai.
1461+
https://www.microsoft.com/ai/responsible-ai.
14621462
"""
14631463

14641464
def __init__(self, **kwargs):
@@ -1505,7 +1505,7 @@ class AnalyzeSentimentAction(DictMixin):
15051505
disables input logging and may limit our ability to remediate issues that occur. Please see
15061506
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
15071507
additional details, and Microsoft Responsible AI principles at
1508-
https://www.microsoft.com/en-us/ai/responsible-ai.
1508+
https://www.microsoft.com/ai/responsible-ai.
15091509
:ivar str model_version: The model version to use for the analysis.
15101510
:ivar bool show_opinion_mining: Whether to mine the opinions of a sentence and conduct more
15111511
granular analysis around the aspects of a product or service (also known as
@@ -1523,7 +1523,7 @@ class AnalyzeSentimentAction(DictMixin):
15231523
disables input logging and may limit our ability to remediate issues that occur. Please see
15241524
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
15251525
additional details, and Microsoft Responsible AI principles at
1526-
https://www.microsoft.com/en-us/ai/responsible-ai.
1526+
https://www.microsoft.com/ai/responsible-ai.
15271527
"""
15281528

15291529
def __init__(self, **kwargs):
@@ -1574,7 +1574,7 @@ class RecognizePiiEntitiesAction(DictMixin):
15741574
disables input logging and may limit our ability to remediate issues that occur. Please see
15751575
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
15761576
additional details, and Microsoft Responsible AI principles at
1577-
https://www.microsoft.com/en-us/ai/responsible-ai.
1577+
https://www.microsoft.com/ai/responsible-ai.
15781578
:ivar str model_version: The model version to use for the analysis.
15791579
:ivar str domain_filter: An optional string to set the PII domain to include only a
15801580
subset of the PII entity categories. Possible values include 'phi' or None.
@@ -1589,7 +1589,7 @@ class RecognizePiiEntitiesAction(DictMixin):
15891589
disables input logging and may limit our ability to remediate issues that occur. Please see
15901590
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
15911591
additional details, and Microsoft Responsible AI principles at
1592-
https://www.microsoft.com/en-us/ai/responsible-ai.
1592+
https://www.microsoft.com/ai/responsible-ai.
15931593
"""
15941594

15951595
def __init__(self, **kwargs):
@@ -1634,7 +1634,7 @@ class ExtractKeyPhrasesAction(DictMixin):
16341634
disables input logging and may limit our ability to remediate issues that occur. Please see
16351635
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
16361636
additional details, and Microsoft Responsible AI principles at
1637-
https://www.microsoft.com/en-us/ai/responsible-ai.
1637+
https://www.microsoft.com/ai/responsible-ai.
16381638
:ivar str model_version: The model version to use for the analysis.
16391639
:ivar bool disable_service_logs: If set to true, you opt-out of having your text input
16401640
logged on the service side for troubleshooting. By default, Text Analytics logs your
@@ -1643,7 +1643,7 @@ class ExtractKeyPhrasesAction(DictMixin):
16431643
disables input logging and may limit our ability to remediate issues that occur. Please see
16441644
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
16451645
additional details, and Microsoft Responsible AI principles at
1646-
https://www.microsoft.com/en-us/ai/responsible-ai.
1646+
https://www.microsoft.com/ai/responsible-ai.
16471647
"""
16481648

16491649
def __init__(self, **kwargs):
@@ -1683,7 +1683,7 @@ class RecognizeLinkedEntitiesAction(DictMixin):
16831683
disables input logging and may limit our ability to remediate issues that occur. Please see
16841684
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
16851685
additional details, and Microsoft Responsible AI principles at
1686-
https://www.microsoft.com/en-us/ai/responsible-ai.
1686+
https://www.microsoft.com/ai/responsible-ai.
16871687
:ivar str model_version: The model version to use for the analysis.
16881688
:ivar str string_index_type: Specifies the method used to interpret string offsets.
16891689
`UnicodeCodePoint`, the Python encoding, is the default. To override the Python default,
@@ -1696,7 +1696,7 @@ class RecognizeLinkedEntitiesAction(DictMixin):
16961696
disables input logging and may limit our ability to remediate issues that occur. Please see
16971697
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
16981698
additional details, and Microsoft Responsible AI principles at
1699-
https://www.microsoft.com/en-us/ai/responsible-ai.
1699+
https://www.microsoft.com/ai/responsible-ai.
17001700
"""
17011701

17021702
def __init__(self, **kwargs):

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def detect_language( # type: ignore
164164
disables input logging and may limit our ability to remediate issues that occur. Please see
165165
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
166166
additional details, and Microsoft Responsible AI principles at
167-
https://www.microsoft.com/en-us/ai/responsible-ai.
167+
https://www.microsoft.com/ai/responsible-ai.
168168
:return: The combined list of :class:`~azure.ai.textanalytics.DetectLanguageResult` and
169169
:class:`~azure.ai.textanalytics.DocumentError` in the order the original documents were
170170
passed in.
@@ -187,7 +187,7 @@ def detect_language( # type: ignore
187187
model_version = kwargs.pop("model_version", None)
188188
show_stats = kwargs.pop("show_stats", False)
189189
disable_service_logs = kwargs.pop("disable_service_logs", None)
190-
if disable_service_logs:
190+
if disable_service_logs is not None:
191191
kwargs['logging_opt_out'] = disable_service_logs
192192
try:
193193
return self._client.languages(
@@ -246,7 +246,7 @@ def recognize_entities( # type: ignore
246246
disables input logging and may limit our ability to remediate issues that occur. Please see
247247
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
248248
additional details, and Microsoft Responsible AI principles at
249-
https://www.microsoft.com/en-us/ai/responsible-ai.
249+
https://www.microsoft.com/ai/responsible-ai.
250250
:return: The combined list of :class:`~azure.ai.textanalytics.RecognizeEntitiesResult` and
251251
:class:`~azure.ai.textanalytics.DocumentError` in the order the original documents
252252
were passed in.
@@ -276,7 +276,7 @@ def recognize_entities( # type: ignore
276276
if string_index_type:
277277
kwargs.update({"string_index_type": string_index_type})
278278
disable_service_logs = kwargs.pop("disable_service_logs", None)
279-
if disable_service_logs:
279+
if disable_service_logs is not None:
280280
kwargs['logging_opt_out'] = disable_service_logs
281281

282282
try:
@@ -345,7 +345,7 @@ def recognize_pii_entities( # type: ignore
345345
disables input logging and may limit our ability to remediate issues that occur. Please see
346346
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
347347
additional details, and Microsoft Responsible AI principles at
348-
https://www.microsoft.com/en-us/ai/responsible-ai.
348+
https://www.microsoft.com/ai/responsible-ai.
349349
:return: The combined list of :class:`~azure.ai.textanalytics.RecognizePiiEntitiesResult`
350350
and :class:`~azure.ai.textanalytics.DocumentError` in the order the original documents
351351
were passed in.
@@ -378,7 +378,7 @@ def recognize_pii_entities( # type: ignore
378378
if string_index_type:
379379
kwargs.update({"string_index_type": string_index_type})
380380
disable_service_logs = kwargs.pop("disable_service_logs", None)
381-
if disable_service_logs:
381+
if disable_service_logs is not None:
382382
kwargs['logging_opt_out'] = disable_service_logs
383383

384384
try:
@@ -447,7 +447,7 @@ def recognize_linked_entities( # type: ignore
447447
disables input logging and may limit our ability to remediate issues that occur. Please see
448448
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
449449
additional details, and Microsoft Responsible AI principles at
450-
https://www.microsoft.com/en-us/ai/responsible-ai.
450+
https://www.microsoft.com/ai/responsible-ai.
451451
:return: The combined list of :class:`~azure.ai.textanalytics.RecognizeLinkedEntitiesResult`
452452
and :class:`~azure.ai.textanalytics.DocumentError` in the order the original documents
453453
were passed in.
@@ -470,7 +470,7 @@ def recognize_linked_entities( # type: ignore
470470
model_version = kwargs.pop("model_version", None)
471471
show_stats = kwargs.pop("show_stats", False)
472472
disable_service_logs = kwargs.pop("disable_service_logs", None)
473-
if disable_service_logs:
473+
if disable_service_logs is not None:
474474
kwargs['logging_opt_out'] = disable_service_logs
475475

476476
string_index_type = _check_string_index_type_arg(
@@ -554,7 +554,7 @@ def begin_analyze_healthcare_entities( # type: ignore
554554
disables input logging and may limit our ability to remediate issues that occur. Please see
555555
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
556556
additional details, and Microsoft Responsible AI principles at
557-
https://www.microsoft.com/en-us/ai/responsible-ai.
557+
https://www.microsoft.com/ai/responsible-ai.
558558
:return: An instance of an AnalyzeHealthcareEntitiesLROPoller. Call `result()` on the this
559559
object to return a pageable of :class:`~azure.ai.textanalytics.AnalyzeHealthcareEntitiesResultItem`.
560560
:rtype:
@@ -582,7 +582,7 @@ def begin_analyze_healthcare_entities( # type: ignore
582582

583583
doc_id_order = [doc.get("id") for doc in docs]
584584
disable_service_logs = kwargs.pop("disable_service_logs", None)
585-
if disable_service_logs:
585+
if disable_service_logs is not None:
586586
kwargs['logging_opt_out'] = disable_service_logs
587587

588588
try:
@@ -657,7 +657,7 @@ def extract_key_phrases( # type: ignore
657657
disables input logging and may limit our ability to remediate issues that occur. Please see
658658
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
659659
additional details, and Microsoft Responsible AI principles at
660-
https://www.microsoft.com/en-us/ai/responsible-ai.
660+
https://www.microsoft.com/ai/responsible-ai.
661661
:return: The combined list of :class:`~azure.ai.textanalytics.ExtractKeyPhrasesResult` and
662662
:class:`~azure.ai.textanalytics.DocumentError` in the order the original documents were
663663
passed in.
@@ -680,7 +680,7 @@ def extract_key_phrases( # type: ignore
680680
model_version = kwargs.pop("model_version", None)
681681
show_stats = kwargs.pop("show_stats", False)
682682
disable_service_logs = kwargs.pop("disable_service_logs", None)
683-
if disable_service_logs:
683+
if disable_service_logs is not None:
684684
kwargs['logging_opt_out'] = disable_service_logs
685685

686686
try:
@@ -746,7 +746,7 @@ def analyze_sentiment( # type: ignore
746746
disables input logging and may limit our ability to remediate issues that occur. Please see
747747
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
748748
additional details, and Microsoft Responsible AI principles at
749-
https://www.microsoft.com/en-us/ai/responsible-ai.
749+
https://www.microsoft.com/ai/responsible-ai.
750750
.. versionadded:: v3.1-preview
751751
The *show_opinion_mining* parameter.
752752
The *string_index_type* parameter.
@@ -773,7 +773,7 @@ def analyze_sentiment( # type: ignore
773773
show_stats = kwargs.pop("show_stats", False)
774774
show_opinion_mining = kwargs.pop("show_opinion_mining", None)
775775
disable_service_logs = kwargs.pop("disable_service_logs", None)
776-
if disable_service_logs:
776+
if disable_service_logs is not None:
777777
kwargs['logging_opt_out'] = disable_service_logs
778778

779779
string_index_type = _check_string_index_type_arg(

0 commit comments

Comments
 (0)