Skip to content

Commit ac43e5a

Browse files
Merge branch 'main' into fm/stg-489-add-regression-tests
2 parents 5214c1a + 426df10 commit ac43e5a

29 files changed

+732
-106
lines changed

.changeset/daffy-rapid-turaco.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stagehand": patch
3+
---
4+
5+
Fix parsing schema for extract with no arguments (full page extract)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stagehand": patch
3+
---
4+
5+
Add support for claude 4 sonnet in agent & remove all images but the last two from anthropic cua client
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stagehand": patch
3+
---
4+
5+
Fix error in press_key act util function

.github/workflows/changesets.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
cat pr-description.md >> $GITHUB_ENV
7070
echo "EOF" >> $GITHUB_ENV
7171
rm pr-description.md
72+
env:
73+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7274

7375
- name: Bump versions
7476
if: steps.check_changesets.outputs.has_changesets == 'true'

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Stagehand Python Changelog
22

3+
## 0.4.1
4+
5+
### Patch Changes
6+
7+
[#146](https://github.com/browserbase/stagehand-python/pull/146) [`d0983da`](https://github.com/browserbase/stagehand-python/commit/d0983da) Thanks @miguelg719 and @the-roaring! - Pass sdk version number to API for debugging
8+
[#145](https://github.com/browserbase/stagehand-python/pull/145) [`0732268`](https://github.com/browserbase/stagehand-python/commit/0732268) Thanks @filip-michalsky! - relaxed rich to 13.7.0
9+
[#152](https://github.com/browserbase/stagehand-python/pull/152) [`f888d81`](https://github.com/browserbase/stagehand-python/commit/f888d81) Thanks @filip-michalsky! - simple event loop timeout for strict event loops for async playwright (which has blocking start)
10+
[#140](https://github.com/browserbase/stagehand-python/pull/140) [`5e70c8d`](https://github.com/browserbase/stagehand-python/commit/5e70c8d) Thanks @Zach10za! - Add support for handling OS-level dropdowns
11+
312
## 0.4.0
413

514
### Minor Changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async def main():
128128
api_key=os.getenv("BROWSERBASE_API_KEY"),
129129
project_id=os.getenv("BROWSERBASE_PROJECT_ID"),
130130
model_name="google/gemini-2.5-flash-preview-05-20",
131-
model_client_options={"apiKey": os.getenv("MODEL_API_KEY")},
131+
model_api_key=os.getenv("MODEL_API_KEY"),
132132
)
133133

134134
stagehand = Stagehand(config)

examples/agent_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async def main():
100100
# Add a fancy header
101101
console.print(
102102
"\n",
103-
Panel.fit(
103+
Panel(
104104
"[light_gray]Stagehand 🤘 Agent Example[/]",
105105
border_style="green",
106106
padding=(1, 10),

examples/example.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from rich.panel import Panel
88
from rich.theme import Theme
99

10-
from stagehand import Stagehand, StagehandConfig
11-
from stagehand.utils import configure_logging
10+
from stagehand import Stagehand, StagehandConfig, configure_logging
1211

1312
# Configure logging with cleaner format
1413
configure_logging(
@@ -35,7 +34,7 @@
3534
load_dotenv()
3635

3736
console.print(
38-
Panel.fit(
37+
Panel(
3938
"[yellow]Logging Levels:[/]\n"
4039
"[white]- Set [bold]verbose=0[/] for errors (ERROR)[/]\n"
4140
"[white]- Set [bold]verbose=1[/] for minimal logs (INFO)[/]\n"
@@ -127,7 +126,7 @@ async def main():
127126
# Add a fancy header
128127
console.print(
129128
"\n",
130-
Panel.fit(
129+
Panel(
131130
"[light_gray]Stagehand 🤘 Python Example[/]",
132131
border_style="green",
133132
padding=(1, 10),

format

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Define source directories (adjust as needed)
4+
SOURCE_DIRS="stagehand"
5+
6+
# Apply Black formatting first
7+
echo "Applying Black formatting..."
8+
black $SOURCE_DIRS
9+
10+
# Apply Ruff with autofix for all issues (including import sorting)
11+
echo "Applying Ruff autofixes (including import sorting)..."
12+
ruff check --fix $SOURCE_DIRS
13+
14+
echo "Checking for remaining issues..."
15+
ruff check $SOURCE_DIRS
16+
17+
echo "Done! Code has been formatted and linted."

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "stagehand"
7-
version = "0.4.0"
7+
version = "0.4.1"
88
description = "Python SDK for Stagehand"
99
readme = "README.md"
1010
classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent",]
1111
requires-python = ">=3.9"
12-
dependencies = [ "httpx>=0.24.0", "python-dotenv>=1.0.0", "pydantic>=1.10.0", "playwright>=1.42.1", "requests>=2.31.0", "browserbase>=1.4.0", "rich>=14.0.0", "openai>=1.83.0", "anthropic>=0.51.0", "litellm>=1.72.0",]
12+
dependencies = [ "httpx>=0.24.0", "python-dotenv>=1.0.0", "pydantic>=1.10.0", "playwright>=1.42.1", "requests>=2.31.0", "browserbase>=1.4.0", "rich>=13.7.0", "openai>=1.83.0", "anthropic>=0.51.0", "litellm>=1.72.0",]
1313
[[project.authors]]
1414
name = "Browserbase, Inc."
1515

0 commit comments

Comments
 (0)