@@ -35,7 +35,7 @@ async function main(projectId, locationId, templateId, labelKey, labelValue) {
3535 // const labelValue = 'production';
3636
3737 const parent = `projects/${ projectId } /locations/${ locationId } ` ;
38-
38+
3939 // Imports the Model Armor library
4040 const modelarmor = require ( '@google-cloud/modelarmor' ) ;
4141 const { ModelArmorClient} = modelarmor . v1 ;
@@ -45,7 +45,7 @@ async function main(projectId, locationId, templateId, labelKey, labelValue) {
4545 const client = new ModelArmorClient ( {
4646 apiEndpoint : `modelarmor.${ locationId } .rep.googleapis.com` ,
4747 } ) ;
48-
48+
4949 async function callCreateTemplateWithLabels ( ) {
5050 // Construct the request with template configuration and labels
5151 const request = {
@@ -56,12 +56,19 @@ async function main(projectId, locationId, templateId, labelKey, labelValue) {
5656 raiSettings : {
5757 raiFilters : [
5858 {
59- filterType : protos . google . cloud . modelarmor . v1 . RaiFilterType . HATE_SPEECH ,
60- confidenceLevel : protos . google . cloud . modelarmor . v1 . DetectionConfidenceLevel . HIGH ,
59+ filterType :
60+ protos . google . cloud . modelarmor . v1 . RaiFilterType . HATE_SPEECH ,
61+ confidenceLevel :
62+ protos . google . cloud . modelarmor . v1 . DetectionConfidenceLevel
63+ . HIGH ,
6164 } ,
6265 {
63- filterType : protos . google . cloud . modelarmor . v1 . RaiFilterType . SEXUALLY_EXPLICIT ,
64- confidenceLevel : protos . google . cloud . modelarmor . v1 . DetectionConfidenceLevel . MEDIUM_AND_ABOVE ,
66+ filterType :
67+ protos . google . cloud . modelarmor . v1 . RaiFilterType
68+ . SEXUALLY_EXPLICIT ,
69+ confidenceLevel :
70+ protos . google . cloud . modelarmor . v1 . DetectionConfidenceLevel
71+ . MEDIUM_AND_ABOVE ,
6572 } ,
6673 ] ,
6774 } ,
@@ -82,4 +89,4 @@ async function main(projectId, locationId, templateId, labelKey, labelValue) {
8289}
8390
8491const args = process . argv . slice ( 2 ) ;
85- main ( ...args ) . catch ( console . error ) ;
92+ main ( ...args ) . catch ( console . error ) ;
0 commit comments