0
0
Prompt Engineering / GenAIml~10 mins

Agent architecture (observe, think, act) in Prompt Engineering / GenAI - Interactive Code Practice

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

Complete the code to make the agent observe its environment.

Prompt Engineering / GenAI
observation = environment.[1]()
Drag options to blanks, or click blank then click option'
Aobserve
Bact
Cthink
Ddecide
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'act' instead of 'observe' to get information.
2fill in blank
medium

Complete the code to make the agent think and decide the next action.

Prompt Engineering / GenAI
action = agent.[1](observation)
Drag options to blanks, or click blank then click option'
Aobserve
Bmove
Cthink
Dact
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'act' instead of 'think' to decide the next step.
3fill in blank
hard

Fix the error in the code to make the agent perform the action.

Prompt Engineering / GenAI
environment.[1](action)
Drag options to blanks, or click blank then click option'
Athink
Bact
Cobserve
Ddecide
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'think' or 'observe' instead of 'act' to perform actions.
4fill in blank
hard

Fill both blanks to complete the agent's main loop for observe and act.

Prompt Engineering / GenAI
while True:
    observation = environment.[1]()
    action = agent.[2](observation)
Drag options to blanks, or click blank then click option'
Aobserve
Bthink
Cact
Ddecide
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of observe and think methods.
5fill in blank
hard

Fill all three blanks to complete the agent's full cycle: observe, think, and act.

Prompt Engineering / GenAI
while True:
    observation = environment.[1]()
    action = agent.[2](observation)
    environment.[3](action)
Drag options to blanks, or click blank then click option'
Aobserve
Bthink
Cact
Ddecide
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of observe, think, and act.