feat(gemini): 新增模型切换与状态检测功能

This commit is contained in:
WJZ_P
2026-03-17 01:34:19 +08:00
parent 394a589a24
commit db102ae3eb
3 changed files with 262 additions and 50 deletions

View File

@@ -18,6 +18,8 @@ import { execSync } from 'node:child_process';
import { platform } from 'node:os';
import { createGeminiSession, disconnect } from './index.js';
const prompt = 'Hello Gemini!';
// ── Demo 专用:杀掉所有 Chromium 系浏览器进程 ──
function killAllBrowserProcesses() {
const os = platform();
@@ -111,7 +113,7 @@ async function main() {
// 3. 发送一句话
console.log('\n[3] 发送提示词...');
const result = await ops.sendAndWait('Hello Gemini!', {
const result = await ops.sendAndWait(prompt, {
timeout: 60_000,
onPoll(poll) {
console.log(` polling... status=${poll.status}`);