Created
February 26, 2025 00:19
-
-
Save JosXa/0c78ef6e956bb9f27c16a88a9680e960 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "@johnlindquist/kit" | |
import { Stagehand } from "@browserbasehq/stagehand" | |
metadata = { | |
name: "Stagehand Tests", | |
} | |
const key = await env("STAGEHAND_OPENAPI_API_KEY", { hint: "OpenAPI API Key" }) | |
const stagehand = new Stagehand({ | |
apiKey: key, | |
env: "LOCAL", | |
modelName: "gpt-4o", | |
}) | |
await stagehand.init() | |
await hide() | |
const page = stagehand.page | |
await stagehand.page.goto("https://johnlindquist.github.io/kit-docs/") | |
await page.act("Go to the scriptlets page") | |
const answer = await page.extract("What does the `edit` directive do in scriptlets?") | |
await div(answer.extraction) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment