You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/agent_example.py
+7-10Lines changed: 7 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,8 @@
36
36
asyncdefmain():
37
37
# Build a unified configuration object for Stagehand
38
38
config=StagehandConfig(
39
-
env="BROWSERBASE",
40
-
# env="LOCAL",
39
+
# env="BROWSERBASE",
40
+
env="LOCAL",
41
41
api_key=os.getenv("BROWSERBASE_API_KEY"),
42
42
project_id=os.getenv("BROWSERBASE_PROJECT_ID"),
43
43
model_name="gpt-4o",
@@ -58,13 +58,6 @@ async def main():
58
58
console.print(
59
59
f"🌐 [white]View your live browser:[/] [url]https://www.browserbase.com/sessions/{stagehand.session_id}[/]"
60
60
)
61
-
62
-
# Define the task for the agent
63
-
execute_options=AgentExecuteOptions(
64
-
instruction="Play a game of 2048",
65
-
max_steps=20,
66
-
auto_screenshot=True,
67
-
)
68
61
69
62
console.print("\n▶️ [highlight] Navigating[/] to Google")
70
63
awaitstagehand.page.goto("https://google.com/")
@@ -76,7 +69,11 @@ async def main():
76
69
instructions="You are a helpful web navigation assistant that helps users find information. You are currently on the following page: google.com. Do not ask follow up questions, the user will trust your judgement.",
0 commit comments