docs: simplify model config in BROWSERBASE snippets to use string format#1959
docs: simplify model config in BROWSERBASE snippets to use string format#1959chromiebot wants to merge 1 commit into
Conversation
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>
|
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
|
This PR was approved by @miguelg719 and mirrored to #1961. All further discussion should happen on that PR. |
There was a problem hiding this comment.
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 User as Developer Code
participant SDK as Stagehand SDK
participant BB as Browserbase Infrastructure
participant LLM as LLM Provider (Google/OpenAI/Anthropic)
Note over User,LLM: Runtime Model Initialization Flow
User->>SDK: stagehand.agent({ model: "provider/model" })
Note right of User: CHANGED: Model defined as simple string<br/>instead of { modelName, apiKey } object
SDK->>BB: Initialize session with model identifier
Note over BB: NEW: Browserbase resolves LLM API key<br/>internally for supported providers
BB->>LLM: Forward request with internal credentials
LLM-->>BB: LLM Response (Inference/Action)
BB-->>SDK: Return execution results
SDK-->>User: Agent response
Update act.mdx and agent.mdx in the basics section to use the
simplified model string format ("provider/model") instead of the
verbose object format ({ modelName, apiKey }), matching the changes
already applied to best-practices in PR browserbase#1959.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…o use string format (#1961) 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 <!-- This is an auto-generated description by cubic. --> --- ## 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`. <sup>Written for commit 7dc7863. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1961">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> <!-- external-contributor-pr:owned source-pr=1959 source-sha=f55ff5558f2454e9f266b7f29ef0b511bd891b9e claimer=miguelg719 --> --------- Co-authored-by: Chromie Bot <chromie@browserbase.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Chromie <miguel@browserbase.com> Co-authored-by: Miguel <36487034+miguelg719@users.noreply.github.com>
|
The mirrored PR #1961 has been merged into |
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:
why
what changed
test plan
Summary by cubic
Simplified Browserbase examples to use a single "provider/model" string instead of a
{ modelName, apiKey }object. SinceapiKeyis now optional for OpenAI, Google, and Anthropic on Browserbase, the docs are easier to copy and use.Written for commit f55ff55. Summary will update on new commits. Review in cubic