[Claimed #1960] chore: update examples

Merged
GI
8mo ago
+100-557

Mirrored from external contributor PR #1960 after approval by @miguelg719.

Original author: @chromiebot
Original PR: https://github.com/browserbase/stagehand/pull/1960
Approved source head SHA: b013423199f609fc744a7f23127511929a1ec0fc

@chromiebot, please continue any follow-up discussion on this mirrored PR. When the external PR gets new commits, this same internal PR will be marked stale until the latest external commit is approved and refreshed here.

Original description

why

Examples were quite stale

what changed

Overhaul of examples/ and minor cleanups

test plan


Summary by cubic

Standardizes non-CUA examples to use model strings with built-in API key resolution. Updates the MCP demo to the current agent API, replaces deprecated OpenAI model names, and removes dead eval/client code to reduce boilerplate.

  • Refactors
    • Switched examples to model strings (e.g., openai/gpt-5) without inline API keys when env: "BROWSERBASE"; kept a LOCAL override in parameterize-api-key.ts using gpt-4.1-mini.
    • Updated mcp.ts to current agent API: connectToMCPServer, mode: "hybrid", model anthropic/claude-sonnet-4-6, and a systemPrompt.
    • Replaced deprecated OpenAI models in custom-client examples: gpt-4o → gpt-4.1, gpt-4o-mini → gpt-4.1-mini; replaced V3 with Stagehand in v3-example.ts and v3-agent.ts, and fixed imports to ../lib/v3/*.
    • Removed dead code (examples external_clients/*, evals llm_clients and category, examples/CHANGELOG.md, examples/tsconfig.json) and added a patch changeset.