Agentic AI - Production Agent Architecture
What will be the output of this code snippet?
class Agent:
def __init__(self):
self.state = 0
def act(self):
self.state += 1
if self.state > 2:
raise RuntimeError('Too high')
def recover(self):
self.state = 0
print('Reset')
def run(self):
try:
self.act()
except RuntimeError:
self.recover()
agent = Agent()
for _ in range(3):
agent.run()
