Skip to content

Commit a109a10

Browse files
authored
refactor: improve the reliability of the demo app (#2424)
1 parent e16ea2f commit a109a10

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

gemini/computer-use/web-agent/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ It is highly recommended to use a virtual environment to manage project dependen
3232
* On macOS and Linux:
3333

3434
```bash
35-
python -m venv venv
36-
source venv/bin/activate
35+
python -m venv .venv
36+
source .venv/bin/activate
3737
**3. Install Python Dependencies**
3838

3939
Install the required Python libraries from the requirements.txt file.

gemini/computer-use/web-agent/web_agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def execute_function_calls(
110110
# --- THE AGENT LOOP ---
111111

112112

113-
async def agent_loop(initial_prompt: str, max_turns: int = 5) -> None:
113+
async def agent_loop(initial_prompt: str, max_turns: int = 10) -> None:
114114
"""Main agent loop for local execution with a browser."""
115115
if not PROJECT_ID:
116116
raise ValueError("GOOGLE_PROJECT_ID environment variable not set.")
@@ -125,6 +125,7 @@ async def agent_loop(initial_prompt: str, max_turns: int = 5) -> None:
125125
page = await browser.new_page()
126126
sw, sh = 960, 1080
127127
await page.set_viewport_size({"width": sw, "height": sh})
128+
await page.goto("https://www.google.com")
128129

129130
print(f"🎬 Starting Agent Loop with prompt: '{initial_prompt}'")
130131
# ... (rest of the loop is fine and remains the same) ...

0 commit comments

Comments
 (0)