Skip to content

Commit da33c5a

Browse files
fix ref for python (#1210)
# why the python ref is wrong, using object input instead of kwargs # what changed fix the python ref to use kwargs # test plan its docs --------- Co-authored-by: Miguel <36487034+miguelg719@users.noreply.github.com>
1 parent 30d0a24 commit da33c5a

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

packages/docs/v2/basics/agent.mdx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@ await agent.execute("apply for a job at Browserbase")
4646
```
4747

4848
```python Python
49-
agent = stagehand.agent({
50-
"provider": "anthropic",
51-
"model": "claude-sonnet-4-20250514",
52-
"instructions": "You are a helpful assistant that can use a web browser.",
53-
"options": {
54-
"apiKey": os.getenv("ANTHROPIC_API_KEY"),
49+
agent = stagehand.agent(
50+
model="claude-sonnet-4-20250514",
51+
instructions="You are a helpful assistant that can use a web browser.",
52+
options={
53+
"api_key": os.getenv("ANTHROPIC_API_KEY"),
5554
},
56-
})
55+
)
5756
await agent.execute("apply for a job at Browserbase")
5857
```
5958
</CodeGroup>

packages/docs/v2/references/agent.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ interface AgentInstance {
4444

4545
```python
4646
# Create agent instance
47-
agent = stagehand.agent({
48-
"model": str,
49-
"instructions": str = None,
50-
"options": Dict[str, Any] = None
51-
})
47+
agent = stagehand.agent(
48+
model: str,
49+
instructions: str = None,
50+
options: Dict[str, Any] = None
51+
)
5252
```
5353

5454
</Tab>

0 commit comments

Comments
 (0)