File tree Expand file tree Collapse file tree 2 files changed +4
-24
lines changed Expand file tree Collapse file tree 2 files changed +4
-24
lines changed Original file line number Diff line number Diff line change 9
9
10
10
from stagehand import Stagehand , StagehandConfig , configure_logging
11
11
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
-
22
12
# Create a custom theme for consistent styling
23
13
custom_theme = Theme (
24
14
{
@@ -110,7 +100,7 @@ async def main():
110
100
# Add a fancy header
111
101
console .print (
112
102
"\n " ,
113
- create_panel (
103
+ Panel (
114
104
"[light_gray]Stagehand 🤘 Agent Example[/]" ,
115
105
border_style = "green" ,
116
106
padding = (1 , 10 ),
Original file line number Diff line number Diff line change 9
9
10
10
from stagehand import Stagehand , StagehandConfig , configure_logging
11
11
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
-
22
12
# Configure logging with cleaner format
23
13
configure_logging (
24
14
level = logging .INFO ,
@@ -44,7 +34,7 @@ def create_panel(content, **kwargs):
44
34
load_dotenv ()
45
35
46
36
console .print (
47
- create_panel (
37
+ Panel (
48
38
"[yellow]Stagehand Python SDK Example[/]\n "
49
39
"[white]This example demonstrates basic Stagehand functionality.[/]" ,
50
40
title = "Welcome" ,
@@ -53,7 +43,7 @@ def create_panel(content, **kwargs):
53
43
)
54
44
55
45
console .print (
56
- create_panel (
46
+ Panel (
57
47
"[yellow]Logging Levels:[/]\n "
58
48
"[white]- Set [bold]verbose=0[/] for errors (ERROR)[/]\n "
59
49
"[white]- Set [bold]verbose=1[/] for minimal logs (INFO)[/]\n "
@@ -145,7 +135,7 @@ async def main():
145
135
# Add a fancy header
146
136
console .print (
147
137
"\n " ,
148
- create_panel (
138
+ Panel (
149
139
"[light_gray]Stagehand 🤘 Python Example[/]" ,
150
140
border_style = "green" ,
151
141
padding = (1 , 10 ),
You can’t perform that action at this time.
0 commit comments