MessagePruning
Namespace: Vercel.AI.GenerateText
public static class MessagePruningMessage pruning. Maps to pruneMessages.
Inheritance: object
Methods
Section titled “Methods”PruneMessages(PruneMessagesOptions)
Section titled “PruneMessages(PruneMessagesOptions)”public static IReadOnlyList<ModelMessage> PruneMessages(PruneMessagesOptions options)Prunes reasoning, tool calls, results, errors, and approvals from a list of messages. The input is not changed. A tool message upstream holds several parts. Here its parts are separate consecutive tool messages, and they count as one message for BeforeLastMessage and the trailing-message rules.
Parameters
| Name | Type | Description |
|---|---|---|
options |
PruneMessagesOptions | The messages and the pruning settings. |
Returns: IReadOnlyList<ModelMessage> — The pruned messages.
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product