From c34af085e343cfb29e1712cfd8458e296c64afd2 Mon Sep 17 00:00:00 2001 From: Derek Meegan Date: Thu, 30 Oct 2025 17:30:03 -0700 Subject: [PATCH 1/2] fix ref for python --- packages/docs/v2/basics/agent.mdx | 14 +++++++------- packages/docs/v2/references/agent.mdx | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/docs/v2/basics/agent.mdx b/packages/docs/v2/basics/agent.mdx index cb4cc9966..bdce1c686 100644 --- a/packages/docs/v2/basics/agent.mdx +++ b/packages/docs/v2/basics/agent.mdx @@ -46,14 +46,14 @@ await agent.execute("apply for a job at Browserbase") ``` ```python Python -agent = stagehand.agent({ - "provider": "anthropic", - "model": "claude-sonnet-4-20250514", - "instructions": "You are a helpful assistant that can use a web browser.", - "options": { - "apiKey": os.getenv("ANTHROPIC_API_KEY"), +agent = stagehand.agent( + provider="anthropic", + model="claude-sonnet-4-20250514", + instructions="You are a helpful assistant that can use a web browser.", + options={ + "apiKey": os.getenv("ANTHROPIC_API_KEY"), }, -}) +) await agent.execute("apply for a job at Browserbase") ``` diff --git a/packages/docs/v2/references/agent.mdx b/packages/docs/v2/references/agent.mdx index 823470106..c5e8a4782 100644 --- a/packages/docs/v2/references/agent.mdx +++ b/packages/docs/v2/references/agent.mdx @@ -44,11 +44,11 @@ interface AgentInstance { ```python # Create agent instance -agent = stagehand.agent({ - "model": str, - "instructions": str = None, - "options": Dict[str, Any] = None -}) +agent = stagehand.agent( + model: str, + instructions: str = None, + options: Dict[str, Any] = None +) ``` From 60b028cfd0452e40cac917f1f533a91aa431f171 Mon Sep 17 00:00:00 2001 From: Miguel <36487034+miguelg719@users.noreply.github.com> Date: Thu, 30 Oct 2025 17:42:15 -0700 Subject: [PATCH 2/2] Apply suggestions from code review --- packages/docs/v2/basics/agent.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/docs/v2/basics/agent.mdx b/packages/docs/v2/basics/agent.mdx index bdce1c686..4383fb6f5 100644 --- a/packages/docs/v2/basics/agent.mdx +++ b/packages/docs/v2/basics/agent.mdx @@ -47,11 +47,10 @@ await agent.execute("apply for a job at Browserbase") ```python Python agent = stagehand.agent( - provider="anthropic", model="claude-sonnet-4-20250514", instructions="You are a helpful assistant that can use a web browser.", options={ - "apiKey": os.getenv("ANTHROPIC_API_KEY"), + "api_key": os.getenv("ANTHROPIC_API_KEY"), }, ) await agent.execute("apply for a job at Browserbase")