airworkx commited on
Commit
80bd48c
1 Parent(s): d9032bc

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +15 -9
utils.py CHANGED
@@ -1,28 +1,34 @@
1
- """https://ai.google.dev/api/rest/v1beta/HarmCategory"""
2
-
3
- SAFETY_SETTINGS = [
4
  {
5
  "category": "HARM_CATEGORY_SEXUAL",
6
- "threshold": "BLOCK_NONE",
7
  },
8
  {
9
  "category": "HARM_CATEGORY_DANGEROUS",
10
- "threshold": "BLOCK_NONE",
11
  },
12
  {
13
  "category": "HARM_CATEGORY_HARASSMENT",
14
- "threshold": "BLOCK_NONE",
15
  },
16
  {
17
  "category": "HARM_CATEGORY_HATE_SPEECH",
18
- "threshold": "BLOCK_NONE",
19
  },
20
  {
21
  "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
22
- "threshold": "BLOCK_NONE",
23
  },
24
  {
25
  "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
26
- "threshold": "BLOCK_NONE",
27
  },
28
  ]
 
 
 
 
 
 
 
 
1
+ # Original code
2
+ SAFETY_SETTTINGS = [
 
3
  {
4
  "category": "HARM_CATEGORY_SEXUAL",
5
+ "threshold": "BLOCK_ONLY_HIGH",
6
  },
7
  {
8
  "category": "HARM_CATEGORY_DANGEROUS",
9
+ "threshold": "BLOCK_ONLY_HIGH",
10
  },
11
  {
12
  "category": "HARM_CATEGORY_HARASSMENT",
13
+ "threshold": "BLOCK_ONLY_HIGH",
14
  },
15
  {
16
  "category": "HARM_CATEGORY_HATE_SPEECH",
17
+ "threshold": "BLOCK_ONLY_HIGH",
18
  },
19
  {
20
  "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
21
+ "threshold": "BLOCK_ONLY_HIGH",
22
  },
23
  {
24
  "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
25
+ "threshold": "BLOCK_ONLY_HIGH",
26
  },
27
  ]
28
+
29
+ # Modified code to allow uninterrupted chat session
30
+ MODIFIED_SAFETY_SETTTINGS = []
31
+
32
+ # Set all thresholds to "ALLOW_ALL" to disable blocking
33
+ for setting in MODIFIED_SAFETY_SETTTINGS:
34
+ setting["threshold"] = "ALLOW_ALL"