Skip to content

Commit 74adc09

Browse files
feat(language): update the api
#### language:v1 The following keys were added: - resources.documents.methods.moderateText (Total Keys: 8) - schemas.AnnotateTextResponse.properties.moderationCategories (Total Keys: 2) - schemas.Features.properties.moderateText.type (Total Keys: 1) - schemas.ModerateTextRequest (Total Keys: 3) - schemas.ModerateTextResponse (Total Keys: 4) #### language:v1beta2 The following keys were added: - resources.documents.methods.moderateText (Total Keys: 8) - schemas.AnnotateTextResponse.properties.moderationCategories (Total Keys: 2) - schemas.Features.properties.moderateText.type (Total Keys: 1) - schemas.ModerateTextRequest (Total Keys: 3) - schemas.ModerateTextResponse (Total Keys: 4)
1 parent ea82d2d commit 74adc09

File tree

4 files changed

+204
-2
lines changed

4 files changed

+204
-2
lines changed

docs/dyn/language_v1.documents.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ <h2>Instance Methods</h2>
9595
<p class="toc_element">
9696
<code><a href="#close">close()</a></code></p>
9797
<p class="firstline">Close httplib2 connections.</p>
98+
<p class="toc_element">
99+
<code><a href="#moderateText">moderateText(body=None, x__xgafv=None)</a></code></p>
100+
<p class="firstline">Moderates a document for harmful and sensitive categories.</p>
98101
<h3>Method Details</h3>
99102
<div class="method">
100103
<code class="details" id="analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</code>
@@ -358,6 +361,7 @@ <h3>Method Details</h3>
358361
&quot;extractEntities&quot;: True or False, # Extract entities.
359362
&quot;extractEntitySentiment&quot;: True or False, # Extract entities and their associated sentiment.
360363
&quot;extractSyntax&quot;: True or False, # Extract syntax information.
364+
&quot;moderateText&quot;: True or False, # Moderate the document for harmful and sensitive categories.
361365
},
362366
}
363367

@@ -408,6 +412,12 @@ <h3>Method Details</h3>
408412
},
409413
],
410414
&quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.
415+
&quot;moderationCategories&quot;: [ # Harmful and sensitive categories identified in the input document.
416+
{ # Represents a category returned from the text classifier.
417+
&quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain the classifier is that this category represents the given text.
418+
&quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document.
419+
},
420+
],
411421
&quot;sentences&quot;: [ # Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
412422
{ # Represents a sentence in the input document.
413423
&quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
@@ -497,4 +507,39 @@ <h3>Method Details</h3>
497507
<pre>Close httplib2 connections.</pre>
498508
</div>
499509

510+
<div class="method">
511+
<code class="details" id="moderateText">moderateText(body=None, x__xgafv=None)</code>
512+
<pre>Moderates a document for harmful and sensitive categories.
513+
514+
Args:
515+
body: object, The request body.
516+
The object takes the form of:
517+
518+
{ # The document moderation request message.
519+
&quot;document&quot;: { # Represents the input to API methods. # Required. Input document.
520+
&quot;content&quot;: &quot;A String&quot;, # The content of the input in string format. Cloud audit logging exempt since it is based on user data.
521+
&quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
522+
&quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
523+
&quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
524+
},
525+
}
526+
527+
x__xgafv: string, V1 error format.
528+
Allowed values
529+
1 - v1 error format
530+
2 - v2 error format
531+
532+
Returns:
533+
An object of the form:
534+
535+
{ # The document moderation response message.
536+
&quot;moderationCategories&quot;: [ # Harmful and sensitive categories representing the input document.
537+
{ # Represents a category returned from the text classifier.
538+
&quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain the classifier is that this category represents the given text.
539+
&quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document.
540+
},
541+
],
542+
}</pre>
543+
</div>
544+
500545
</body></html>

docs/dyn/language_v1beta2.documents.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ <h2>Instance Methods</h2>
9595
<p class="toc_element">
9696
<code><a href="#close">close()</a></code></p>
9797
<p class="firstline">Close httplib2 connections.</p>
98+
<p class="toc_element">
99+
<code><a href="#moderateText">moderateText(body=None, x__xgafv=None)</a></code></p>
100+
<p class="firstline">Moderates a document for harmful and sensitive categories.</p>
98101
<h3>Method Details</h3>
99102
<div class="method">
100103
<code class="details" id="analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</code>
@@ -368,6 +371,7 @@ <h3>Method Details</h3>
368371
&quot;extractEntities&quot;: True or False, # Extract entities.
369372
&quot;extractEntitySentiment&quot;: True or False, # Extract entities and their associated sentiment.
370373
&quot;extractSyntax&quot;: True or False, # Extract syntax information.
374+
&quot;moderateText&quot;: True or False, # Moderate the document for harmful and sensitive categories.
371375
},
372376
}
373377

@@ -418,6 +422,12 @@ <h3>Method Details</h3>
418422
},
419423
],
420424
&quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.
425+
&quot;moderationCategories&quot;: [ # Harmful and sensitive categories identified in the input document.
426+
{ # Represents a category returned from the text classifier.
427+
&quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain the classifier is that this category represents the given text.
428+
&quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document.
429+
},
430+
],
421431
&quot;sentences&quot;: [ # Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
422432
{ # Represents a sentence in the input document.
423433
&quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
@@ -509,4 +519,41 @@ <h3>Method Details</h3>
509519
<pre>Close httplib2 connections.</pre>
510520
</div>
511521

522+
<div class="method">
523+
<code class="details" id="moderateText">moderateText(body=None, x__xgafv=None)</code>
524+
<pre>Moderates a document for harmful and sensitive categories.
525+
526+
Args:
527+
body: object, The request body.
528+
The object takes the form of:
529+
530+
{ # The document moderation request message.
531+
&quot;document&quot;: { # Represents the input to API methods. # Required. Input document.
532+
&quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
533+
&quot;content&quot;: &quot;A String&quot;, # The content of the input in string format. Cloud audit logging exempt since it is based on user data.
534+
&quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
535+
&quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
536+
&quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
537+
&quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
538+
},
539+
}
540+
541+
x__xgafv: string, V1 error format.
542+
Allowed values
543+
1 - v1 error format
544+
2 - v2 error format
545+
546+
Returns:
547+
An object of the form:
548+
549+
{ # The document moderation response message.
550+
&quot;moderationCategories&quot;: [ # Harmful and sensitive categories representing the input document.
551+
{ # Represents a category returned from the text classifier.
552+
&quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain the classifier is that this category represents the given text.
553+
&quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document.
554+
},
555+
],
556+
}</pre>
557+
</div>
558+
512559
</body></html>

googleapiclient/discovery_cache/documents/language.v1.json

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,30 @@
223223
"https://www.googleapis.com/auth/cloud-language",
224224
"https://www.googleapis.com/auth/cloud-platform"
225225
]
226+
},
227+
"moderateText": {
228+
"description": "Moderates a document for harmful and sensitive categories.",
229+
"flatPath": "v1/documents:moderateText",
230+
"httpMethod": "POST",
231+
"id": "language.documents.moderateText",
232+
"parameterOrder": [],
233+
"parameters": {},
234+
"path": "v1/documents:moderateText",
235+
"request": {
236+
"$ref": "ModerateTextRequest"
237+
},
238+
"response": {
239+
"$ref": "ModerateTextResponse"
240+
},
241+
"scopes": [
242+
"https://www.googleapis.com/auth/cloud-language",
243+
"https://www.googleapis.com/auth/cloud-platform"
244+
]
226245
}
227246
}
228247
}
229248
},
230-
"revision": "20230520",
249+
"revision": "20230603",
231250
"rootUrl": "https://language.googleapis.com/",
232251
"schemas": {
233252
"AnalyzeEntitiesRequest": {
@@ -478,6 +497,13 @@
478497
"description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.",
479498
"type": "string"
480499
},
500+
"moderationCategories": {
501+
"description": "Harmful and sensitive categories identified in the input document.",
502+
"items": {
503+
"$ref": "ClassificationCategory"
504+
},
505+
"type": "array"
506+
},
481507
"sentences": {
482508
"description": "Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.",
483509
"items": {
@@ -898,6 +924,35 @@
898924
"extractSyntax": {
899925
"description": "Extract syntax information.",
900926
"type": "boolean"
927+
},
928+
"moderateText": {
929+
"description": "Moderate the document for harmful and sensitive categories.",
930+
"type": "boolean"
931+
}
932+
},
933+
"type": "object"
934+
},
935+
"ModerateTextRequest": {
936+
"description": "The document moderation request message.",
937+
"id": "ModerateTextRequest",
938+
"properties": {
939+
"document": {
940+
"$ref": "Document",
941+
"description": "Required. Input document."
942+
}
943+
},
944+
"type": "object"
945+
},
946+
"ModerateTextResponse": {
947+
"description": "The document moderation response message.",
948+
"id": "ModerateTextResponse",
949+
"properties": {
950+
"moderationCategories": {
951+
"description": "Harmful and sensitive categories representing the input document.",
952+
"items": {
953+
"$ref": "ClassificationCategory"
954+
},
955+
"type": "array"
901956
}
902957
},
903958
"type": "object"

googleapiclient/discovery_cache/documents/language.v1beta2.json

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,30 @@
223223
"https://www.googleapis.com/auth/cloud-language",
224224
"https://www.googleapis.com/auth/cloud-platform"
225225
]
226+
},
227+
"moderateText": {
228+
"description": "Moderates a document for harmful and sensitive categories.",
229+
"flatPath": "v1beta2/documents:moderateText",
230+
"httpMethod": "POST",
231+
"id": "language.documents.moderateText",
232+
"parameterOrder": [],
233+
"parameters": {},
234+
"path": "v1beta2/documents:moderateText",
235+
"request": {
236+
"$ref": "ModerateTextRequest"
237+
},
238+
"response": {
239+
"$ref": "ModerateTextResponse"
240+
},
241+
"scopes": [
242+
"https://www.googleapis.com/auth/cloud-language",
243+
"https://www.googleapis.com/auth/cloud-platform"
244+
]
226245
}
227246
}
228247
}
229248
},
230-
"revision": "20230520",
249+
"revision": "20230603",
231250
"rootUrl": "https://language.googleapis.com/",
232251
"schemas": {
233252
"AnalyzeEntitiesRequest": {
@@ -478,6 +497,13 @@
478497
"description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.",
479498
"type": "string"
480499
},
500+
"moderationCategories": {
501+
"description": "Harmful and sensitive categories identified in the input document.",
502+
"items": {
503+
"$ref": "ClassificationCategory"
504+
},
505+
"type": "array"
506+
},
481507
"sentences": {
482508
"description": "Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.",
483509
"items": {
@@ -916,6 +942,35 @@
916942
"extractSyntax": {
917943
"description": "Extract syntax information.",
918944
"type": "boolean"
945+
},
946+
"moderateText": {
947+
"description": "Moderate the document for harmful and sensitive categories.",
948+
"type": "boolean"
949+
}
950+
},
951+
"type": "object"
952+
},
953+
"ModerateTextRequest": {
954+
"description": "The document moderation request message.",
955+
"id": "ModerateTextRequest",
956+
"properties": {
957+
"document": {
958+
"$ref": "Document",
959+
"description": "Required. Input document."
960+
}
961+
},
962+
"type": "object"
963+
},
964+
"ModerateTextResponse": {
965+
"description": "The document moderation response message.",
966+
"id": "ModerateTextResponse",
967+
"properties": {
968+
"moderationCategories": {
969+
"description": "Harmful and sensitive categories representing the input document.",
970+
"items": {
971+
"$ref": "ClassificationCategory"
972+
},
973+
"type": "array"
919974
}
920975
},
921976
"type": "object"

0 commit comments

Comments
 (0)