safety.py
Source: sunholo/vertex/safety.py
Functions
genai_safety(threshold: str = 'BLOCK_ONLY_HIGH')
BLOCK_ONLY_HIGH - block when high probability of unsafe content is detected BLOCK_MEDIUM_AND_ABOVE - block when medium or high probability of content is detected BLOCK_LOW_AND_ABOVE - block when low, medium, or high probability of unsafe content is detected BLOCK_NONE - no block, but need to be on an allow list to use
vertex_safety(threshold: str = 'BLOCK_ONLY_HIGH')
BLOCK_ONLY_HIGH - block when high probability of unsafe content is detected BLOCK_MEDIUM_AND_ABOVE - block when medium or high probability of content is detected BLOCK_LOW_AND_ABOVE - block when low, medium, or high probability of unsafe content is detected BLOCK_NONE - no block, but need to be on an allow list to use