python/resources/moderations/index.md +0 −1102 deleted
File Deleted View Diff
1# Moderations
2
3## Create moderation
4
5`moderations.create(ModerationCreateParams**kwargs) -> ModerationCreateResponse`
6
7**post** `/moderations`
8
9Classifies if text and/or image inputs are potentially harmful. Learn
10more in the [moderation guide](https://platform.openai.com/docs/guides/moderation).
11
12### Parameters
13
14- `input: Union[str, Sequence[str], Iterable[ModerationMultiModalInputParam]]`
15
16 Input (or inputs) to classify. Can be a single string, an array of strings, or
17 an array of multi-modal input objects similar to other models.
18
19 - `str`
20
21 A string of text to classify for moderation.
22
23 - `Sequence[str]`
24
25 An array of strings to classify for moderation.
26
27 - `Iterable[ModerationMultiModalInputParam]`
28
29 An array of multi-modal inputs to the moderation model.
30
31 - `class ModerationImageURLInput: …`
32
33 An object describing an image to classify.
34
35 - `image_url: ImageURL`
36
37 Contains either an image URL or a data URL for a base64 encoded image.
38
39 - `url: str`
40
41 Either a URL of the image or the base64 encoded image data.
42
43 - `type: Literal["image_url"]`
44
45 Always `image_url`.
46
47 - `"image_url"`
48
49 - `class ModerationTextInput: …`
50
51 An object describing text to classify.
52
53 - `text: str`
54
55 A string of text to classify.
56
57 - `type: Literal["text"]`
58
59 Always `text`.
60
61 - `"text"`
62
63- `model: Optional[Union[str, ModerationModel]]`
64
65 The content moderation model you would like to use. Learn more in
66 [the moderation guide](https://platform.openai.com/docs/guides/moderation), and learn about
67 available models [here](https://platform.openai.com/docs/models#moderation).
68
69 - `str`
70
71 - `Literal["omni-moderation-latest", "omni-moderation-2024-09-26", "text-moderation-latest", "text-moderation-stable"]`
72
73 - `"omni-moderation-latest"`
74
75 - `"omni-moderation-2024-09-26"`
76
77 - `"text-moderation-latest"`
78
79 - `"text-moderation-stable"`
80
81### Returns
82
83- `class ModerationCreateResponse: …`
84
85 Represents if a given text input is potentially harmful.
86
87 - `id: str`
88
89 The unique identifier for the moderation request.
90
91 - `model: str`
92
93 The model used to generate the moderation results.
94
95 - `results: List[Moderation]`
96
97 A list of moderation objects.
98
99 - `categories: Categories`
100
101 A list of the categories, and whether they are flagged or not.
102
103 - `harassment: bool`
104
105 Content that expresses, incites, or promotes harassing language towards any target.
106
107 - `harassment_threatening: bool`
108
109 Harassment content that also includes violence or serious harm towards any target.
110
111 - `hate: bool`
112
113 Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment.
114
115 - `hate_threatening: bool`
116
117 Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste.
118
119 - `illicit: Optional[bool]`
120
121 Content that includes instructions or advice that facilitate the planning or execution of wrongdoing, or that gives advice or instruction on how to commit illicit acts. For example, "how to shoplift" would fit this category.
122
123 - `illicit_violent: Optional[bool]`
124
125 Content that includes instructions or advice that facilitate the planning or execution of wrongdoing that also includes violence, or that gives advice or instruction on the procurement of any weapon.
126
127 - `self_harm: bool`
128
129 Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders.
130
131 - `self_harm_instructions: bool`
132
133 Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts.
134
135 - `self_harm_intent: bool`
136
137 Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders.
138
139 - `sexual: bool`
140
141 Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness).
142
143 - `sexual_minors: bool`
144
145 Sexual content that includes an individual who is under 18 years old.
146
147 - `violence: bool`
148
149 Content that depicts death, violence, or physical injury.
150
151 - `violence_graphic: bool`
152
153 Content that depicts death, violence, or physical injury in graphic detail.
154
155 - `category_applied_input_types: CategoryAppliedInputTypes`
156
157 A list of the categories along with the input type(s) that the score applies to.
158
159 - `harassment: List[Literal["text"]]`
160
161 The applied input type(s) for the category 'harassment'.
162
163 - `"text"`
164
165 - `harassment_threatening: List[Literal["text"]]`
166
167 The applied input type(s) for the category 'harassment/threatening'.
168
169 - `"text"`
170
171 - `hate: List[Literal["text"]]`
172
173 The applied input type(s) for the category 'hate'.
174
175 - `"text"`
176
177 - `hate_threatening: List[Literal["text"]]`
178
179 The applied input type(s) for the category 'hate/threatening'.
180
181 - `"text"`
182
183 - `illicit: List[Literal["text"]]`
184
185 The applied input type(s) for the category 'illicit'.
186
187 - `"text"`
188
189 - `illicit_violent: List[Literal["text"]]`
190
191 The applied input type(s) for the category 'illicit/violent'.
192
193 - `"text"`
194
195 - `self_harm: List[Literal["text", "image"]]`
196
197 The applied input type(s) for the category 'self-harm'.
198
199 - `"text"`
200
201 - `"image"`
202
203 - `self_harm_instructions: List[Literal["text", "image"]]`
204
205 The applied input type(s) for the category 'self-harm/instructions'.
206
207 - `"text"`
208
209 - `"image"`
210
211 - `self_harm_intent: List[Literal["text", "image"]]`
212
213 The applied input type(s) for the category 'self-harm/intent'.
214
215 - `"text"`
216
217 - `"image"`
218
219 - `sexual: List[Literal["text", "image"]]`
220
221 The applied input type(s) for the category 'sexual'.
222
223 - `"text"`
224
225 - `"image"`
226
227 - `sexual_minors: List[Literal["text"]]`
228
229 The applied input type(s) for the category 'sexual/minors'.
230
231 - `"text"`
232
233 - `violence: List[Literal["text", "image"]]`
234
235 The applied input type(s) for the category 'violence'.
236
237 - `"text"`
238
239 - `"image"`
240
241 - `violence_graphic: List[Literal["text", "image"]]`
242
243 The applied input type(s) for the category 'violence/graphic'.
244
245 - `"text"`
246
247 - `"image"`
248
249 - `category_scores: CategoryScores`
250
251 A list of the categories along with their scores as predicted by model.
252
253 - `harassment: float`
254
255 The score for the category 'harassment'.
256
257 - `harassment_threatening: float`
258
259 The score for the category 'harassment/threatening'.
260
261 - `hate: float`
262
263 The score for the category 'hate'.
264
265 - `hate_threatening: float`
266
267 The score for the category 'hate/threatening'.
268
269 - `illicit: float`
270
271 The score for the category 'illicit'.
272
273 - `illicit_violent: float`
274
275 The score for the category 'illicit/violent'.
276
277 - `self_harm: float`
278
279 The score for the category 'self-harm'.
280
281 - `self_harm_instructions: float`
282
283 The score for the category 'self-harm/instructions'.
284
285 - `self_harm_intent: float`
286
287 The score for the category 'self-harm/intent'.
288
289 - `sexual: float`
290
291 The score for the category 'sexual'.
292
293 - `sexual_minors: float`
294
295 The score for the category 'sexual/minors'.
296
297 - `violence: float`
298
299 The score for the category 'violence'.
300
301 - `violence_graphic: float`
302
303 The score for the category 'violence/graphic'.
304
305 - `flagged: bool`
306
307 Whether any of the below categories are flagged.
308
309### Example
310
311```python
312import os
313from openai import OpenAI
314
315client = OpenAI(
316 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
317)
318moderation = client.moderations.create(
319 input="I want to kill them.",
320)
321print(moderation.id)
322```
323
324#### Response
325
326```json
327{
328 "id": "id",
329 "model": "model",
330 "results": [
331 {
332 "categories": {
333 "harassment": true,
334 "harassment/threatening": true,
335 "hate": true,
336 "hate/threatening": true,
337 "illicit": true,
338 "illicit/violent": true,
339 "self-harm": true,
340 "self-harm/instructions": true,
341 "self-harm/intent": true,
342 "sexual": true,
343 "sexual/minors": true,
344 "violence": true,
345 "violence/graphic": true
346 },
347 "category_applied_input_types": {
348 "harassment": [
349 "text"
350 ],
351 "harassment/threatening": [
352 "text"
353 ],
354 "hate": [
355 "text"
356 ],
357 "hate/threatening": [
358 "text"
359 ],
360 "illicit": [
361 "text"
362 ],
363 "illicit/violent": [
364 "text"
365 ],
366 "self-harm": [
367 "text"
368 ],
369 "self-harm/instructions": [
370 "text"
371 ],
372 "self-harm/intent": [
373 "text"
374 ],
375 "sexual": [
376 "text"
377 ],
378 "sexual/minors": [
379 "text"
380 ],
381 "violence": [
382 "text"
383 ],
384 "violence/graphic": [
385 "text"
386 ]
387 },
388 "category_scores": {
389 "harassment": 0,
390 "harassment/threatening": 0,
391 "hate": 0,
392 "hate/threatening": 0,
393 "illicit": 0,
394 "illicit/violent": 0,
395 "self-harm": 0,
396 "self-harm/instructions": 0,
397 "self-harm/intent": 0,
398 "sexual": 0,
399 "sexual/minors": 0,
400 "violence": 0,
401 "violence/graphic": 0
402 },
403 "flagged": true
404 }
405 ]
406}
407```
408
409### Single string
410
411```python
412from openai import OpenAI
413client = OpenAI()
414
415moderation = client.moderations.create(input="I want to kill them.")
416print(moderation)
417```
418
419#### Response
420
421```json
422{
423 "id": "modr-AB8CjOTu2jiq12hp1AQPfeqFWaORR",
424 "model": "text-moderation-007",
425 "results": [
426 {
427 "flagged": true,
428 "categories": {
429 "sexual": false,
430 "hate": false,
431 "harassment": true,
432 "self-harm": false,
433 "sexual/minors": false,
434 "hate/threatening": false,
435 "violence/graphic": false,
436 "self-harm/intent": false,
437 "self-harm/instructions": false,
438 "harassment/threatening": true,
439 "violence": true
440 },
441 "category_scores": {
442 "sexual": 0.000011726012417057063,
443 "hate": 0.22706663608551025,
444 "harassment": 0.5215635299682617,
445 "self-harm": 2.227119921371923e-6,
446 "sexual/minors": 7.107352217872176e-8,
447 "hate/threatening": 0.023547329008579254,
448 "violence/graphic": 0.00003391829886822961,
449 "self-harm/intent": 1.646940972932498e-6,
450 "self-harm/instructions": 1.1198755256458526e-9,
451 "harassment/threatening": 0.5694745779037476,
452 "violence": 0.9971134662628174
453 }
454 }
455 ]
456}
457```
458
459### Image and text
460
461```python
462from openai import OpenAI
463client = OpenAI()
464
465response = client.moderations.create(
466 model="omni-moderation-latest",
467 input=[
468 {"type": "text", "text": "...text to classify goes here..."},
469 {
470 "type": "image_url",
471 "image_url": {
472 "url": "https://example.com/image.png",
473 # can also use base64 encoded image URLs
474 # "url": "data:image/jpeg;base64,abcdefg..."
475 }
476 },
477 ],
478)
479
480print(response)
481```
482
483#### Response
484
485```json
486{
487 "id": "modr-0d9740456c391e43c445bf0f010940c7",
488 "model": "omni-moderation-latest",
489 "results": [
490 {
491 "flagged": true,
492 "categories": {
493 "harassment": true,
494 "harassment/threatening": true,
495 "sexual": false,
496 "hate": false,
497 "hate/threatening": false,
498 "illicit": false,
499 "illicit/violent": false,
500 "self-harm/intent": false,
501 "self-harm/instructions": false,
502 "self-harm": false,
503 "sexual/minors": false,
504 "violence": true,
505 "violence/graphic": true
506 },
507 "category_scores": {
508 "harassment": 0.8189693396524255,
509 "harassment/threatening": 0.804985420696006,
510 "sexual": 1.573112165348997e-6,
511 "hate": 0.007562942636942845,
512 "hate/threatening": 0.004208854591835476,
513 "illicit": 0.030535955153511665,
514 "illicit/violent": 0.008925306722380033,
515 "self-harm/intent": 0.00023023930975076432,
516 "self-harm/instructions": 0.0002293869201073356,
517 "self-harm": 0.012598046106750154,
518 "sexual/minors": 2.212566909570261e-8,
519 "violence": 0.9999992735124786,
520 "violence/graphic": 0.843064871157054
521 },
522 "category_applied_input_types": {
523 "harassment": [
524 "text"
525 ],
526 "harassment/threatening": [
527 "text"
528 ],
529 "sexual": [
530 "text",
531 "image"
532 ],
533 "hate": [
534 "text"
535 ],
536 "hate/threatening": [
537 "text"
538 ],
539 "illicit": [
540 "text"
541 ],
542 "illicit/violent": [
543 "text"
544 ],
545 "self-harm/intent": [
546 "text",
547 "image"
548 ],
549 "self-harm/instructions": [
550 "text",
551 "image"
552 ],
553 "self-harm": [
554 "text",
555 "image"
556 ],
557 "sexual/minors": [
558 "text"
559 ],
560 "violence": [
561 "text",
562 "image"
563 ],
564 "violence/graphic": [
565 "text",
566 "image"
567 ]
568 }
569 }
570 ]
571}
572```
573
574## Domain Types
575
576### Moderation
577
578- `class Moderation: …`
579
580 - `categories: Categories`
581
582 A list of the categories, and whether they are flagged or not.
583
584 - `harassment: bool`
585
586 Content that expresses, incites, or promotes harassing language towards any target.
587
588 - `harassment_threatening: bool`
589
590 Harassment content that also includes violence or serious harm towards any target.
591
592 - `hate: bool`
593
594 Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment.
595
596 - `hate_threatening: bool`
597
598 Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste.
599
600 - `illicit: Optional[bool]`
601
602 Content that includes instructions or advice that facilitate the planning or execution of wrongdoing, or that gives advice or instruction on how to commit illicit acts. For example, "how to shoplift" would fit this category.
603
604 - `illicit_violent: Optional[bool]`
605
606 Content that includes instructions or advice that facilitate the planning or execution of wrongdoing that also includes violence, or that gives advice or instruction on the procurement of any weapon.
607
608 - `self_harm: bool`
609
610 Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders.
611
612 - `self_harm_instructions: bool`
613
614 Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts.
615
616 - `self_harm_intent: bool`
617
618 Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders.
619
620 - `sexual: bool`
621
622 Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness).
623
624 - `sexual_minors: bool`
625
626 Sexual content that includes an individual who is under 18 years old.
627
628 - `violence: bool`
629
630 Content that depicts death, violence, or physical injury.
631
632 - `violence_graphic: bool`
633
634 Content that depicts death, violence, or physical injury in graphic detail.
635
636 - `category_applied_input_types: CategoryAppliedInputTypes`
637
638 A list of the categories along with the input type(s) that the score applies to.
639
640 - `harassment: List[Literal["text"]]`
641
642 The applied input type(s) for the category 'harassment'.
643
644 - `"text"`
645
646 - `harassment_threatening: List[Literal["text"]]`
647
648 The applied input type(s) for the category 'harassment/threatening'.
649
650 - `"text"`
651
652 - `hate: List[Literal["text"]]`
653
654 The applied input type(s) for the category 'hate'.
655
656 - `"text"`
657
658 - `hate_threatening: List[Literal["text"]]`
659
660 The applied input type(s) for the category 'hate/threatening'.
661
662 - `"text"`
663
664 - `illicit: List[Literal["text"]]`
665
666 The applied input type(s) for the category 'illicit'.
667
668 - `"text"`
669
670 - `illicit_violent: List[Literal["text"]]`
671
672 The applied input type(s) for the category 'illicit/violent'.
673
674 - `"text"`
675
676 - `self_harm: List[Literal["text", "image"]]`
677
678 The applied input type(s) for the category 'self-harm'.
679
680 - `"text"`
681
682 - `"image"`
683
684 - `self_harm_instructions: List[Literal["text", "image"]]`
685
686 The applied input type(s) for the category 'self-harm/instructions'.
687
688 - `"text"`
689
690 - `"image"`
691
692 - `self_harm_intent: List[Literal["text", "image"]]`
693
694 The applied input type(s) for the category 'self-harm/intent'.
695
696 - `"text"`
697
698 - `"image"`
699
700 - `sexual: List[Literal["text", "image"]]`
701
702 The applied input type(s) for the category 'sexual'.
703
704 - `"text"`
705
706 - `"image"`
707
708 - `sexual_minors: List[Literal["text"]]`
709
710 The applied input type(s) for the category 'sexual/minors'.
711
712 - `"text"`
713
714 - `violence: List[Literal["text", "image"]]`
715
716 The applied input type(s) for the category 'violence'.
717
718 - `"text"`
719
720 - `"image"`
721
722 - `violence_graphic: List[Literal["text", "image"]]`
723
724 The applied input type(s) for the category 'violence/graphic'.
725
726 - `"text"`
727
728 - `"image"`
729
730 - `category_scores: CategoryScores`
731
732 A list of the categories along with their scores as predicted by model.
733
734 - `harassment: float`
735
736 The score for the category 'harassment'.
737
738 - `harassment_threatening: float`
739
740 The score for the category 'harassment/threatening'.
741
742 - `hate: float`
743
744 The score for the category 'hate'.
745
746 - `hate_threatening: float`
747
748 The score for the category 'hate/threatening'.
749
750 - `illicit: float`
751
752 The score for the category 'illicit'.
753
754 - `illicit_violent: float`
755
756 The score for the category 'illicit/violent'.
757
758 - `self_harm: float`
759
760 The score for the category 'self-harm'.
761
762 - `self_harm_instructions: float`
763
764 The score for the category 'self-harm/instructions'.
765
766 - `self_harm_intent: float`
767
768 The score for the category 'self-harm/intent'.
769
770 - `sexual: float`
771
772 The score for the category 'sexual'.
773
774 - `sexual_minors: float`
775
776 The score for the category 'sexual/minors'.
777
778 - `violence: float`
779
780 The score for the category 'violence'.
781
782 - `violence_graphic: float`
783
784 The score for the category 'violence/graphic'.
785
786 - `flagged: bool`
787
788 Whether any of the below categories are flagged.
789
790### Moderation Image URL Input
791
792- `class ModerationImageURLInput: …`
793
794 An object describing an image to classify.
795
796 - `image_url: ImageURL`
797
798 Contains either an image URL or a data URL for a base64 encoded image.
799
800 - `url: str`
801
802 Either a URL of the image or the base64 encoded image data.
803
804 - `type: Literal["image_url"]`
805
806 Always `image_url`.
807
808 - `"image_url"`
809
810### Moderation Model
811
812- `Literal["omni-moderation-latest", "omni-moderation-2024-09-26", "text-moderation-latest", "text-moderation-stable"]`
813
814 - `"omni-moderation-latest"`
815
816 - `"omni-moderation-2024-09-26"`
817
818 - `"text-moderation-latest"`
819
820 - `"text-moderation-stable"`
821
822### Moderation Multi Modal Input
823
824- `ModerationMultiModalInput`
825
826 An object describing an image to classify.
827
828 - `class ModerationImageURLInput: …`
829
830 An object describing an image to classify.
831
832 - `image_url: ImageURL`
833
834 Contains either an image URL or a data URL for a base64 encoded image.
835
836 - `url: str`
837
838 Either a URL of the image or the base64 encoded image data.
839
840 - `type: Literal["image_url"]`
841
842 Always `image_url`.
843
844 - `"image_url"`
845
846 - `class ModerationTextInput: …`
847
848 An object describing text to classify.
849
850 - `text: str`
851
852 A string of text to classify.
853
854 - `type: Literal["text"]`
855
856 Always `text`.
857
858 - `"text"`
859
860### Moderation Text Input
861
862- `class ModerationTextInput: …`
863
864 An object describing text to classify.
865
866 - `text: str`
867
868 A string of text to classify.
869
870 - `type: Literal["text"]`
871
872 Always `text`.
873
874 - `"text"`
875
876### Moderation Create Response
877
878- `class ModerationCreateResponse: …`
879
880 Represents if a given text input is potentially harmful.
881
882 - `id: str`
883
884 The unique identifier for the moderation request.
885
886 - `model: str`
887
888 The model used to generate the moderation results.
889
890 - `results: List[Moderation]`
891
892 A list of moderation objects.
893
894 - `categories: Categories`
895
896 A list of the categories, and whether they are flagged or not.
897
898 - `harassment: bool`
899
900 Content that expresses, incites, or promotes harassing language towards any target.
901
902 - `harassment_threatening: bool`
903
904 Harassment content that also includes violence or serious harm towards any target.
905
906 - `hate: bool`
907
908 Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment.
909
910 - `hate_threatening: bool`
911
912 Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste.
913
914 - `illicit: Optional[bool]`
915
916 Content that includes instructions or advice that facilitate the planning or execution of wrongdoing, or that gives advice or instruction on how to commit illicit acts. For example, "how to shoplift" would fit this category.
917
918 - `illicit_violent: Optional[bool]`
919
920 Content that includes instructions or advice that facilitate the planning or execution of wrongdoing that also includes violence, or that gives advice or instruction on the procurement of any weapon.
921
922 - `self_harm: bool`
923
924 Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders.
925
926 - `self_harm_instructions: bool`
927
928 Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts.
929
930 - `self_harm_intent: bool`
931
932 Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders.
933
934 - `sexual: bool`
935
936 Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness).
937
938 - `sexual_minors: bool`
939
940 Sexual content that includes an individual who is under 18 years old.
941
942 - `violence: bool`
943
944 Content that depicts death, violence, or physical injury.
945
946 - `violence_graphic: bool`
947
948 Content that depicts death, violence, or physical injury in graphic detail.
949
950 - `category_applied_input_types: CategoryAppliedInputTypes`
951
952 A list of the categories along with the input type(s) that the score applies to.
953
954 - `harassment: List[Literal["text"]]`
955
956 The applied input type(s) for the category 'harassment'.
957
958 - `"text"`
959
960 - `harassment_threatening: List[Literal["text"]]`
961
962 The applied input type(s) for the category 'harassment/threatening'.
963
964 - `"text"`
965
966 - `hate: List[Literal["text"]]`
967
968 The applied input type(s) for the category 'hate'.
969
970 - `"text"`
971
972 - `hate_threatening: List[Literal["text"]]`
973
974 The applied input type(s) for the category 'hate/threatening'.
975
976 - `"text"`
977
978 - `illicit: List[Literal["text"]]`
979
980 The applied input type(s) for the category 'illicit'.
981
982 - `"text"`
983
984 - `illicit_violent: List[Literal["text"]]`
985
986 The applied input type(s) for the category 'illicit/violent'.
987
988 - `"text"`
989
990 - `self_harm: List[Literal["text", "image"]]`
991
992 The applied input type(s) for the category 'self-harm'.
993
994 - `"text"`
995
996 - `"image"`
997
998 - `self_harm_instructions: List[Literal["text", "image"]]`
999
1000 The applied input type(s) for the category 'self-harm/instructions'.
1001
1002 - `"text"`
1003
1004 - `"image"`
1005
1006 - `self_harm_intent: List[Literal["text", "image"]]`
1007
1008 The applied input type(s) for the category 'self-harm/intent'.
1009
1010 - `"text"`
1011
1012 - `"image"`
1013
1014 - `sexual: List[Literal["text", "image"]]`
1015
1016 The applied input type(s) for the category 'sexual'.
1017
1018 - `"text"`
1019
1020 - `"image"`
1021
1022 - `sexual_minors: List[Literal["text"]]`
1023
1024 The applied input type(s) for the category 'sexual/minors'.
1025
1026 - `"text"`
1027
1028 - `violence: List[Literal["text", "image"]]`
1029
1030 The applied input type(s) for the category 'violence'.
1031
1032 - `"text"`
1033
1034 - `"image"`
1035
1036 - `violence_graphic: List[Literal["text", "image"]]`
1037
1038 The applied input type(s) for the category 'violence/graphic'.
1039
1040 - `"text"`
1041
1042 - `"image"`
1043
1044 - `category_scores: CategoryScores`
1045
1046 A list of the categories along with their scores as predicted by model.
1047
1048 - `harassment: float`
1049
1050 The score for the category 'harassment'.
1051
1052 - `harassment_threatening: float`
1053
1054 The score for the category 'harassment/threatening'.
1055
1056 - `hate: float`
1057
1058 The score for the category 'hate'.
1059
1060 - `hate_threatening: float`
1061
1062 The score for the category 'hate/threatening'.
1063
1064 - `illicit: float`
1065
1066 The score for the category 'illicit'.
1067
1068 - `illicit_violent: float`
1069
1070 The score for the category 'illicit/violent'.
1071
1072 - `self_harm: float`
1073
1074 The score for the category 'self-harm'.
1075
1076 - `self_harm_instructions: float`
1077
1078 The score for the category 'self-harm/instructions'.
1079
1080 - `self_harm_intent: float`
1081
1082 The score for the category 'self-harm/intent'.
1083
1084 - `sexual: float`
1085
1086 The score for the category 'sexual'.
1087
1088 - `sexual_minors: float`
1089
1090 The score for the category 'sexual/minors'.
1091
1092 - `violence: float`
1093
1094 The score for the category 'violence'.
1095
1096 - `violence_graphic: float`
1097
1098 The score for the category 'violence/graphic'.
1099
1100 - `flagged: bool`
1101
1102 Whether any of the below categories are flagged.