Skip to content

Commit

Permalink
Support OFF as a threshold value for Safety settings in Vertex AI (#114)
Browse files Browse the repository at this point in the history
* Safety threshold changes for Verted toswitch OFF

* Add OFF for all safety settings

---------

Signed-off-by: Gayathri <[email protected]>
  • Loading branch information
gaya3-zipstack authored Nov 11, 2024
1 parent 2d82112 commit 8c4610f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/unstract/sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.52.1"
__version__ = "0.53.0"


def get_sdk_version():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"BLOCK_LOW_AND_ABOVE",
"BLOCK_MEDIUM_AND_ABOVE",
"BLOCK_ONLY_HIGH",
"BLOCK_NONE"
"BLOCK_NONE",
"OFF"
],
"default": "BLOCK_ONLY_HIGH",
"description": "Settings for HARM_CATEGORY_DANGEROUS_CONTENT"
Expand All @@ -74,7 +75,8 @@
"BLOCK_LOW_AND_ABOVE",
"BLOCK_MEDIUM_AND_ABOVE",
"BLOCK_ONLY_HIGH",
"BLOCK_NONE"
"BLOCK_NONE",
"OFF"
],
"default": "BLOCK_ONLY_HIGH",
"description": "Settings for HARM_CATEGORY_HATE_SPEECH"
Expand All @@ -87,7 +89,8 @@
"BLOCK_LOW_AND_ABOVE",
"BLOCK_MEDIUM_AND_ABOVE",
"BLOCK_ONLY_HIGH",
"BLOCK_NONE"
"BLOCK_NONE",
"OFF"
],
"default": "BLOCK_ONLY_HIGH",
"description": "Settings for HARM_CATEGORY_HARASSMENT"
Expand All @@ -100,7 +103,8 @@
"BLOCK_LOW_AND_ABOVE",
"BLOCK_MEDIUM_AND_ABOVE",
"BLOCK_ONLY_HIGH",
"BLOCK_NONE"
"BLOCK_NONE",
"OFF"
],
"default": "BLOCK_ONLY_HIGH",
"description": "Settings for HARM_CATEGORY_SEXUAL_CONTENT"
Expand All @@ -113,7 +117,8 @@
"BLOCK_LOW_AND_ABOVE",
"BLOCK_MEDIUM_AND_ABOVE",
"BLOCK_ONLY_HIGH",
"BLOCK_NONE"
"BLOCK_NONE",
"OFF"
],
"default": "BLOCK_ONLY_HIGH",
"description": "Settings for HARM_CATEGORY_OTHER"
Expand Down
1 change: 1 addition & 0 deletions src/unstract/sdk/adapters/llm/vertex_ai/src/vertex_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class SafetySettingsConstants:
"BLOCK_MEDIUM_AND_ABOVE": HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
"BLOCK_ONLY_HIGH": HarmBlockThreshold.BLOCK_ONLY_HIGH,
"BLOCK_NONE": HarmBlockThreshold.BLOCK_NONE,
"OFF": HarmBlockThreshold.OFF,
}


Expand Down

0 comments on commit 8c4610f

Please sign in to comment.