update docs to add variables + remove zod v3 pin + export tool from s…#1724
update docs to add variables + remove zod v3 pin + export tool from s…#1724
Conversation
|
Greptile SummaryThis PR updates the documentation to reflect recent changes to the codebase, specifically removing the experimental flag requirement for hybrid mode, unpinning zod v3, and updating tool import examples. Key Changes:
Documentation Quality: Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 8431332 |
There was a problem hiding this comment.
1 issue found across 12 files
Confidence score: 4/5
- Only issue is a documentation inconsistency about the source of
tool, so runtime behavior isn’t affected and merge risk looks low - Consider updating the wording to match the new
@browserbasehq/stagehandimport to avoid reader confusion in the docs - Pay close attention to
packages/docs/v3/basics/agent.mdx- text references the old SDK source fortool
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/docs/v3/basics/agent.mdx">
<violation number="1" location="packages/docs/v3/basics/agent.mdx:254">
P2: Documentation inconsistency: The surrounding text says to use the `tool` helper "from the Vercel AI SDK" but the import was updated to `@browserbasehq/stagehand`. Consider updating the text to reflect the new import source (e.g., mention that `tool` is re-exported from stagehand).</violation>
</file>
Architecture diagram
sequenceDiagram
participant Client as User Application
participant SH as Stagehand SDK
participant Val as validateExperimentalFeatures
participant LLM as Language Model (LLM)
participant Browser as Browser Instance
Note over Client,SH: Initialization & Setup
Client->>SH: new Stagehand({ experimental: true/false })
SH-->>Client: instance
Client->>SH: agent({ model: "...", mode: "hybrid" })
Note right of SH: CHANGED: Hybrid mode no longer<br/>requires experimental: true
Note over Client,Browser: Agent Execution with Variables
Client->>SH: execute({ instruction, variables: { key: { value, description } } })
SH->>Val: validate(options)
alt NEW: variables provided AND experimental: false
Val-->>Client: Throw ExperimentalNotConfiguredError
else Validation Success
Val-->>SH: proceed
end
SH->>SH: Construct System Prompt
Note right of SH: NEW: Prompt includes variable<br/>NAMES and DESCRIPTIONS only
SH->>LLM: Fetch completion (Prompt + Instruction)
LLM-->>SH: Return tool call (e.g. act("%password%"))
alt NEW: Tool call contains %variable%
SH->>SH: CHANGED: Substitute placeholder with ACTUAL value
end
SH->>Browser: Execute action (e.g. type "secret_password")
Browser-->>SH: Action Result
SH-->>Client: AgentResult (Logs exclude sensitive values)
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…tagehand
why
Update docs to reflect current code base
what changed
test plan
ran mintlify dev and looked at docs
Summary by cubic
Updated docs to add agent variables and clarify how they work (secure runtime substitution with names/descriptions only), switch tool imports to Stagehand, and remove outdated zod v3 and hybrid mode experimental notes. Examples and references are simpler and consistent.
New Features
Refactors
import { tool } from "ai"withimport { tool } from "@browserbasehq/stagehand".import { z } from "zod".Written for commit 1d72c14. Summary will update on new commits. Review in cubic