ToolApprovalResponseModelMessage
Namespace: Vercel.AI.Provider
public sealed class ToolApprovalResponseModelMessage : ModelMessageThe caller’s answer to a GeneratedToolApprovalRequest. Only a response with ProviderExecuted reaches the model; the generation loop drops the others from the prompt.
Inheritance: object → ModelMessage
Constructors
Section titled “Constructors”ToolApprovalResponseModelMessage(string, bool, string?, bool)
Section titled “ToolApprovalResponseModelMessage(string, bool, string?, bool)”public ToolApprovalResponseModelMessage(string approvalId, bool approved, string? reason = null, bool providerExecuted = false)Creates an approval response.
Parameters
| Name | Type | Description |
|---|---|---|
approvalId |
string | |
approved |
bool | |
reason |
string | |
providerExecuted |
bool |
Properties
Section titled “Properties”ApprovalId
Section titled “ApprovalId”public string ApprovalId { get; }Approval id of the request this answers.
Value: string
Approved
Section titled “Approved”public bool Approved { get; }Whether the call was approved.
Value: bool
DeniedToolResult
Section titled “DeniedToolResult”public ToolModelMessage? DeniedToolResult { get; init; }For a denied provider-executed call, the execution-denied result sent in the same tool message, after the response.
The generation loop sets it while it prepares the prompt.
Value: ToolModelMessage
ProviderExecuted
Section titled “ProviderExecuted”public bool ProviderExecuted { get; }True when the provider runs the tool, so the model must see the response.
Value: bool
Reason
Section titled “Reason”public string? Reason { get; }Reason for the decision, when given.
Value: string
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product