Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the main framework module for agent development.
Agentic AI
import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing unrelated modules like 'random' or 'os' instead of the framework.
✗ Incorrect
The main framework module for agent development is 'agent_framework', which provides tools to build agents quickly.
2fill in blank
mediumComplete the code to create a new agent instance using the framework.
Agentic AI
agent = [1].Agent() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated modules like 'random' or 'os' to create an agent.
✗ Incorrect
To create an agent, you call the Agent class from the 'agent_framework' module.
3fill in blank
hardFix the error in the code to run the agent's main loop.
Agentic AI
agent.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' or 'execute' which are not valid methods for the agent.
✗ Incorrect
The correct method to run the agent's main loop is 'run()'.
4fill in blank
hardFill both blanks to define a simple agent behavior function and assign it.
Agentic AI
def behavior([1]): return [2] agent.behavior = behavior
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect parameter names or returning wrong values.
✗ Incorrect
The function takes 'input_data' and returns the string 'action_taken' as the agent's behavior.
5fill in blank
hardFill all three blanks to create a dictionary mapping agent states to actions with a condition.
Agentic AI
actions = [1]: [2] for [3] in states if [3] != 'idle'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'states' as loop variable or missing the dictionary start brace.
✗ Incorrect
The dictionary comprehension uses '{state' as the start, 'move' as the action, and 'state' as the loop variable.