From e28384e17b761d8b0e9e9c0f6d5c1535743f0638 Mon Sep 17 00:00:00 2001 From: Kye Date: Wed, 5 Jul 2023 23:08:25 -0400 Subject: [PATCH] chat history --- swarms/agents/workers/worker.py | 3 +++ swarms/swarms.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/swarms/agents/workers/worker.py b/swarms/agents/workers/worker.py index ff071d0e..0e874230 100644 --- a/swarms/agents/workers/worker.py +++ b/swarms/agents/workers/worker.py @@ -7,6 +7,8 @@ from langchain.callbacks.manager import ( ) # +from langchain.memory.chat_message_histories import FileChatMessageHistory + class WorkerNode(BaseTool): name = "WorkerNode" @@ -27,6 +29,7 @@ class WorkerNode(BaseTool): llm=self.llm, memory=self.vectorstore.as_retriever(search_kwargs=search_kwargs), human_in_the_loop=human_in_the_loop, + chat_history_memory=FileChatMessageHistory("chat_history.txt"), ) self.agent.chain.verbose = True diff --git a/swarms/swarms.py b/swarms/swarms.py index 5745340d..83b730a5 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -4,7 +4,6 @@ from swarms.agents.boss.boss_agent import BossNode # from swarms.agents.workers.omni_worker import OmniWorkerAgent - class Swarms: def __init__(self, openai_api_key,