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 99
1010from 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
2313custom_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 ),
Original file line number Diff line number Diff line change 99
1010from 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
2313configure_logging (
2414 level = logging .INFO ,
@@ -44,7 +34,7 @@ def create_panel(content, **kwargs):
4434load_dotenv ()
4535
4636console .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
5545console .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 ),
You can’t perform that action at this time.
0 commit comments