Skip to content

Commit 9bbd6c0

Browse files
authored
Merge branch 'main' into sample/live-part2
2 parents dacada8 + 081678e commit 9bbd6c0

17 files changed

+621
-16
lines changed

genai/test/ctrlgen-with-enum-class-schema.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../controlled-generation/ctrlgen-with-enum-class-schema.js');
22+
const {delay} = require('./util');
2223

2324
describe('ctrlgen-with-enum-class-schema', () => {
2425
it('should generate text content matching enum schema', async function () {
25-
this.timeout(10000);
26+
this.timeout(100000);
27+
this.retries(4);
28+
await delay(this.test);
2629
const output = await sample.generateEnumClassSchema(projectId);
27-
assert(output.length > 0 && output.includes('String'));
30+
assert(output.length > 0);
2831
});
2932
});

genai/test/ctrlgen-with-nullable-schema.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const sample = require('../controlled-generation/ctrlgen-with-nullable-schema.js
2222

2323
describe('ctrlgen-with-nullable-schema', () => {
2424
it('should generate text content using nullable schema', async function () {
25-
this.timeout(10000);
25+
this.timeout(100000);
2626
const output = await sample.generateNullableSchema(projectId);
2727
assert(output.length > 0);
2828
});
24.1 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
const {assert} = require('chai');
18+
const {describe, it} = require('mocha');
19+
20+
const projectId = process.env.CAIP_PROJECT_ID;
21+
const sample = require('../tools/tools-code-exec-with-txt-local-img.js');
22+
23+
describe('tools-code-exec-with-txt-local-img', () => {
24+
it('should generate a function definition', async function () {
25+
this.timeout(100000);
26+
const output = await sample.generateAndExecuteMultimodalCode(projectId);
27+
assert(output.length > 0);
28+
});
29+
});

genai/test/tools-code-exec-with-txt.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('tools-code-exec-with-txt', async () => {
2626
this.timeout(180000);
2727
this.retries(4);
2828
await delay(this.test);
29-
const output = await sample.generateContent(projectId);
29+
const output = await sample.generateAndExecuteCode(projectId);
3030
assert(output.length > 0);
3131
});
3232
});

genai/test/tools-func-desc-with-txt.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ describe('tools-func-desc-with-txt', async () => {
2525
this.timeout(180000);
2626
this.retries(4);
2727
await delay(this.test);
28-
await sample.generateContent(projectId);
28+
await sample.generateFunctionDesc(projectId);
2929
});
3030
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
const {describe, it} = require('mocha');
18+
19+
const projectId = process.env.CAIP_PROJECT_ID;
20+
const sample = require('../tools/tools-google-maps-coordinates-with-txt');
21+
const {delay} = require('./util');
22+
const {assert} = require('chai');
23+
24+
describe('tools-google-maps-coordinates-with-txt', () => {
25+
it('should use google maps coordinates', async function () {
26+
this.timeout(180000);
27+
this.retries(4);
28+
await delay(this.test);
29+
const output = await sample.generateContent(projectId);
30+
assert(output.length > 0);
31+
});
32+
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
const {describe, it} = require('mocha');
18+
19+
const projectId = process.env.CAIP_PROJECT_ID;
20+
const sample = require('../tools/tools-google-search-and-urlcontext-with-txt');
21+
const {delay} = require('./util');
22+
const {assert} = require('chai');
23+
24+
describe('tools-google-search-and-urlcontext-with-txt', () => {
25+
it('should create urlcontext and google search', async function () {
26+
this.timeout(180000);
27+
this.retries(4);
28+
await delay(this.test);
29+
const output = await sample.generateContent(projectId);
30+
assert(output.length > 0);
31+
});
32+
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
const {assert} = require('chai');
18+
const {describe, it} = require('mocha');
19+
20+
const projectId = process.env.CAIP_PROJECT_ID;
21+
const sample = require('../tools/tools-google-search-with-txt.js');
22+
23+
describe('tools-google-search-with-txt', () => {
24+
it('should generate answer to a question in prompt using google search', async function () {
25+
this.timeout(10000);
26+
const output = await sample.generateGoogleSearch(projectId);
27+
assert(output.length > 0);
28+
});
29+
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
const {describe, it} = require('mocha');
18+
19+
const projectId = process.env.CAIP_PROJECT_ID;
20+
const sample = require('../tools/tools-urlcontext-with-txt');
21+
const {delay} = require('./util');
22+
const {assert} = require('chai');
23+
24+
describe('tools-urlcontext-with-txt', () => {
25+
it('should create urlcontext with txt', async function () {
26+
this.timeout(180000);
27+
this.retries(4);
28+
await delay(this.test);
29+
const output = await sample.generateContent(projectId);
30+
assert(output.length > 0);
31+
});
32+
});

0 commit comments

Comments
 (0)