letta-nightly 0.6.0.dev20241205104308__py3-none-any.whl → 0.6.1.dev20241205211219__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of letta-nightly might be problematic. Click here for more details.
- letta/__init__.py +1 -1
- letta/agent.py +15 -1
- letta/server/server.py +7 -1
- {letta_nightly-0.6.0.dev20241205104308.dist-info → letta_nightly-0.6.1.dev20241205211219.dist-info}/METADATA +1 -1
- {letta_nightly-0.6.0.dev20241205104308.dist-info → letta_nightly-0.6.1.dev20241205211219.dist-info}/RECORD +8 -8
- {letta_nightly-0.6.0.dev20241205104308.dist-info → letta_nightly-0.6.1.dev20241205211219.dist-info}/LICENSE +0 -0
- {letta_nightly-0.6.0.dev20241205104308.dist-info → letta_nightly-0.6.1.dev20241205211219.dist-info}/WHEEL +0 -0
- {letta_nightly-0.6.0.dev20241205104308.dist-info → letta_nightly-0.6.1.dev20241205211219.dist-info}/entry_points.txt +0 -0
letta/__init__.py
CHANGED
letta/agent.py
CHANGED
|
@@ -1253,9 +1253,23 @@ class Agent(BaseAgent):
|
|
|
1253
1253
|
self._messages = new_messages
|
|
1254
1254
|
|
|
1255
1255
|
def rebuild_system_prompt(self, force=False, update_timestamp=True):
|
|
1256
|
-
"""Rebuilds the system message with the latest memory object and any shared memory block updates
|
|
1256
|
+
"""Rebuilds the system message with the latest memory object and any shared memory block updates
|
|
1257
|
+
|
|
1258
|
+
Updates to core memory blocks should trigger a "rebuild", which itself will create a new message object
|
|
1259
|
+
|
|
1260
|
+
Updates to the memory header should *not* trigger a rebuild, since that will simply flood recall storage with excess messages
|
|
1261
|
+
"""
|
|
1262
|
+
|
|
1257
1263
|
curr_system_message = self.messages[0] # this is the system + memory bank, not just the system prompt
|
|
1258
1264
|
|
|
1265
|
+
# note: we only update the system prompt if the core memory is changed
|
|
1266
|
+
# this means that the archival/recall memory statistics may be someout out of date
|
|
1267
|
+
curr_memory_str = self.agent_state.memory.compile()
|
|
1268
|
+
if curr_memory_str in curr_system_message["content"] and not force:
|
|
1269
|
+
# NOTE: could this cause issues if a block is removed? (substring match would still work)
|
|
1270
|
+
printd(f"Memory hasn't changed, skipping system prompt rebuild")
|
|
1271
|
+
return
|
|
1272
|
+
|
|
1259
1273
|
# If the memory didn't update, we probably don't want to update the timestamp inside
|
|
1260
1274
|
# For example, if we're doing a system prompt swap, this should probably be False
|
|
1261
1275
|
if update_timestamp:
|
letta/server/server.py
CHANGED
|
@@ -395,6 +395,10 @@ class SyncServer(Server):
|
|
|
395
395
|
agent_lock = self.per_agent_lock_manager.get_lock(agent_id)
|
|
396
396
|
with agent_lock:
|
|
397
397
|
agent_state = self.get_agent(agent_id=agent_id)
|
|
398
|
+
if agent_state is None:
|
|
399
|
+
raise ValueError(f"Agent (agent_id={agent_id}) does not exist")
|
|
400
|
+
elif agent_state.user_id is None:
|
|
401
|
+
raise ValueError(f"Agent (agent_id={agent_id}) does not have a user_id")
|
|
398
402
|
actor = self.user_manager.get_user_by_id(user_id=agent_state.user_id)
|
|
399
403
|
|
|
400
404
|
interface = interface or self.default_interface_factory()
|
|
@@ -882,7 +886,7 @@ class SyncServer(Server):
|
|
|
882
886
|
in_memory_agent_state = self.get_agent(agent_state.id)
|
|
883
887
|
return in_memory_agent_state
|
|
884
888
|
|
|
885
|
-
def get_agent(self, agent_id: str) -> AgentState:
|
|
889
|
+
def get_agent(self, agent_id: str) -> Optional[AgentState]:
|
|
886
890
|
"""
|
|
887
891
|
Retrieve the full agent state from the DB.
|
|
888
892
|
This gathers data accross multiple tables to provide the full state of an agent, which is passed into the `Agent` object for creation.
|
|
@@ -893,6 +897,8 @@ class SyncServer(Server):
|
|
|
893
897
|
if agent_state is None:
|
|
894
898
|
# agent does not exist
|
|
895
899
|
return None
|
|
900
|
+
if agent_state.user_id is None:
|
|
901
|
+
raise ValueError(f"Agent {agent_id} does not have a user_id")
|
|
896
902
|
user = self.user_manager.get_user_by_id(user_id=agent_state.user_id)
|
|
897
903
|
|
|
898
904
|
# construct the in-memory, full agent state - this gather data stored in different tables but that needs to be passed to `Agent`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
letta/__init__.py,sha256=
|
|
1
|
+
letta/__init__.py,sha256=1hJidwYqfS-iX2V3ZLC2ulm-PYX74k2EMIyzC4Z0pWc,1035
|
|
2
2
|
letta/__main__.py,sha256=6Hs2PV7EYc5Tid4g4OtcLXhqVHiNYTGzSBdoOnW2HXA,29
|
|
3
|
-
letta/agent.py,sha256=
|
|
3
|
+
letta/agent.py,sha256=r80lyWFX7wjPM5gPcUOxifa4ulO_OfW3M1p0vQbmxYk,78428
|
|
4
4
|
letta/agent_store/chroma.py,sha256=-kCEMBFKmqCyFeIETYf7RN-khGddsip2FAhSzNqaC7U,12537
|
|
5
5
|
letta/agent_store/db.py,sha256=n15t8qhHfqhtFDxSQg_9uwvMntpWml8Jz_Y-ofL0loQ,23467
|
|
6
6
|
letta/agent_store/lancedb.py,sha256=i63d4VZwj9UIOTNs5f0JZ_r5yZD-jKWz4FAH4RMpXOE,5104
|
|
@@ -191,7 +191,7 @@ letta/server/rest_api/routers/v1/tools.py,sha256=TP16cpuTF2HYLFZVmabExw9gziB-Ptk
|
|
|
191
191
|
letta/server/rest_api/routers/v1/users.py,sha256=M1wEr2IyHzuRwINYxLXTkrbAH3osLe_cWjzrWrzR1aw,3729
|
|
192
192
|
letta/server/rest_api/static_files.py,sha256=NG8sN4Z5EJ8JVQdj19tkFa9iQ1kBPTab9f_CUxd_u4Q,3143
|
|
193
193
|
letta/server/rest_api/utils.py,sha256=6c5a_-ZFTlwZ1IuzpRQtqxSG1eD56nNhKhWlrdgBYWk,3103
|
|
194
|
-
letta/server/server.py,sha256=
|
|
194
|
+
letta/server/server.py,sha256=co8jvkndn96HPgtC4osLKWdu2RnFjdonFITy_cEM2ls,80756
|
|
195
195
|
letta/server/startup.sh,sha256=wTOQOJJZw_Iec57WIu0UW0AVflk0ZMWYZWg8D3T_gSQ,698
|
|
196
196
|
letta/server/static_files/assets/index-3ab03d5b.css,sha256=OrA9W4iKJ5h2Wlr7GwdAT4wow0CM8hVit1yOxEL49Qw,54295
|
|
197
197
|
letta/server/static_files/assets/index-9fa459a2.js,sha256=wtfkyHnEIMACHKL3UgN_jZNOKWEcOFjmWoeRHLngPwk,1815584
|
|
@@ -222,8 +222,8 @@ letta/streaming_interface.py,sha256=_FPUWy58j50evHcpXyd7zB1wWqeCc71NCFeWh_TBvnw,
|
|
|
222
222
|
letta/streaming_utils.py,sha256=329fsvj1ZN0r0LpQtmMPZ2vSxkDBIUUwvGHZFkjm2I8,11745
|
|
223
223
|
letta/system.py,sha256=buKYPqG5n2x41hVmWpu6JUpyd7vTWED9Km2_M7dLrvk,6960
|
|
224
224
|
letta/utils.py,sha256=7FGZYp8JCEtP0PBSfV03Zj4kW3pwV7qpNki4AOU3a94,32913
|
|
225
|
-
letta_nightly-0.6.
|
|
226
|
-
letta_nightly-0.6.
|
|
227
|
-
letta_nightly-0.6.
|
|
228
|
-
letta_nightly-0.6.
|
|
229
|
-
letta_nightly-0.6.
|
|
225
|
+
letta_nightly-0.6.1.dev20241205211219.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
|
|
226
|
+
letta_nightly-0.6.1.dev20241205211219.dist-info/METADATA,sha256=I7VWOuXd-Bu4cqUXfMqQfuJd_zd7ctR1xBuLAPLqxk0,11413
|
|
227
|
+
letta_nightly-0.6.1.dev20241205211219.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
228
|
+
letta_nightly-0.6.1.dev20241205211219.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
|
|
229
|
+
letta_nightly-0.6.1.dev20241205211219.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|