0
0
Agentic AIml~10 mins

Reflection and self-critique pattern in Agentic AI - Interactive Code Practice

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

Complete the code to initialize the agent's reflection step.

Agentic AI
agent.reflection = [1]()
Drag options to blanks, or click blank then click option'
AReflectionStep
BObservationStep
CActionStep
DCritiqueStep
Attempts:
3 left
💡 Hint
Common Mistakes
Using CritiqueStep instead of ReflectionStep.
Confusing ActionStep with reflection.
Forgetting to initialize the reflection attribute.
2fill in blank
medium

Complete 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'
AReflectionStep
BActionStep
CSelfCritiqueStep
DObservationStep
Attempts:
3 left
💡 Hint
Common Mistakes
Using ReflectionStep instead of SelfCritiqueStep.
Adding ActionStep instead of critique.
Skipping the critique step.
3fill in blank
hard

Fix 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'
ACritiqueStep
BSelfCritiqueStep()
CReflectionStep()
DActionStep()
Attempts:
3 left
💡 Hint
Common Mistakes
Using CritiqueStep without parentheses causes an error.
Passing class name instead of instance.
Using wrong step type.
4fill in blank
hard

Fill 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'
Areflect
Bself_critique
Caction
Dobserve
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.
5fill in blank
hard

Fill 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'
Areflect
Bself_critique
Creflection + ' and ' + critique
Dreflection + critique
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong method names.
Concatenating without spaces or connectors.
Forgetting to call methods with parentheses.