Record Class FunctionCallingHelper.FunctionDefinition
java.lang.Object
java.lang.Record
org.springframework.ai.model.function.FunctionCallingHelper.FunctionDefinition
- Record Components:
name- the function namedescription- the function descriptioninputTypeSchema- the input type schema
- All Implemented Interfaces:
FunctionCallback
- Enclosing class:
- FunctionCallingHelper
public static record FunctionCallingHelper.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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.ai.model.function.FunctionCallback
FunctionCallback.Builder, FunctionCallback.CommonCallbackInvokingSpec<B extends FunctionCallback.CommonCallbackInvokingSpec<B>>, FunctionCallback.FunctionInvokingSpec<I,O>, FunctionCallback.MethodInvokingSpec, FunctionCallback.SchemaType -
Constructor Summary
ConstructorsConstructorDescriptionFunctionDefinition(String name, String description, String inputTypeSchema) Creates an instance of aFunctionDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionCalled when a model detects and triggers a function call.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.getName()final inthashCode()Returns a hash code value for this object.Returns the value of theinputTypeSchemarecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.ai.model.function.FunctionCallback
call
-
Constructor Details
-
FunctionDefinition
Creates an instance of aFunctionDefinitionrecord class.- Parameters:
name- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentinputTypeSchema- the value for theinputTypeSchemarecord component
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceFunctionCallback- Returns:
- Returns the Function name. Unique within the model.
-
getDescription
- Specified by:
getDescriptionin 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:
getInputTypeSchemain interfaceFunctionCallback- Returns:
- Returns the JSON schema of the function input type.
-
call
Description copied from interface:FunctionCallbackCalled 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:
callin 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 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 thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
inputTypeSchema
Returns the value of theinputTypeSchemarecord component.- Returns:
- the value of the
inputTypeSchemarecord component
-