Agents IA avec Hugging Face smolagents
Adel Nehme
VP of AI Curriculum, DataCamp






Clavardoirs :
Agents :
Cycle d'un agent :


Tout ça à partir d'une seule invite !

Prend en charge deux types d'agents :
ToolCallingAgent : utilise des appels de fonctions structurésCodeAgent : écrit et exécute du code Python
Action 1: {"tool": "search_company", "company": "Competitor A"}
Action 2: {"tool": "get_pricing", "company": "Competitor A", "plan": "Basic"}
Action 3: {"tool": "get_pricing", "company": "Competitor A", "plan": "Pro"}
Action 4: {"tool": "search_company", "company": "Competitor B"}
Action 5: {"tool": "get_pricing", "company": "Competitor B", "plan": "Basic"}
competitors = ["Competitor A", "Competitor B", "Competitor C"]
pricing_data = {}
for company in competitors:
company_info = search_company(company)
plans = extract_pricing_plans(company_info)
pricing_data[company] = plans
most_affordable_option = min(pricing_data,
key=lambda x: pricing_data[x]['basic_plan'])
Des recherches montrent un taux de réussite d'environ 20 % plus élevé que les méthodes par appel de fonctions.

Agents IA avec Hugging Face smolagents