7 Agents
This chapter covers:
- Introduction to agents
- Types of agents – LangChain Agents and Transformers Agents
- Different types of LangChain Agents – Python Agent, Pandas DataFrame Agent, CSV Agent, and JSON Agent
- What are agent types
- Different types of Hugging Face Transformers Agents – CodeAgent, ReactCodeAgent, and ReactJsonAgent
- The different tools you can use with Transformers Agents
Up to this point, you have utilized Hugging Face Transformers for various tasks, including natural language processing, image analysis, and computer vision. Different models are used for each of these tasks. For example, you would use a translation model to translate text and an image captioning model for generating descriptions of images. However, when tasks are ambiguous or complex, it can be challenging to manage them effectively. This is where an agent becomes invaluable, as it can leverage an LLM to break down complex tasks into simpler, more manageable components.
In this chapter, you will learn what is an agent, and the various types of agents that you can use, namely LangChain Agents, and Transformers Agents. You will see how agents can effortlessly solve your problems, allowing you to focus on the bigger picture without worrying about the details.
7.1 Introduction to Agents
According to the Oxford dictionary, an agent is:
- A person who acts on behalf of another person or group.
- A person or thing that takes an active role or produces a specified effect.