From 5a83c4539ae86eb5d4dd46ef4f9fd97de51851b9 Mon Sep 17 00:00:00 2001 From: lidanyang Date: Tue, 9 Jul 2024 16:51:58 +0800 Subject: [PATCH] avoid truncate output of html content --- metagpt/actions/di/execute_nb_code.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metagpt/actions/di/execute_nb_code.py b/metagpt/actions/di/execute_nb_code.py index cc2c05341..91480d3a7 100644 --- a/metagpt/actions/di/execute_nb_code.py +++ b/metagpt/actions/di/execute_nb_code.py @@ -191,7 +191,8 @@ class ExecuteNbCode(Action): output_text = remove_log_and_warning_lines(output_text) # The useful information of the exception is at the end, # the useful information of normal output is at the begining. - output_text = output_text[:keep_len] if is_success else output_text[-keep_len:] + if '' not in output_text: + output_text = output_text[:keep_len] if is_success else output_text[-keep_len:] parsed_output.append(output_text) return is_success, ",".join(parsed_output)