Skip to content

Commit b956fbf

Browse files
authored
Merge pull request #96 from KaminariOS/log_trim_update
Add LOG_TRIM to .env.example
2 parents da5cb0f + 6436710 commit b956fbf

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ GROQ_API_KEY=your_groq_api_key_here
3939

4040
# OpenRouter Model Selection (optional)
4141
OPENROUTER_MODEL=openai/gpt-4o-mini
42+
43+
# Set it to a positive integer(window size in lines) to trim log blocks that only differ in timestamps. This saves input tokens and reduces context length.
44+
# For example, if LOG_TRIM=2, the code will compare every 1 line, and then every 2 lines for duplication.
45+
LOG_TRIM=0

aiopslab/orchestrator/actions/log_deduplication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def greedy_compress_lines(
117117
log_trim = int(value) if value is not None else None
118118
except ValueError:
119119
log_trim = None
120-
if not log_trim:
120+
if not log_trim or log_trim <= 0:
121121
return raw_str
122122
window_size = log_trim
123123
lines = raw_str.splitlines()

0 commit comments

Comments
 (0)