File size: 466 Bytes
d1a818a
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
    )