Skip to content

Commit 1b2a2b8

Browse files
committed
try import change
1 parent 4b44369 commit 1b2a2b8

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

ai-platform/snippets/test/batch-prediction-gemini.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
'use strict';
1818

19-
const {assert} = require('chai');
20-
const {after, describe, it} = require('mocha');
21-
const cp = require('child_process');
22-
const {JobServiceClient} = require('@google-cloud/aiplatform');
19+
import { assert } from 'chai';
20+
import { after, describe, it } from 'mocha';
21+
import { execSync as _execSync } from 'child_process';
22+
import { JobServiceClient } from '@google-cloud/aiplatform';
2323

24-
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
24+
const execSync = cmd => _execSync(cmd, {encoding: 'utf-8'});
2525

2626
describe('Batch predict with Gemini', async () => {
2727
const projectId = process.env.CAIP_PROJECT_ID;

ai-platform/snippets/test/create-batch-prediction-job-text-classification.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616

1717
'use strict';
1818

19-
const {assert} = require('chai');
20-
const {after, describe, it} = require('mocha');
21-
const uuid = require('uuid').v4;
22-
const cp = require('child_process');
23-
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
19+
import { assert } from 'chai';
20+
import { after, describe, it } from 'mocha';
21+
import { v4 as uuid } from 'uuid';
22+
import { execSync as _execSync } from 'child_process';
23+
const execSync = cmd => _execSync(cmd, {encoding: 'utf-8'});
2424

25-
const aiplatform = require('@google-cloud/aiplatform');
25+
import { v1 } from '@google-cloud/aiplatform';
2626
const clientOptions = {
2727
apiEndpoint: 'us-central1-aiplatform.googleapis.com',
2828
};
2929

30-
const jobServiceClient = new aiplatform.v1.JobServiceClient(clientOptions);
30+
const jobServiceClient = new v1.JobServiceClient(clientOptions);
3131

3232
const batchPredictionDisplayName = `temp_create_batch_prediction_text_classification_test${uuid()}`;
3333
const modelId = '7827432074230366208';

0 commit comments

Comments
 (0)