Skip to content

[Claimed #1959] docs: simplify model config in BROWSERBASE snippets to use string format#1961

Merged
miguelg719 merged 3 commits into
mainfrom
external-contributor-pr-1959
Apr 6, 2026
Merged

[Claimed #1959] docs: simplify model config in BROWSERBASE snippets to use string format#1961
miguelg719 merged 3 commits into
mainfrom
external-contributor-pr-1959

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 6, 2026

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

Original author: @chromiebot
Original PR: #1959
Approved source head SHA: f55ff5558f2454e9f266b7f29ef0b511bd891b9e

@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

When using Browserbase, apiKey is now optional for openai/google/anthropic providers. Replace model object { modelName, apiKey } with simple string format "provider/model" to reduce friction in docs examples.

Updated files:

  • best-practices/caching.mdx (1 instance)
  • best-practices/deployments.mdx (1 instance)
  • best-practices/deterministic-agent.mdx (4 instances)

why

what changed

test plan


Summary by cubic

Switch Browserbase docs snippets to use a single provider/model string for model config, replacing the { modelName, apiKey } object and omitting apiKey where it’s optional for OpenAI, Google, and Anthropic.
Updated examples across Basics (act, agent) and Best Practices (caching, deployments, deterministic-agent), including refreshed Google model IDs like google/gemini-3-flash-preview and google/gemini-2.5-flash.

Written for commit 7dc7863. Summary will update on new commits. Review in cubic

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. labels Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented Apr 6, 2026

This mirrored PR has been merged into main. The original external PR #1959 is now completed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 6, 2026

⚠️ No Changeset found

Latest commit: 7dc7863

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented Apr 6, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
stagehand 🟢 Ready View Preview Apr 6, 2026, 4:30 AM

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant App as User Application
    participant SDK as Stagehand SDK
    participant BB as Browserbase Platform
    participant LLM as LLM Provider (Google/OpenAI/Anthropic)

    Note over App,LLM: Model Configuration & Execution Flow

    App->>SDK: CHANGED: stagehand.agent({ model: "provider/model" })
    Note right of App: No longer requires explicit apiKey object

    SDK->>SDK: Parse provider and modelName from string

    App->>SDK: agent.act({ task: "..." })
    
    SDK->>BB: Initialize Session / Execute Action
    Note right of SDK: Passes model string to Browserbase

    BB->>BB: Resolve LLM Credentials
    
    alt NEW: API Key not provided by client
        BB->>BB: Use Browserbase Managed API Keys
    else API Key provided in config
        BB->>BB: Use Client-provided API Key
    end

    BB->>LLM: Request Inference (model, prompt)
    LLM-->>BB: Response (actions/text)
    BB-->>SDK: Action result
    SDK-->>App: Task completed
Loading

When using Browserbase, apiKey is now optional for openai/google/anthropic
providers. Replace model object `{ modelName, apiKey }` with simple string
format `"provider/model"` to reduce friction in docs examples.

Updated files:
- best-practices/caching.mdx (1 instance)
- best-practices/deployments.mdx (1 instance)
- best-practices/deterministic-agent.mdx (4 instances)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# why

# what changed

# test plan


<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Update Basics docs to use the simple model string format
("provider/model") in code snippets for `act` and `agent`, replacing the
verbose `{ modelName, apiKey }` form. Aligns these pages with our
best-practices examples; no behavior changes.

<sup>Written for commit 00ff1cc.
Summary will update on new commits. <a
href="https://cubic.dev/pr/browserbase/stagehand/pull/1962">Review in
cubic</a></sup>

<!-- End of auto-generated description by cubic. -->

Co-authored-by: Chromie Bot <chromie@browserbase.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread packages/docs/v3/basics/agent.mdx Outdated
Comment thread packages/docs/v3/best-practices/caching.mdx Outdated
Comment thread packages/docs/v3/best-practices/deterministic-agent.mdx Outdated
Comment thread packages/docs/v3/best-practices/deterministic-agent.mdx Outdated
Comment thread packages/docs/v3/best-practices/deterministic-agent.mdx Outdated
Comment thread packages/docs/v3/best-practices/deterministic-agent.mdx Outdated
Co-authored-by: Miguel <36487034+miguelg719@users.noreply.github.com>
@miguelg719 miguelg719 merged commit 70208b3 into main Apr 6, 2026
9 checks passed
@github-actions github-actions Bot added external-contributor:completed The mirrored PR has been merged and the external contributor flow is complete. and removed external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:completed The mirrored PR has been merged and the external contributor flow is complete. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants