Expand description
Message pruning: drop reasoning, tool calls and empty messages to control context size.
Derived from the pruneMessages function of the Vercel AI SDK (Apache-2.0,
Copyright 2023 Vercel, Inc.), translated from TypeScript to Rust and
modified; see NOTICE. Intended for prepare_step callbacks.
Structs§
- Prune
Options - Options for
prune. - Tool
Call Prune - A rule removing tool calls, results, approval requests and responses.
Enums§
- Empty
Messages - What to do with messages left without content.
- Prune
Scope - Which messages a tool-call rule applies to.
- Reasoning
Prune - Which reasoning parts to remove.
Functions§
- prune
- Prunes
messagesaccording tooptions.