@@ -36,14 +36,10 @@ curl --location --request POST '<endpoint>/contentsafety/text:analyze?api-versio
36
36
--header ' Content-Type: application/json' \
37
37
--data-raw ' {
38
38
"text": "I hate you",
39
- "categories": [
40
- "Hate","Sexual","SelfHarm","Violence"
41
- ],
42
- "blocklistNames": [
43
- "string"
44
- ],
45
- "haltOnBlocklistHit": true,
46
- "outputType": "FourSeverityLevels"
39
+ "categories": ["Hate", "Sexual", "SelfHarm", "Violence"],
40
+ "blocklistNames": ["string"],
41
+ "haltOnBlocklistHit": true,
42
+ "outputType": "FourSeverityLevels"
47
43
}'
48
44
```
49
45
@@ -68,12 +64,8 @@ See the following sample request body:
68
64
``` json
69
65
{
70
66
"text" : " I hate you" ,
71
- "categories" : [
72
- " Hate" ," Sexual" ," SelfHarm" ," Violence"
73
- ],
74
- "blocklistNames" : [
75
- " array"
76
- ],
67
+ "categories" : [" Hate" , " Sexual" , " SelfHarm" , " Violence" ],
68
+ "blocklistNames" : [" array" ],
77
69
"haltOnBlocklistHit" : false ,
78
70
"outputType" : " FourSeverityLevels"
79
71
}
@@ -96,21 +88,22 @@ You should see the text moderation results displayed as JSON data in the console
96
88
}
97
89
],
98
90
"categoriesAnalysis" : [
99
- {
100
- "category" : " Hate" ,
101
- "severity" : 2
102
- },
103
- {
104
- "category" : " SelfHarm" ,
105
- "severity" : 0
106
- },
107
- {
108
- "category" : " Sexual" ,
109
- "severity" : 0
110
- },
111
- {
112
- "category" : " Violence" ,
113
- "severity" : 0
91
+ {
92
+ "category" : " Hate" ,
93
+ "severity" : 2
94
+ },
95
+ {
96
+ "category" : " SelfHarm" ,
97
+ "severity" : 0
98
+ },
99
+ {
100
+ "category" : " Sexual" ,
101
+ "severity" : 0
102
+ },
103
+ {
104
+ "category" : " Violence" ,
105
+ "severity" : 0
106
+ }
114
107
]
115
108
}
116
109
```
0 commit comments