Skip to main content

Module prune

Module prune 

Source
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§

PruneOptions
Options for prune.
ToolCallPrune
A rule removing tool calls, results, approval requests and responses.

Enums§

EmptyMessages
What to do with messages left without content.
PruneScope
Which messages a tool-call rule applies to.
ReasoningPrune
Which reasoning parts to remove.

Functions§

prune
Prunes messages according to options.