Bird
Raised Fist0
Agentic AIml~10 mins

Why observability is critical for agents in Agentic AI - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Aagent.state
Bagent.run()
Cagent.execute()
Dagent.action
Attempts:
3 left
💡 Hint
Common Mistakes
Using methods like run() or execute() instead of accessing the state.
2fill in blank
medium

Complete 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'
Aagent.input
Bagent.state
Cagent.memory
Dagent.last_action
Attempts:
3 left
💡 Hint
Common Mistakes
Logging the entire state or input instead of the last action.
3fill in blank
hard

Fix 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'
A'accuracy'
Baccuracy
C'loss'
Dloss
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around dictionary keys.
4fill in blank
hard

Fill 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'
Astate
Caction
Devent
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'action' or 'event' instead of 'state' for the value.
5fill in blank
hard

Fill 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'
Aaction_id
Baction
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up keys and values or variable names in the loop.