1. Aprender
  2. /
  3. Cursos
  4. /
  5. AI Agents with Hugging Face smolagents

Connected

Exercício

One Prompt, Many Tools

You've already created two tools for AgentsCafé:

  • generate_order_id: produces a timestamped ID like T5_Latte_20250812_0915
  • lookup_orders: reads orders.csv and returns a list of drinks for that table

Now let's create an agent that uses those two tools. So, for any table, the agent can fetch its orders and assign a unique ID to each drink.

Note: The model, tools and necessary imports have already been defined for you. A sample orders.csv is uploaded as well.

Instruções

100 XP
  • Create a coding agent using your previously defined lookup_orders and generate_order_id tools.
  • Add pandas to the list of authorized imports to ensure the agent can read the CSV.
  • Use the agent's .run() method to process a task that fetches orders for a table and assigns IDs.