Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix agent load (#412)

Sarah Wooders5647f8b63bcd
diff --git a/memgpt/config.py b/memgpt/config.py
index c982c90f8..e1d3dec24 100644
--- a/memgpt/config.py
+++ b/memgpt/config.py
@@ -259,7 +259,7 @@ class AgentConfig:
persona,
human,
model,
- context_window,
+ context_window=None,
preset=DEFAULT_PRESET,
name=None,
data_sources=[],
@@ -280,6 +280,11 @@ class AgentConfig:
self.create_time = create_time if create_time is not None else utils.get_local_time()
self.data_source = None # deprecated
+ if context_window is None:
+ self.context_window = LLM_MAX_TOKENS[self.model] if self.model in LLM_MAX_TOKENS else LLM_MAX_TOKENS["DEFAULT"]
+ else:
+ self.context_window = context_window
+
# save agent config
self.agent_config_path = (
os.path.join(MEMGPT_DIR, "agents", self.name, "config.json") if agent_config_path is None else agent_config_path