Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to print the agent's current state for observability.
Agentic_ai
print('Agent state:', [1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to log the agent's decision for observability.
Agentic_ai
log_entry = {'decision': [1]
logger.log(log_entry) Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to correctly track the agent's performance metric.
Agentic_ai
performance = agent.metrics.get([1], 0)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to create a dictionary comprehension that records agent states with timestamps.
Agentic_ai
state_log = {timestamp: [1] for timestamp, [2] in agent.history.items()} Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to filter and store agent actions with confidence above threshold.
Agentic_ai
filtered_actions = [1]: [2] for [3], [2] in agent.actions.items() if [2]['confidence'] > 0.8}
Drag options to blanks, or click blank then click option'
Attempts:
3 left
