In this article, I’ll show you how can you get your hands dirty with Langchain agents. If you are not aware what Langchain is, I would recommend you to watch my recording here, wherein I just briefed about it.
Langchain agents are the ones who uses LLM to determine what needs to be done and in which order. You can have a quick look at the available agents in the documentation, but I’ll list them here too.
- zero-shot-react-description
- react-docstore
- self-ask-with-search
- conversational-react-description
Here agents work via tools and tools are nothing but those are functions which will be used by agents to interact with outside world.
List of tools which are available today are:
- python_repl
- serpapi
- wolfram-alpha
- requests
- terminal
- pal-math
- pal-colored-objects
- llm-math
- open-meteo-api
- news-api
- tmdb-api
- google-search
- searx-search
- google-serper, etc
In this article, I’m covering serpapi.
Import Required Packages
In order to get started, we need to import these below packages:
Set LLM And Initialize Agent
Next we need to set LLM, which is OpenAI here and then we need to initialize agent as shown below:
If this is what interests you, check out my complete article here.
Here is the video post too.
Comments
Post a Comment