Skip to content

ToolApprovalCollection

Namespace: Vercel.AI.GenerateText

public static class ToolApprovalCollection

Collects tool approvals from the last tool message. Maps to collectToolApprovals.

Inheritance: object

View source

CollectToolApprovals(IReadOnlyList<ApprovalHistoryMessage>)

Section titled “CollectToolApprovals(IReadOnlyList<ApprovalHistoryMessage>)”
public static CollectedToolApprovalSet CollectToolApprovals(IReadOnlyList<ApprovalHistoryMessage> messages)

Reads approval responses from the last message when it is a tool message. Returns empty lists for every other ending.

Parameters

Name Type Description
messages IReadOnlyList<ApprovalHistoryMessage>

Returns: CollectedToolApprovalSet

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product