File size: 647 Bytes
c56a6e6
 
 
b7a23fc
c56a6e6
 
b7a23fc
c56a6e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b7a23fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from langchain.memory import ConversationBufferMemory
from langchain.chat_models import ChatOpenAI

memory = ConversationBufferMemory()
lm = ChatOpenAI()
tools = load_tools([
    'wikipedia',
    'ilm-math',
    'google-search',
    'python_repl',
    'wolfram-alpha',
    'terminal',
    'news-api',
    'podcast-api',
    'openweathermap-api'
])
agent = initialize_agent(
    tools,
    lm,
    agent_type=AgentType.CONVERSATIONAL_REACT_DESCRIPTION,
    verbose=True,
    memory=memory
)

agent.run("What's up ChatGPT?")