Spaces:
Running
Running
Andy Lee
commited on
Commit
·
39a39cb
1
Parent(s):
b125b21
fix: do not fail silently
Browse files- geo_bot.py +6 -4
geo_bot.py
CHANGED
@@ -200,7 +200,7 @@ class GeoBot:
|
|
200 |
history: List[Dict[str, Any]],
|
201 |
remaining_steps: int,
|
202 |
current_screenshot_b64: str,
|
203 |
-
available_actions:
|
204 |
) -> Optional[Dict[str, Any]]:
|
205 |
"""
|
206 |
Execute a single agent step: generate prompt, get AI decision, return decision.
|
@@ -214,7 +214,7 @@ class GeoBot:
|
|
214 |
prompt = AGENT_PROMPT_TEMPLATE.format(
|
215 |
remaining_steps=remaining_steps,
|
216 |
history_text=history_text,
|
217 |
-
available_actions=
|
218 |
)
|
219 |
|
220 |
try:
|
@@ -308,8 +308,10 @@ class GeoBot:
|
|
308 |
== "GUESS"
|
309 |
):
|
310 |
decision = ai_decision
|
311 |
-
except:
|
312 |
-
|
|
|
|
|
313 |
else:
|
314 |
# Normal step execution
|
315 |
decision = self.execute_agent_step(
|
|
|
200 |
history: List[Dict[str, Any]],
|
201 |
remaining_steps: int,
|
202 |
current_screenshot_b64: str,
|
203 |
+
available_actions: List[str],
|
204 |
) -> Optional[Dict[str, Any]]:
|
205 |
"""
|
206 |
Execute a single agent step: generate prompt, get AI decision, return decision.
|
|
|
214 |
prompt = AGENT_PROMPT_TEMPLATE.format(
|
215 |
remaining_steps=remaining_steps,
|
216 |
history_text=history_text,
|
217 |
+
available_actions=available_actions,
|
218 |
)
|
219 |
|
220 |
try:
|
|
|
308 |
== "GUESS"
|
309 |
):
|
310 |
decision = ai_decision
|
311 |
+
except Exception as e:
|
312 |
+
print(
|
313 |
+
f"\nERROR: An exception occurred during the final GUESS attempt: {e}. Using fallback (0,0).\n"
|
314 |
+
)
|
315 |
else:
|
316 |
# Normal step execution
|
317 |
decision = self.execute_agent_step(
|