custom-compaction

command
v1.3.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package main demonstrates custom context compaction with the PromptKit SDK.

This example shows three extensibility patterns:

  1. Custom CompactionRule — a rule that produces domain-specific summaries for search results instead of the generic preview+bytes format.
  2. Built-in CollapsePairs — collapses superseded assistant+tool pairs when the same tool is called again with the same arguments.
  3. Custom CompactionStrategy — a complete replacement for the default compactor, wrapping it with logging.

Run with:

go run .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL