Skip to main content

Module prompt

Module prompt 

Source
Expand description

Free-text compaction prompt template + post-processing.

This module provides the 9-section prompt template used as the free-text fallback when structured compaction is unavailable, and the format_compact_summary function that strips the <analysis> drafting scratchpad and renders the <summary> block into a readable form.

Constants§

FREE_TEXT_COMPACT_PROMPT
Preamble telling the model to produce text only (no tool calls during compaction). The compaction call uses an empty tool list already, but this reinforces it for models that hallucinate tool calls.

Functions§

format_compact_summary
Strip the <analysis>…</analysis> drafting scratchpad from the model’s response and convert <summary>…</summary> into readable section headers. Returns the cleaned summary.