Skip to content

Commit

Permalink
Update chapter8.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yogananda-muthaiah authored Dec 1, 2024
1 parent d6b31c3 commit 45679e4
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion chapter8.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
chapter4.md
## Chapter 8: Integration with external APIs
By using LangChain to integrate with external APIs, you can build AI applications that leverage richer sources of information.

```
from langchain.utilities import OpenWeatherMapAPIWrapper
from langchain.agents import initialize_agent, Tool
from langchain.llms import OpenAI
# OpenWeatherMap API
weather = OpenWeatherMapAPIWrapper()
tools = [
Tool(
name="Weather",
func=weather.run,
description="useful for when you need to answer questions about the weather"
)
]
agent = initialize_agent(tools, OpenAI(temperature=0), agent="zero-shot-react-description", verbose=True)
agent.run("What's the weather like in Munich right now?")
```

0 comments on commit 45679e4

Please sign in to comment.