Challenge - 5 Problems
Agent API Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 conceptual
intermediate2:00remaining
Understanding the role of the 'Planner' in Agent API design
In an agent API design pattern, what is the primary role of the 'Planner' component?
Attempts:
2 left
💻 code output
intermediate2:00remaining
Output of agent action execution with error handling
What will be the output of the following agent API code snippet when the action 'fetch_data' fails?
Agentic_ai
class Agent: def __init__(self): self.actions = {'fetch_data': self.fetch_data} def fetch_data(self): raise Exception('Network error') def execute(self, action_name): try: return self.actions[action_name]() except Exception as e: return f'Error: {e}' agent = Agent() result = agent.execute('fetch_data') print(result)
Attempts:
2 left
❓ model choice
advanced2:00remaining
Choosing the best agent API pattern for dynamic task switching
Which agent API design pattern best supports dynamic switching between multiple tasks based on real-time input?
Attempts:
2 left
❓ hyperparameter
advanced2:00remaining
Impact of 'timeout' hyperparameter in agent API calls
In an agent API design, setting a 'timeout' hyperparameter controls:
Attempts:
2 left
🔧 debug
expert3:00remaining
Debugging unexpected agent response in API design
An agent API is designed to return a JSON response with keys 'status' and 'result'. The following code snippet returns {'status': 'success'} but misses 'result'. What is the likely cause?
def agent_response(data):
if data:
return {'status': 'success'}
else:
return {'status': 'fail', 'result': None}
response = agent_response({'task': 'run'})
print(response)Attempts:
2 left
