Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): handle null key string in utils (check_null_key) #789

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions memgpt/server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading