Skip to content

Commit 5f9df7e

Browse files
committed
Print total length when truncating long outputs
Provides a little more context for the assistant to work with
1 parent e7c62be commit 5f9df7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

interpreter/core/utils/truncate_output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ def truncate_output(data, max_output_chars=2800, add_scrollbars=False):
77
# Calculate how much to show from start and end
88
chars_per_end = max_output_chars // 2
99

10-
message = ("Output truncated. "
11-
f"Showing {chars_per_end} characters from start/end. "
10+
message = (f"Output truncated ({len(data):,} characters total). "
11+
f"Showing {chars_per_end:,} characters from start/end. "
1212
"To handle large outputs, store result in python var first "
1313
"`result = command()` then `computer.ai.summarize(result)` for "
1414
"a summary, search with `result.find('text')`, "

0 commit comments

Comments
 (0)