whim_compact
Keep conversation history within a token budget by retaining the first and last messages and truncating the middle. Reduces token usage while preserving key context without summarization.
Instructions
Truncate conversation history to fit a token budget. Keeps first and last messages intact, truncates the middle. This is truncation, not summarization.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | Messages to truncate | |
| maxTokens | No | Target token budget for the output (default: 4096) |