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
f"The self-driving car is at step {env.step_count}. "
943
-
f"It's currently moving at {env.agents[0].speed:.1f} m/s with a heading of {env.agents[0].heading:.1f} degrees. "
944
-
f"The chosen action is to '{DISCRETE_ACTIONS[actions_np[0]]}'.\n\n"
945
-
"The policy model's decision was influenced by these top features, with their contribution to the decision shown as a percentage:\n"
946
-
)
947
-
forfintop_features:
948
-
prompt+=f"- {f['feature']} ({f['percentage']:.0f}%): Current Value = {f['value']:.2f}\n"
949
-
950
-
prompt+="\nBased on this context, provide a concise, one-sentence explanation for why the car chose this action. For example: 'The car is accelerating because it's on a straight path with no immediate obstacles.' or 'The car is turning left to correct its heading towards the next waypoint.'"
951
-
952
-
explanation_json=get_json(
953
-
prompt,
954
-
name="format_explanation",
955
-
description="Formats the explanation into a structured JSON object.",
956
-
properties={"explanation": {"type": "string"}},
957
-
use_local=USE_LOCAL_OLLAMA,
958
-
)
959
-
explanation=explanation_json.get("explanation", "Could not generate explanation.")
0 commit comments