// For Computer Use Agent (CUA) modelsconst agent = stagehand.agent({ provider: "openai", model: "computer-use-preview", instructions: "You are a helpful assistant that can use a web browser.", options: { apiKey: process.env.OPENAI_API_KEY, },});// You can define additional options like max_steps and auto_screenshotawait agent.execute({ instruction="Sign me up for a library card", max_steps=20,})
# For Computer Use Agent (CUA) modelsagent = stagehand.agent({ model="computer-use-preview", instructions="You are a helpful assistant that can use a web browser.", options={ "apiKey": os.getenv("OPENAI_API_KEY"), },})# You can define additional options like max_steps and auto_screenshotresult = await agent.execute({ instruction="Sign me up for a library card", max_steps=20})