Spaces:
Running
Running
Commit
·
1300289
1
Parent(s):
f1d54eb
fix guess
Browse files
app.py
CHANGED
|
@@ -255,15 +255,7 @@ if start_button:
|
|
| 255 |
)
|
| 256 |
|
| 257 |
# Force guess on last step or get AI decision
|
| 258 |
-
if
|
| 259 |
-
action = "GUESS"
|
| 260 |
-
st.warning("Max steps reached. Forcing GUESS.")
|
| 261 |
-
# Create a forced decision for consistency
|
| 262 |
-
decision = {
|
| 263 |
-
"reasoning": "Maximum steps reached, forcing final guess with fallback coordinates.",
|
| 264 |
-
"action_details": {"action": "GUESS", "lat": 0.0, "lon": 0.0}
|
| 265 |
-
}
|
| 266 |
-
else:
|
| 267 |
# Use the bot's agent step execution
|
| 268 |
remaining_steps = steps_per_sample - step
|
| 269 |
decision = bot.execute_agent_step(
|
|
@@ -273,18 +265,18 @@ if start_button:
|
|
| 273 |
if decision is None:
|
| 274 |
raise ValueError("Failed to get AI decision")
|
| 275 |
|
| 276 |
-
|
| 277 |
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
|
| 282 |
-
|
| 283 |
-
|
| 284 |
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
|
| 289 |
# Add step to history using the bot's method
|
| 290 |
bot.add_step_to_history(history, current_screenshot_b64, decision)
|
|
|
|
| 255 |
)
|
| 256 |
|
| 257 |
# Force guess on last step or get AI decision
|
| 258 |
+
if action != "GUESS":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
# Use the bot's agent step execution
|
| 260 |
remaining_steps = steps_per_sample - step
|
| 261 |
decision = bot.execute_agent_step(
|
|
|
|
| 265 |
if decision is None:
|
| 266 |
raise ValueError("Failed to get AI decision")
|
| 267 |
|
| 268 |
+
action = decision["action_details"]["action"]
|
| 269 |
|
| 270 |
+
# Show AI decision
|
| 271 |
+
st.write("**AI Reasoning:**")
|
| 272 |
+
st.info(decision.get("reasoning", "N/A"))
|
| 273 |
|
| 274 |
+
st.write("**AI Action:**")
|
| 275 |
+
st.success(f"`{action}`")
|
| 276 |
|
| 277 |
+
# Show raw response for debugging
|
| 278 |
+
with st.expander("Decision Details"):
|
| 279 |
+
st.json(decision)
|
| 280 |
|
| 281 |
# Add step to history using the bot's method
|
| 282 |
bot.add_step_to_history(history, current_screenshot_b64, decision)
|