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
console.print(f"\n[yellow]Created new session:[/] {stagehand.session_id}")
74
+
console.print(
75
+
f"🌐 [white]View your live browser:[/] [url]https://www.browserbase.com/sessions/{stagehand.session_id}[/]"
76
+
)
77
+
78
+
# Configure the agent
79
+
agent_config=AgentConfig(
80
+
provider=AgentProvider.OPENAI,
81
+
model="computer-use-preview",
82
+
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.",
83
+
options={"apiKey": os.getenv("MODEL_API_KEY")}
84
+
)
85
+
86
+
# Define the task for the agent
87
+
execute_options=AgentExecuteOptions(
88
+
instruction="Play a game of 2048",
89
+
max_steps=20,
90
+
auto_screenshot=True,
91
+
)
92
+
93
+
# Navigate to google
94
+
console.print("\n▶️ [highlight] Navigating[/] to Google")
95
+
stagehand.page.goto("https://google.com/")
96
+
console.print("✅ [success]Navigated to Google[/]")
97
+
98
+
console.print("\n▶️ [highlight] Using Agent to perform a task[/]: playing a game of 2048")
0 commit comments