Agentic AI - Future of AI Agents
The following agent code has a bug:
What is the bug and how to fix it?
class Agent:
def __init__(self):
self.state = 0
def perceive(self, input):
self.state = input
def act(self):
return self.state * 2
agent = Agent()
agent.perceive(3)
agent.perceive(2)
output = agent.act()What is the bug and how to fix it?
