|
15 | 15 | },
|
16 | 16 | "functions": [
|
17 | 17 | {
|
18 |
| - "name": "Detect PII", |
19 |
| - "id": "pii", |
20 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
| 18 | + "name": "Moderate Content", |
| 19 | + "id": "moderateContent", |
21 | 20 | "type": "guardrail",
|
| 21 | + "supportedHooks": ["beforeRequestHook"], |
22 | 22 | "description": [
|
23 | 23 | {
|
24 | 24 | "type": "subHeading",
|
25 |
| - "text": "Content that requests, shares, or attempts to elicit personal identifying information such as full names, addresses, phone numbers, social security numbers, or financial account details." |
| 25 | + "text": "Checks if the content passes the mentioned content moderation checks." |
26 | 26 | }
|
27 | 27 | ],
|
28 |
| - "parameters": {} |
29 |
| - }, |
30 |
| - { |
31 |
| - "name": "Detect Sexual Content", |
32 |
| - "id": "sexual", |
33 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
34 |
| - "type": "guardrail", |
35 |
| - "description": [ |
36 |
| - { |
37 |
| - "type": "subHeading", |
38 |
| - "text": "Material that explicitly depicts, describes, or promotes sexual activities, nudity, or sexual services. This includes pornographic content, graphic descriptions of sexual acts, and solicitation for sexual purposes. Educational or medical content about sexual health presented in a non-explicit, informational context is generally exempted." |
39 |
| - } |
40 |
| - ], |
41 |
| - "parameters": {} |
42 |
| - }, |
43 |
| - { |
44 |
| - "name": "Detect Hate & Discrimination", |
45 |
| - "id": "hate_and_discrimination", |
46 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
47 |
| - "type": "guardrail", |
48 |
| - "description": [ |
49 |
| - { |
50 |
| - "type": "subHeading", |
51 |
| - "text": "Content that expresses prejudice, hostility, or advocates discrimination against individuals or groups based on protected characteristics such as race, ethnicity, religion, gender, sexual orientation, or disability. This includes slurs, dehumanizing language, calls for exclusion or harm targeted at specific groups, and persistent harassment or bullying of individuals based on these characteristics." |
52 |
| - } |
53 |
| - ], |
54 |
| - "parameters": {} |
55 |
| - }, |
56 |
| - { |
57 |
| - "name": "Detect Violent & Thereat", |
58 |
| - "id": "violence_and_threats", |
59 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
60 |
| - "type": "guardrail", |
61 |
| - "description": [ |
62 |
| - { |
63 |
| - "type": "subHeading", |
64 |
| - "text": "Content that describes, glorifies, incites, or threatens physical violence against individuals or groups. This includes graphic depictions of injury or death, explicit threats of harm, and instructions for carrying out violent acts. This category covers both targeted threats and general promotion or glorification of violence." |
65 |
| - } |
66 |
| - ], |
67 |
| - "parameters": {} |
68 |
| - }, |
69 |
| - { |
70 |
| - "name": "Detect Dangerous & Criminal Content", |
71 |
| - "id": "dangerous_and_criminal_content", |
72 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
73 |
| - "type": "guardrail", |
74 |
| - "description": [ |
75 |
| - { |
76 |
| - "type": "subHeading", |
77 |
| - "text": "Content that promotes or provides instructions for illegal activities or extremely hazardous behaviors that pose a significant risk of physical harm, death, or legal consequences. This includes guidance on creating weapons or explosives, encouragement of extreme risk-taking behaviors, and promotion of non-violent crimes such as fraud, theft, or drug trafficking." |
78 |
| - } |
79 |
| - ], |
80 |
| - "parameters": {} |
81 |
| - }, |
82 |
| - { |
83 |
| - "name": "Detect Selfharm", |
84 |
| - "id": "selfharm", |
85 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
86 |
| - "type": "guardrail", |
87 |
| - "description": [ |
88 |
| - { |
89 |
| - "type": "subHeading", |
90 |
| - "text": "Content that promotes, instructs, plans, or encourages deliberate self-injury, suicide, eating disorders, or other self-destructive behaviors. This includes detailed methods, glorification, statements of intent, dangerous challenges, and related slang terms" |
91 |
| - } |
92 |
| - ], |
93 |
| - "parameters": {} |
94 |
| - }, |
95 |
| - { |
96 |
| - "name": "Detect Health", |
97 |
| - "id": "health", |
98 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
99 |
| - "type": "guardrail", |
100 |
| - "description": [ |
101 |
| - { |
102 |
| - "type": "subHeading", |
103 |
| - "text": "Content that contains or tries to elicit detailed or tailored medical advice." |
104 |
| - } |
105 |
| - ], |
106 |
| - "parameters": {} |
107 |
| - }, |
108 |
| - { |
109 |
| - "name": "Detect Finance", |
110 |
| - "id": "financial", |
111 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
112 |
| - "type": "guardrail", |
113 |
| - "description": [ |
114 |
| - { |
115 |
| - "type": "subHeading", |
116 |
| - "text": "Content that contains or tries to elicit detailed or tailored financial advice." |
117 |
| - } |
118 |
| - ], |
119 |
| - "parameters": {} |
120 |
| - }, |
121 |
| - { |
122 |
| - "name": "Detect Law", |
123 |
| - "id": "law", |
124 |
| - "supportedHooks": ["beforeRequestHook", "afterRequestHook"], |
125 |
| - "type": "guardrail", |
126 |
| - "description": [ |
127 |
| - { |
128 |
| - "type": "subHeading", |
129 |
| - "text": "Content that contains or tries to elicit detailed or tailored legal advice." |
130 |
| - } |
131 |
| - ], |
132 |
| - "parameters": {} |
| 28 | + "parameters": { |
| 29 | + "type": "object", |
| 30 | + "properties": { |
| 31 | + "categories": { |
| 32 | + "type": "array", |
| 33 | + "label": "Moderation Checks", |
| 34 | + "description": [ |
| 35 | + { |
| 36 | + "type": "subHeading", |
| 37 | + "text": "Select the categories that should NOT be allowed in the content. (Checked via OpenAI moderation API)" |
| 38 | + } |
| 39 | + ], |
| 40 | + "items": { |
| 41 | + "type": "string", |
| 42 | + "enum": [ |
| 43 | + "sexual", |
| 44 | + "hate_and_discrimination", |
| 45 | + "violence_and_threats", |
| 46 | + "dangerous_and_criminal_content", |
| 47 | + "selfharm", |
| 48 | + "health", |
| 49 | + "financial", |
| 50 | + "law", |
| 51 | + "pii" |
| 52 | + ], |
| 53 | + "default": [ |
| 54 | + "hate/threatening", |
| 55 | + "harassment/threatening", |
| 56 | + "self-harm/intent", |
| 57 | + "self-harm/instructions", |
| 58 | + "sexual/minors", |
| 59 | + "violence/graphic" |
| 60 | + ] |
| 61 | + } |
| 62 | + } |
| 63 | + }, |
| 64 | + "required": ["categories"] |
| 65 | + } |
133 | 66 | }
|
134 | 67 | ]
|
135 | 68 | }
|
0 commit comments