1. Learn
  2. /
  3. Courses
  4. /
  5. AI Agents with Hugging Face smolagents

Connected

Exercise

Game Time: Run the Full Agent

Your basketball coaching agent is almost ready to hit the court. You've written a callback function to show the step number and token usage.

Now it's time to assemble everything: you'll configure a CodeAgent that uses that callback.

You already have access to:

  • A basketball_tool that enables the agent to search scouting reports
  • A model variable with your language model
  • A callback function: action_callback

Your goal is to finish wiring up the agent.

Instructions

100 XP
  • Import the ActionStep class so it can be used to register the action callback.
  • Register the action_callback function for the ActionStep class so the agent shows its actions while executing.