Skip to content

Commit cccbbcd

Browse files
remove panel function
1 parent 121af77 commit cccbbcd

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

examples/agent_example.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@
99

1010
from stagehand import Stagehand, StagehandConfig, configure_logging
1111

12-
# Compatibility function for Panel.fit (available in Rich >= 14.0.0)
13-
def create_panel(content, **kwargs):
14-
"""Create a panel with fallback for older Rich versions."""
15-
try:
16-
# Try to use Panel.fit if available
17-
return Panel.fit(content, **kwargs)
18-
except AttributeError:
19-
# Fallback to regular Panel for older Rich versions
20-
return Panel(content, **kwargs)
21-
2212
# Create a custom theme for consistent styling
2313
custom_theme = Theme(
2414
{
@@ -110,7 +100,7 @@ async def main():
110100
# Add a fancy header
111101
console.print(
112102
"\n",
113-
create_panel(
103+
Panel(
114104
"[light_gray]Stagehand 🤘 Agent Example[/]",
115105
border_style="green",
116106
padding=(1, 10),

examples/example.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@
99

1010
from stagehand import Stagehand, StagehandConfig, configure_logging
1111

12-
# Compatibility function for Panel.fit (available in Rich >= 14.0.0)
13-
def create_panel(content, **kwargs):
14-
"""Create a panel with fallback for older Rich versions."""
15-
try:
16-
# Try to use Panel.fit if available
17-
return Panel.fit(content, **kwargs)
18-
except AttributeError:
19-
# Fallback to regular Panel for older Rich versions
20-
return Panel(content, **kwargs)
21-
2212
# Configure logging with cleaner format
2313
configure_logging(
2414
level=logging.INFO,
@@ -44,7 +34,7 @@ def create_panel(content, **kwargs):
4434
load_dotenv()
4535

4636
console.print(
47-
create_panel(
37+
Panel(
4838
"[yellow]Stagehand Python SDK Example[/]\n"
4939
"[white]This example demonstrates basic Stagehand functionality.[/]",
5040
title="Welcome",
@@ -53,7 +43,7 @@ def create_panel(content, **kwargs):
5343
)
5444

5545
console.print(
56-
create_panel(
46+
Panel(
5747
"[yellow]Logging Levels:[/]\n"
5848
"[white]- Set [bold]verbose=0[/] for errors (ERROR)[/]\n"
5949
"[white]- Set [bold]verbose=1[/] for minimal logs (INFO)[/]\n"
@@ -145,7 +135,7 @@ async def main():
145135
# Add a fancy header
146136
console.print(
147137
"\n",
148-
create_panel(
138+
Panel(
149139
"[light_gray]Stagehand 🤘 Python Example[/]",
150140
border_style="green",
151141
padding=(1, 10),

0 commit comments

Comments
 (0)