Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to initialize the agent's reflection step.
Agentic AI
agent.reflection = [1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using CritiqueStep instead of ReflectionStep.
Confusing ActionStep with reflection.
Forgetting to initialize the reflection attribute.
✗ Incorrect
The ReflectionStep class is used to enable the agent to reflect on its actions and outcomes.
2fill in blank
mediumComplete the code to add a self-critique after the agent's action.
Agentic AI
agent.add_step([1]()) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ReflectionStep instead of SelfCritiqueStep.
Adding ActionStep instead of critique.
Skipping the critique step.
✗ Incorrect
SelfCritiqueStep is the step where the agent evaluates its own previous action to improve.
3fill in blank
hardFix the error in the code to correctly perform reflection and critique.
Agentic AI
result = agent.perform_step([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using CritiqueStep without parentheses causes an error.
Passing class name instead of instance.
Using wrong step type.
✗ Incorrect
SelfCritiqueStep() must be instantiated with parentheses to create an object before performing the step.
4fill in blank
hardFill both blanks to create a dictionary that stores reflection and critique results.
Agentic AI
results = {
'reflection': agent.[1](),
'critique': agent.[2]()
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'action' or 'observe' methods instead of reflection or critique.
Mixing up the method names.
Forgetting parentheses to call methods.
✗ Incorrect
The agent.reflect() method returns reflection results, and agent.self_critique() returns critique results.
5fill in blank
hardFill all three blanks to define a function that runs reflection, critique, and returns combined feedback.
Agentic AI
def run_feedback(agent): reflection = agent.[1]() critique = agent.[2]() return {'reflection': reflection, 'critique': critique, 'summary': [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong method names.
Concatenating without spaces or connectors.
Forgetting to call methods with parentheses.
✗ Incorrect
The function calls reflect() and self_critique(), then combines their strings with ' and ' for a readable summary.