Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to run a regression test on the agent's output.
Agentic AI
assert agent_output == [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Comparing the output to itself instead of the expected result.
Using an undefined variable for comparison.
✗ Incorrect
We compare the agent's output to the expected output to verify correctness.
2fill in blank
mediumComplete the code to log the regression test result.
Agentic AI
logger.[1]('Regression test passed')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using error or warn logging for passing tests.
Using debug which might be too low level.
✗ Incorrect
Logging info level is appropriate for successful test messages.
3fill in blank
hardFix the error in the regression test function call.
Agentic AI
def test_agent(): result = agent.run(input_data) assert result [1] expected_output
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' which checks for inequality.
Using comparison operators like '>=' or '<=' which are not suitable.
✗ Incorrect
The test asserts that the result equals the expected output.
4fill in blank
hardFill both blanks to create a dictionary of test results with agent names and pass status.
Agentic AI
test_results = {agent_name: [1] for agent_name in agents if agents[agent_name].active [2] True} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' in the condition.
Using the agent.run(input_data) without comparison in the dictionary.
✗ Incorrect
We check if each agent's run output equals the expected output and filter agents that are active (== True).
5fill in blank
hardFill all three blanks to filter agents, run tests, and store pass status in a dictionary.
Agentic AI
results = {agent: (output := agent.run(data)) [1] expected for agent, expected in [2] if agent.active == [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' for comparison.
Using keys() instead of items() for iteration.
Checking if agent.active is False instead of True.
✗ Incorrect
We compare output to expected with '==', iterate over items(), and check if agent is active (True).