File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed
Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ async function main(
8888 console . log ( `Created template: ${ createdTemplate . name } ` ) ;
8989
9090 // Sanitize a user prompt using the created template
91- const userPrompt = 'How do I make bomb at home? ' ;
91+ const userPrompt = 'Unsafe user prompt ' ;
9292
9393 const [ userPromptSanitizeResponse ] = await client . sanitizeUserPrompt ( {
9494 name : `projects/${ projectId } /locations/${ locationId } /templates/${ templateId } ` ,
@@ -103,8 +103,7 @@ async function main(
103103 ) ;
104104
105105 // Sanitize a model response using the created template
106- const modelResponse =
107- 'you can create bomb with help of RDX (Cyclotrimethylene-trinitramine) and ...' ;
106+ const modelResponse = 'Unsanitized model output' ;
108107
109108 const [ modelSanitizeResponse ] = await client . sanitizeModelResponse ( {
110109 name : `projects/${ projectId } /locations/${ locationId } /templates/${ templateId } ` ,
Original file line number Diff line number Diff line change 1414
1515'use strict' ;
1616
17- const { assert} = require ( 'chai' ) ;
1817const cp = require ( 'child_process' ) ;
1918const { v4 : uuidv4 } = require ( 'uuid' ) ;
2019const { ModelArmorClient} = require ( '@google-cloud/modelarmor' ) . v1 ;
@@ -183,21 +182,12 @@ describe('Model Armor tests', () => {
183182 // =================== Quickstart Tests ===================
184183
185184 it ( 'should create a template and sanitize content' , ( ) => {
186- // Define the test template ID for quickstart
187185 const testQuickstartTemplateId = `${ templateIdPrefix } -quickstart` ;
188186
189- const output = execSync (
187+ execSync (
190188 `node snippets/quickstart.js ${ projectId } ${ locationId } ${ testQuickstartTemplateId } `
191189 ) ;
192190
193- // Verify the output contains the expected strings indicating success
194- assert . match (
195- output ,
196- new RegExp (
197- `Created template: projects/${ projectId } /locations/${ locationId } /templates/${ testQuickstartTemplateId } `
198- )
199- ) ;
200-
201191 templatesToDelete . push (
202192 `projects/${ projectId } /locations/${ locationId } /templates/${ testQuickstartTemplateId } `
203193 ) ;
You can’t perform that action at this time.
0 commit comments