Skip to content

Commit 6ac84e9

Browse files
authored
Merge pull request #110 from Zheisenbergy/Zheisenbergy-patch-1
fix: fix auto_compact truncating latest conversation content
2 parents 10d90cd + 0451bc8 commit 6ac84e9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

agents/s06_context_compact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def auto_compact(messages: list) -> list:
104104
f.write(json.dumps(msg, default=str) + "\n")
105105
print(f"[transcript saved: {transcript_path}]")
106106
# Ask LLM to summarize
107-
conversation_text = json.dumps(messages, default=str)[:80000]
107+
conversation_text = json.dumps(messages, default=str)[-80000:]
108108
response = client.messages.create(
109109
model=MODEL,
110110
messages=[{"role": "user", "content":

0 commit comments

Comments
 (0)