Commit 5fb9785
[Claimed browserbase#1960] chore: update examples (browserbase#1964)
Mirrored from external contributor PR browserbase#1960 after approval by
@miguelg719.
Original author: @chromiebot
Original PR: browserbase#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
<!-- This is an auto-generated description by cubic. -->
---
## 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.
<sup>Written for commit 959d706.
Summary will update on new commits. <a
href="https://cubic.dev/pr/browserbase/stagehand/pull/1964">Review in
cubic</a></sup>
<!-- End of auto-generated description by cubic. -->
<!-- external-contributor-pr:owned source-pr=1960
source-sha=b013423199f609fc744a7f23127511929a1ec0fc claimer=miguelg719
-->
---------
Co-authored-by: Chromie Bot <chromie@browserbase.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: miguel <miguelg71921@gmail.com>
Co-authored-by: Chromie <miguel@browserbase.com>1 parent 5c889df commit 5fb9785
37 files changed
Lines changed: 100 additions & 557 deletions
File tree
- .changeset
- packages
- core/examples
- external_clients
- integrations
- evals
- llm_clients
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
This file was deleted.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
File renamed without changes.
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | | - | |
9 | | - | |
| 6 | + | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
| |||
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
18 | | - | |
| 15 | + | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | | - | |
| 6 | + | |
9 | 7 | | |
10 | | - | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
18 | | - | |
| 15 | + | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments