Spaces:
Sleeping
Sleeping
Download agents.py from prithvi55/talk2data: direct link, hf CLI and curl.
- Browser
- Download file 466 Bytes
-
https://huggingface.co/spaces/prithvi55/talk2data/resolve/refs%2Fpr%2F5/agents.py
- Command line
-
hf download hf://spaces/prithvi55/talk2data@refs/pr/5/agents.py
-
curl -L -o agents.py https://huggingface.co/spaces/prithvi55/talk2data/resolve/refs%2Fpr%2F5/agents.py
466 Bytes
| from langchain.agents import initialize_agent, AgentType, Tool | |
| from langchain.memory import ConversationBufferMemory | |
| def get_conversation_memory(): | |
| return ConversationBufferMemory(memory_key="chat_history", return_messages=True) | |
| def init_multi_agent(tools, llm, memory): | |
| return initialize_agent( | |
| tools=tools, | |
| llm=llm, | |
| agent=AgentType.CONVERSATIONAL_REACT_DESCRIPTION, | |
| memory=memory, | |
| verbose=True | |
| ) | |