Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to assign the role of an agent.
Agentic AI
agent.role = '[1]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'specialist' when the agent needs to handle multiple tasks.
Using 'executor' which is more about action than role definition.
✗ Incorrect
The agent is assigned the role 'generalist' to handle a broad range of tasks.
2fill in blank
mediumComplete the code to define an agent's specialization.
Agentic AI
agent.specialization = '[1]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'all_tasks' which implies no specialization.
Selecting 'communication' when the focus is on data.
✗ Incorrect
The agent specializes in 'data_analysis' to focus on processing and interpreting data.
3fill in blank
hardFix the error in the code to correctly assign an agent's role.
Agentic AI
agent.role = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning role without quotes causing a NameError.
Using double quotes inconsistently.
✗ Incorrect
The role must be assigned as a string with quotes, so 'specialist' is correct.
4fill in blank
hardFill both blanks to create a dictionary mapping agent roles to their specializations.
Agentic AI
role_specialization = {'[1]': 'data_analysis', '[2]': 'navigation'} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing roles and specializations incorrectly.
Using 'generalist' for a specific specialization.
✗ Incorrect
The 'specialist' role maps to 'data_analysis' and 'executor' maps to 'navigation'.
5fill in blank
hardFill all three blanks to create a function that assigns roles and specializations to agents.
Agentic AI
def assign_agent(agent, role, specialization): agent.[1] = role agent.[2] = specialization return agent.[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing attribute names for role and specialization.
Returning the wrong attribute.
✗ Incorrect
The function sets the agent's role and specialization, then returns the role.