0
0
Agentic AIml~10 mins

How agents differ from chatbots 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 a simple chatbot response function.

Agentic AI
def chatbot_response(user_input):
    return "Hello! You said: " + user_input[1]
Drag options to blanks, or click blank then click option'
A-
B/
C*
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using arithmetic operators like - or * instead of + for strings.
2fill in blank
medium

Complete the code to add a simple agent action method that decides what to do based on input.

Agentic AI
class Agent:
    def decide_action(self, observation):
        if observation == 'greet':
            return 'say_hello'
        else:
            return [1]
Drag options to blanks, or click blank then click option'
A'wait'
B'do_nothing'
C'say_hello'
D'ignore'
Attempts:
3 left
💡 Hint
Common Mistakes
Returning the same action for all inputs, which ignores the condition.
3fill in blank
hard

Fix the error in the agent's method that should update its internal state.

Agentic AI
class Agent:
    def __init__(self):
        self.state = 0
    def update_state(self, observation):
        self.state = self.state [1] 1
Drag options to blanks, or click blank then click option'
A+
B-
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using subtraction or multiplication which changes the state incorrectly.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps observations to actions only if the observation is 'task'.

Agentic AI
actions = {obs: 'execute' for obs in observations if obs [1] [2]
Drag options to blanks, or click blank then click option'
A==
B'task'
C'greet'
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' which would select the wrong observations.
5fill in blank
hard

Fill all three blanks to create a function that returns a dictionary of agent decisions for each input observation if the observation length is greater than 3.

Agentic AI
def agent_decisions(observations):
    return {obs[1]: 'act' for obs in observations if len(obs) [2] [3]
Drag options to blanks, or click blank then click option'
A.upper()
B>
C3
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' which filters the wrong observations.