ToolApprovalRequestContent class

Represents a request for approval before a tool call is executed.

Pair a ToolApprovalRequestContent with a ToolApprovalResponseContent using the same requestId to implement user-in-the-loop tool approval.

Inheritance
Annotations
  • @Source(name: 'ToolApprovalRequestContent.cs', namespace: 'Microsoft.Extensions.AI', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/')

Constructors

ToolApprovalRequestContent({required String requestId, required ToolCallContent toolCall, Object? rawRepresentation, AdditionalPropertiesDictionary? additionalProperties})
Creates a new ToolApprovalRequestContent.

Properties

additionalProperties AdditionalPropertiesDictionary?
Additional properties.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
rawRepresentation Object?
The underlying implementation-specific representation of this content.
getter/setter pairinherited
requestId String
Unique identifier correlating this request with its response.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toolCall ToolCallContent
The tool call that requires approval before execution.
final

Methods

createResponse(bool approved, {String? reason}) ToolApprovalResponseContent
Creates the corresponding ToolApprovalResponseContent.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited