File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515Sample code for updating the model armor folder settings of a folder.
1616"""
1717
18+ # TODO: Update to change rai filter configs using floor setting
19+ # once floor settings API works correctly.
20+
1821from google .cloud import modelarmor_v1
1922
2023
@@ -50,12 +53,7 @@ def update_folder_floor_settings(folder_id: str) -> modelarmor_v1.FloorSetting:
5053 name = floor_settings_name ,
5154 filter_config = modelarmor_v1 .FilterConfig (
5255 rai_settings = modelarmor_v1 .RaiFilterSettings (
53- rai_filters = [
54- modelarmor_v1 .RaiFilterSettings .RaiFilter (
55- filter_type = modelarmor_v1 .RaiFilterType .HATE_SPEECH ,
56- confidence_level = modelarmor_v1 .DetectionConfidenceLevel .HIGH ,
57- )
58- ]
56+ rai_filters = []
5957 ),
6058 ),
6159 enable_floor_setting_enforcement = True ,
Original file line number Diff line number Diff line change 1515Sample code for updating the model armor floor settings of an organization.
1616"""
1717
18+ # TODO: Update to change rai filter configs using floor setting
19+ # once floor settings API works correctly.
20+
1821from google .cloud import modelarmor_v1
1922
2023
@@ -54,12 +57,7 @@ def update_organization_floor_settings(
5457 name = floor_settings_name ,
5558 filter_config = modelarmor_v1 .FilterConfig (
5659 rai_settings = modelarmor_v1 .RaiFilterSettings (
57- rai_filters = [
58- modelarmor_v1 .RaiFilterSettings .RaiFilter (
59- filter_type = modelarmor_v1 .RaiFilterType .HATE_SPEECH ,
60- confidence_level = modelarmor_v1 .DetectionConfidenceLevel .HIGH ,
61- )
62- ]
60+ rai_filters = []
6361 ),
6462 ),
6563 enable_floor_setting_enforcement = True ,
Original file line number Diff line number Diff line change 1515Sample code for updating the model armor project floor settings.
1616"""
1717
18+ # TODO: Update to change rai filter configs using floor setting
19+ # once floor settings API works correctly.
20+
1821from google .cloud import modelarmor_v1
1922
2023
21- def update_project_floor_settings (project_id : str ) -> modelarmor_v1 .FloorSetting :
24+ def update_project_floor_settings (
25+ project_id : str ,
26+ ) -> modelarmor_v1 .FloorSetting :
2227 """Update the floor settings of a project.
2328
2429 Args:
@@ -50,12 +55,7 @@ def update_project_floor_settings(project_id: str) -> modelarmor_v1.FloorSetting
5055 name = floor_settings_name ,
5156 filter_config = modelarmor_v1 .FilterConfig (
5257 rai_settings = modelarmor_v1 .RaiFilterSettings (
53- rai_filters = [
54- modelarmor_v1 .RaiFilterSettings .RaiFilter (
55- filter_type = modelarmor_v1 .RaiFilterType .HATE_SPEECH ,
56- confidence_level = modelarmor_v1 .DetectionConfidenceLevel .HIGH ,
57- )
58- ]
58+ rai_filters = []
5959 ),
6060 ),
6161 enable_floor_setting_enforcement = True ,
You can’t perform that action at this time.
0 commit comments