Skip to content

Commit

Permalink
if not resume - clear mem
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Feb 21, 2024
1 parent 53cf36b commit 64ef976
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mdagent/mainagent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from langchain.chat_models import ChatOpenAI

from mdagent.subagents import SubAgentSettings
from mdagent.utils import PathRegistry, _make_llm
from mdagent.utils import PathRegistry, _make_llm, clear_memory

from ..tools import get_tools, make_all_tools
from .prompt import openaifxn_prompt, structured_prompt
Expand Down Expand Up @@ -50,8 +50,13 @@ def __init__(
curriculum=True,
uploaded_files=[], # user input files to add to path registry
):
self.resume = resume
if path_registry is None:
path_registry = PathRegistry.get_instance()
if not resume:
path_registry._clear_json()
clear_memory()

self.uploaded_files = uploaded_files
for file in uploaded_files: # todo -> allow users to add descriptions?
path_registry.map_path(file, file, description="User uploaded file")
Expand Down

0 comments on commit 64ef976

Please sign in to comment.