Record Class DefaultToolMetadata
java.lang.Object
java.lang.Record
org.springframework.ai.tool.metadata.DefaultToolMetadata
- Record Components:
returnDirect- whether the tool result should be returned directly or passed back to the modelrequiresConfirmation- whether a call of the tool needs a person's confirmation before it runs (since 2.1.0)
- All Implemented Interfaces:
ToolMetadata
public record DefaultToolMetadata(boolean returnDirect, boolean requiresConfirmation)
extends Record
implements ToolMetadata
Default implementation of
ToolMetadata.- Since:
- 1.0.0
- Author:
- Thomas Vitale
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefaultToolMetadata(boolean returnDirect) Create metadata for a tool that needs no confirmation.DefaultToolMetadata(boolean returnDirect, boolean requiresConfirmation) Creates an instance of aDefaultToolMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultToolMetadata.Builderbuilder()Create a defaultToolMetadatabuilder.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of therequiresConfirmationrecord component.booleanReturns the value of thereturnDirectrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DefaultToolMetadata
public DefaultToolMetadata(boolean returnDirect) Create metadata for a tool that needs no confirmation.- Parameters:
returnDirect- whether the tool result should be returned directly or passed back to the model
-
DefaultToolMetadata
public DefaultToolMetadata(boolean returnDirect, boolean requiresConfirmation) Creates an instance of aDefaultToolMetadatarecord class.- Parameters:
returnDirect- the value for thereturnDirectrecord componentrequiresConfirmation- the value for therequiresConfirmationrecord component
-
-
Method Details
-
builder
Description copied from interface:ToolMetadataCreate a defaultToolMetadatabuilder. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
returnDirect
public boolean returnDirect()Returns the value of thereturnDirectrecord component.- Specified by:
returnDirectin interfaceToolMetadata- Returns:
- the value of the
returnDirectrecord component
-
requiresConfirmation
public boolean requiresConfirmation()Returns the value of therequiresConfirmationrecord component.- Specified by:
requiresConfirmationin interfaceToolMetadata- Returns:
- the value of the
requiresConfirmationrecord component
-