Skip to main content

Module compaction

Module compaction 

Source
Expand description

Structured conversation compaction for context overflow handling

When conversation history exceeds context limits, this module provides tools to compact the history while preserving key information like:

  • User’s original intent and requirements
  • Important decisions made
  • Code changes and their rationale
  • Error messages and debugging information

Structs§

CodeChange
A code change with metadata
CompactionResult
Compaction result with statistics
CompactionStrategy
Compaction strategy for preserving different types of information
ErrorSolution
An error and its solution
ParsedCompactionSummary
Parse a structured compaction summary

Functions§

build_compaction_prompt
Build a structured compaction prompt for the LLM
compact_messages
Compact messages based on the given strategy
parse_compaction_summary
Parse a structured compaction summary from LLM output
summary_to_message
Convert a parsed compaction summary back to a message