Skip to content

ToolApprovalResponseModelMessage

Namespace: Vercel.AI.Provider

public sealed class ToolApprovalResponseModelMessage : ModelMessage

The 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

View source

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

View source

public string ApprovalId { get; }

Approval id of the request this answers.

Value: string

View source

public bool Approved { get; }

Whether the call was approved.

Value: bool

View source

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

View source

public bool ProviderExecuted { get; }

True when the provider runs the tool, so the model must see the response.

Value: bool

View source

public string? Reason { get; }

Reason for the decision, when given.

Value: string

View source

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