From 3de757d60eb772ea3f84111f39de8ec78a27e092 Mon Sep 17 00:00:00 2001 From: cthomas Date: Tue, 19 Aug 2025 13:09:55 -0700 Subject: [PATCH] fix: type error for int comparison (#4010) --- letta/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letta/utils.py b/letta/utils.py index f29ed68b..4ce4c10c 100644 --- a/letta/utils.py +++ b/letta/utils.py @@ -874,7 +874,7 @@ def validate_function_response(function_response: Any, return_char_limit: int, s function_response_string = str(function_response) # TODO we should change this to a max token limit that's variable based on tokens remaining (or context-window) - if truncate and len(function_response_string) > return_char_limit: + if truncate and return_char_limit and len(function_response_string) > return_char_limit: logger.warning(f"function return was over limit ({len(function_response_string)} > {return_char_limit}) and was truncated") function_response_string = f"{function_response_string[:return_char_limit]}... [NOTE: function output was truncated since it exceeded the character limit ({len(function_response_string)} > {return_char_limit})]"