Skip to content

Commit

Permalink
Update chapter7.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yogananda-muthaiah authored Dec 1, 2024
1 parent 5138f82 commit d6b31c3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions chapter7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Chapter 7: Using agents
Agents are one of the most powerful features of LangChain, allowing them to combine multiple tools to autonomously perform more complex tasks.

```
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from langchain.llms import OpenAI
llm = OpenAI(temperature=0)
tools = load_tools(["serpapi", "llm-math"], llm=llm)
agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
agent.run("What was the high temperature in SF yesterday in Fahrenheit? What is that number raised to the .023 power?")
```

0 comments on commit d6b31c3

Please sign in to comment.