AI Agents vs. LLMs: Choosing the Right Tool for AI Tasks