chat history

pull/160/head
Kye 2 years ago
parent db0ea43909
commit e28384e17b

@ -7,6 +7,8 @@ from langchain.callbacks.manager import (
) )
# #
from langchain.memory.chat_message_histories import FileChatMessageHistory
class WorkerNode(BaseTool): class WorkerNode(BaseTool):
name = "WorkerNode" name = "WorkerNode"
@ -27,6 +29,7 @@ class WorkerNode(BaseTool):
llm=self.llm, llm=self.llm,
memory=self.vectorstore.as_retriever(search_kwargs=search_kwargs), memory=self.vectorstore.as_retriever(search_kwargs=search_kwargs),
human_in_the_loop=human_in_the_loop, human_in_the_loop=human_in_the_loop,
chat_history_memory=FileChatMessageHistory("chat_history.txt"),
) )
self.agent.chain.verbose = True self.agent.chain.verbose = True

@ -4,7 +4,6 @@ from swarms.agents.boss.boss_agent import BossNode
# from swarms.agents.workers.omni_worker import OmniWorkerAgent # from swarms.agents.workers.omni_worker import OmniWorkerAgent
class Swarms: class Swarms:
def __init__(self, def __init__(self,
openai_api_key, openai_api_key,

Loading…
Cancel
Save