0
0
Agentic AIml~10 mins

Autonomous vs semi-autonomous agents in Agentic AI - Interactive Practice

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

Complete the code to define an autonomous agent class with a method to act independently.

Agentic AI
class AutonomousAgent:
    def __init__(self, name):
        self.name = name

    def [1](self):
        return f"{self.name} is acting on its own decisions."
Drag options to blanks, or click blank then click option'
Aact
Bdecide
Crun
Dmove
Attempts:
3 left
💡 Hint
Common Mistakes
Using method names that don't clearly indicate action like 'run' or 'move'.
2fill in blank
medium

Complete the code to add a semi-autonomous agent method that requires human input.

Agentic AI
class SemiAutonomousAgent:
    def __init__(self, name):
        self.name = name

    def [1](self, command):
        return f"{self.name} executes command: {command}"
Drag options to blanks, or click blank then click option'
Aact
Bdecide
Cexecute
Dperform
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'act' which implies independent action rather than following commands.
3fill in blank
hard

Fix the error in the code to correctly check if an agent is autonomous.

Agentic AI
def is_autonomous(agent):
    if agent.[1] == 'act':
        return True
    else:
        return False
Drag options to blanks, or click blank then click option'
Aaction
Bact
Cexecute
Dperform
Attempts:
3 left
💡 Hint
Common Mistakes
Using attribute names that don't exist like 'action' or 'perform'.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps agent names to their action methods.

Agentic AI
agents = [autonomous_agent, semi_autonomous_agent]
actions = {agent.[1]: agent.[2] for agent in agents}
Drag options to blanks, or click blank then click option'
Aname
Bact
Cexecute
Dperform
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'execute' for all agents which is only for semi-autonomous.
5fill in blank
hard

Fill all three blanks to define a function that calls the correct method based on agent type.

Agentic AI
def perform_action(agent, command=None):
    if hasattr(agent, '[1]'):
        return agent.[1]()
    elif hasattr(agent, '[2]') and command is not None:
        return agent.[2]([3])
Drag options to blanks, or click blank then click option'
Aact
Bexecute
Ccommand
Dperform
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'perform' which is not defined in the classes.