brackozi commited on
Commit
c56a6e6
·
1 Parent(s): 0437900

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -22
app.py CHANGED
@@ -1,25 +1,28 @@
1
- from langchain. agents import load_tools
2
- from langchain.agents import initialize agent
3
- from langchain. agents import AgentType
4
  from langchain.memory import ConversationBufferMemory
5
- from langchain. chat_models import ChatOpenAI
 
6
  memory = ConversationBufferMemory()
7
- (lm = ChatOpenAI()
8
- tools = load tools (I
9
- 'wikipedia'
10
- 'Ilm-math',
11
- 'qoogle-search'
12
- 'python_repl'
13
- 'wolfram-alpha'
14
- "terminal'
15
- "news-api
16
- "podcast-api'
17
- 'openweathermap-api'
18
- 1, 11m=11m)
19
- agent = initialize agent
20
- tools,
21
- Ilm,
22
- agent=AgentType.CONVERSATIONAL_REACT_DESCRIPTION,
23
- verbose=True,
24
- memory=memory
 
 
25
  agent.run("What's up ChatGPT?")
 
1
+ from langchain.agents import load_tools
2
+ from langchain.agents import initialize_agent
3
+ from langchain.agents import AgentType
4
  from langchain.memory import ConversationBufferMemory
5
+ from langchain.chat_models import ChatOpenAI
6
+
7
  memory = ConversationBufferMemory()
8
+ lm = ChatOpenAI()
9
+ tools = load_tools([
10
+ 'wikipedia',
11
+ 'ilm-math',
12
+ 'google-search',
13
+ 'python_repl',
14
+ 'wolfram-alpha',
15
+ 'terminal',
16
+ 'news-api',
17
+ 'podcast-api',
18
+ 'openweathermap-api'
19
+ ])
20
+ agent = initialize_agent(
21
+ tools,
22
+ lm,
23
+ agent_type=AgentType.CONVERSATIONAL_REACT_DESCRIPTION,
24
+ verbose=True,
25
+ memory=memory
26
+ )
27
+
28
  agent.run("What's up ChatGPT?")