| 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?") |