Complete the code to print the agent's current state for observability.
print('Agent state:', [1])
The agent's current state is stored in agent.state. Printing it helps observe what the agent is doing.
Complete the code to log the agent's decision for observability.
log_entry = {'decision': [1]
logger.log(log_entry)The agent's last decision or action is stored in agent.last_action. Logging it helps track decisions.
Fix the error in the code to correctly track the agent's performance metric.
performance = agent.metrics.get([1], 0)
Dictionary keys must be strings in quotes. Using 'accuracy' correctly accesses the metric.
Fill both blanks to create a dictionary comprehension that records agent states with timestamps.
state_log = {timestamp: [1] for timestamp, [2] in agent.history.items()}The dictionary comprehension maps each timestamp to the corresponding state from the agent's history.
Fill all three blanks to filter and store agent actions with confidence above threshold.
filtered_actions = [1]: [2] for [3], [2] in agent.actions.items() if [2]['confidence'] > 0.8}
The comprehension uses action_id as keys and action as values, iterating over action_id, action pairs.
