import "dotenv/config";
import { createOpenRouter } from '@openrouter/ai-sdk-provider'
import { AISdkClient, Stagehand } from '@browserbasehq/stagehand';
async function main() {
console.log('OPENROUTER_API_KEY:', process.env.OPENROUTER_API_KEY ? '已设置' : '未设置');
const openrouter = createOpenRouter({
apiKey: process.env.OPENROUTER_API_KEY,
});
const providerClient = new AISdkClient({
model: openrouter("google/gemini-2.5-flash"),
});
const stagehand = new Stagehand({
env: "LOCAL",
llmClient: providerClient,
});
await stagehand.init();