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(server): handle null key string in utils (check_null_key)

tezer5cf48ac88aeb
diff --git a/memgpt/server/utils.py b/memgpt/server/utils.py
index 14f684f0a..fb341e88b 100644
--- a/memgpt/server/utils.py
+++ b/memgpt/server/utils.py
@@ -37,6 +37,8 @@ def shorten_key_middle(key_string, chars_each_side=3):
Returns:
str: The shortened key string with an ellipsis in the middle.
"""
+ if not key_string:
+ return key_string
key_length = len(key_string)
if key_length <= 2 * chars_each_side:
return "..." # Return ellipsis if the key is too short