Record Class ToolCallHelper.FunctionDefinition
java.lang.Object
java.lang.Record
org.springframework.ai.model.function.ToolCallHelper.FunctionDefinition
- All Implemented Interfaces:
FunctionCallback
- Enclosing class:
- ToolCallHelper
public static record ToolCallHelper.FunctionDefinition(String name, String description, String inputTypeSchema)
extends Record
implements FunctionCallback
Helper used to provide only the function definition, without the actual function
call implementation.
-
Constructor Summary
ConstructorDescriptionFunctionDefinition
(String name, String description, String inputTypeSchema) Creates an instance of aFunctionDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionCalled when a model detects and triggers a function call.Returns the value of thedescription
record component.final boolean
Indicates whether some other object is "equal to" this one.getName()
final int
hashCode()
Returns a hash code value for this object.Returns the value of theinputTypeSchema
record component.name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.ai.model.function.FunctionCallback
call
-
Constructor Details
-
FunctionDefinition
Creates an instance of aFunctionDefinition
record class.- Parameters:
name
- the value for thename
record componentdescription
- the value for thedescription
record componentinputTypeSchema
- the value for theinputTypeSchema
record component
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceFunctionCallback
- Returns:
- Returns the Function name. Unique within the model.
-
getDescription
- Specified by:
getDescription
in interfaceFunctionCallback
- Returns:
- Returns the function description. This description is used by the model do decide if the function should be called or not.
-
getInputTypeSchema
- Specified by:
getInputTypeSchema
in interfaceFunctionCallback
- Returns:
- Returns the JSON schema of the function input type.
-
call
Description copied from interface:FunctionCallback
Called when a model detects and triggers a function call. The model is responsible to pass the function arguments in the pre-configured JSON schema format.- Specified by:
call
in interfaceFunctionCallback
- Parameters:
functionInput
- JSON string with the function arguments to be passed to the function. The arguments are defined as JSON schema usually registered with the the model.- Returns:
- String containing the function call response.
-
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 withObjects::equals(Object,Object)
. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
inputTypeSchema
Returns the value of theinputTypeSchema
record component.- Returns:
- the value of the
inputTypeSchema
record component
-