豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/eval_gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ async function runSingleScenario(
name: request.name,
args: (request.arguments as Record<string, unknown>) || {},
});
return originalCallTool(request, schema);
const response = await originalCallTool(request, schema);
debugLog(`Tool response: ${JSON.stringify(response)}`);
return response;
};

const ai = new GoogleGenAI({apiKey});
Expand Down
40 changes: 40 additions & 0 deletions scripts/eval_scenarios/select_page_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import assert from 'node:assert';

import type {TestScenario} from '../eval_gemini.ts';

export const scenario: TestScenario = {
prompt:
'Open new page <TEST_URL> and then open new page https://developers.chrome.com. Select the <TEST_URL> page.',
maxTurns: 3,
htmlRoute: {
path: '/test.html',
htmlContent: `
<h1>test</h1>
`,
},
expectations: calls => {
assert.strictEqual(calls.length, 3);
assert.ok(calls[0].name === 'new_page', 'First call should be navigation');
assert.ok(calls[1].name === 'new_page', 'Second call should be navigation');
assert.ok(
calls[2].name === 'select_page',
'Third call should be select_page',
);
assert.strictEqual(
calls[2].args.pageId,
2,
'PageId has to be set to 2. about:blank is 1, <TEST_URL> is 2, https://developers.chrome.com is 3.',
);
assert.strictEqual(
calls[2].args.bringToFront,
undefined,
'bringToFront should use the default value.',
);
},
};