PruneToolCallsRule
Namespace: Vercel.AI.GenerateText
public sealed class PruneToolCallsRuleOne rule for pruning tool calls, results, errors, and approvals. Maps to an entry of the toolCalls array,
{ type: 'all' | 'before-last-message' | 'before-last-N-messages', tools }.
Inheritance: object
Properties
Section titled “Properties”KeepLastMessagesCount
Section titled “KeepLastMessagesCount”public int? KeepLastMessagesCount { get; }Number of trailing messages to keep, or null for none (all).
Value: int?
public IReadOnlyList<string>? Tools { get; }Names of the tools to prune, or null for every tool.
Value: IReadOnlyList<string>
Methods
Section titled “Methods”All(IReadOnlyList<string>?)
Section titled “All(IReadOnlyList<string>?)”public static PruneToolCallsRule All(IReadOnlyList<string>? tools = null)Prunes in all messages. Maps to type: 'all'.
Parameters
| Name | Type | Description |
|---|---|---|
tools |
IReadOnlyList<string> | Names of the tools to prune. Null prunes every tool. |
Returns: PruneToolCallsRule
BeforeLastMessage(IReadOnlyList<string>?)
Section titled “BeforeLastMessage(IReadOnlyList<string>?)”public static PruneToolCallsRule BeforeLastMessage(IReadOnlyList<string>? tools = null)Prunes before the last message. Maps to type: 'before-last-message'.
Parameters
| Name | Type | Description |
|---|---|---|
tools |
IReadOnlyList<string> | Names of the tools to prune. Null prunes every tool. |
Returns: PruneToolCallsRule
BeforeLastMessages(int, IReadOnlyList<string>?)
Section titled “BeforeLastMessages(int, IReadOnlyList<string>?)”public static PruneToolCallsRule BeforeLastMessages(int count, IReadOnlyList<string>? tools = null)Prunes before the last <code class=“paramref”>count</code> messages. Maps to type: 'before-last-N-messages'.
Parameters
| Name | Type | Description |
|---|---|---|
count |
int | Number of trailing messages to keep unpruned. |
tools |
IReadOnlyList<string> | Names of the tools to prune. Null prunes every tool. |
Returns: PruneToolCallsRule
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product