Exploring the Power of AI Agents: Functions, Applications, and Future Trends