prune_conversation
Reduce conversation token usage by removing filler turns and compressing older messages, saving 60-80% on long histories.
Instructions
Reduce conversation history token footprint by removing filler turns and compressing older verbose ones. Saves 60–80% on long conversations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | OpenAI-format list of {"role": "...", "content": "..."} dicts. | |
| max_output_tokens | No | Target total size for the pruned history. | |
| keep_last_n | No | Always preserve the N most recent turns verbatim. | |
| prune_strategy | No | "remove" drops low-value turns, "compress" shrinks older turns, "hybrid" does both. | hybrid |
| model | No | Used for token counting. | gpt-4o |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||