Skip to content

Commit 8c4610f

Browse files
Support OFF as a threshold value for Safety settings in Vertex AI (#114)
* Safety threshold changes for Verted toswitch OFF * Add OFF for all safety settings --------- Signed-off-by: Gayathri <[email protected]>
1 parent 2d82112 commit 8c4610f

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/unstract/sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.52.1"
1+
__version__ = "0.53.0"
22

33

44
def get_sdk_version():

src/unstract/sdk/adapters/llm/vertex_ai/src/static/json_schema.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
"BLOCK_LOW_AND_ABOVE",
6262
"BLOCK_MEDIUM_AND_ABOVE",
6363
"BLOCK_ONLY_HIGH",
64-
"BLOCK_NONE"
64+
"BLOCK_NONE",
65+
"OFF"
6566
],
6667
"default": "BLOCK_ONLY_HIGH",
6768
"description": "Settings for HARM_CATEGORY_DANGEROUS_CONTENT"
@@ -74,7 +75,8 @@
7475
"BLOCK_LOW_AND_ABOVE",
7576
"BLOCK_MEDIUM_AND_ABOVE",
7677
"BLOCK_ONLY_HIGH",
77-
"BLOCK_NONE"
78+
"BLOCK_NONE",
79+
"OFF"
7880
],
7981
"default": "BLOCK_ONLY_HIGH",
8082
"description": "Settings for HARM_CATEGORY_HATE_SPEECH"
@@ -87,7 +89,8 @@
8789
"BLOCK_LOW_AND_ABOVE",
8890
"BLOCK_MEDIUM_AND_ABOVE",
8991
"BLOCK_ONLY_HIGH",
90-
"BLOCK_NONE"
92+
"BLOCK_NONE",
93+
"OFF"
9194
],
9295
"default": "BLOCK_ONLY_HIGH",
9396
"description": "Settings for HARM_CATEGORY_HARASSMENT"
@@ -100,7 +103,8 @@
100103
"BLOCK_LOW_AND_ABOVE",
101104
"BLOCK_MEDIUM_AND_ABOVE",
102105
"BLOCK_ONLY_HIGH",
103-
"BLOCK_NONE"
106+
"BLOCK_NONE",
107+
"OFF"
104108
],
105109
"default": "BLOCK_ONLY_HIGH",
106110
"description": "Settings for HARM_CATEGORY_SEXUAL_CONTENT"
@@ -113,7 +117,8 @@
113117
"BLOCK_LOW_AND_ABOVE",
114118
"BLOCK_MEDIUM_AND_ABOVE",
115119
"BLOCK_ONLY_HIGH",
116-
"BLOCK_NONE"
120+
"BLOCK_NONE",
121+
"OFF"
117122
],
118123
"default": "BLOCK_ONLY_HIGH",
119124
"description": "Settings for HARM_CATEGORY_OTHER"

src/unstract/sdk/adapters/llm/vertex_ai/src/vertex_ai.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class SafetySettingsConstants:
4545
"BLOCK_MEDIUM_AND_ABOVE": HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
4646
"BLOCK_ONLY_HIGH": HarmBlockThreshold.BLOCK_ONLY_HIGH,
4747
"BLOCK_NONE": HarmBlockThreshold.BLOCK_NONE,
48+
"OFF": HarmBlockThreshold.OFF,
4849
}
4950

5051

0 commit comments

Comments
 (0)