Interface FunctionCallback
- All Known Subinterfaces:
ToolCallback
- All Known Implementing Classes:
AsyncMcpToolCallback,FunctionCallingHelper.FunctionDefinition,FunctionInvokingFunctionCallback,FunctionToolCallback,MethodInvokingFunctionCallback,MethodToolCallback,SyncMcpToolCallback
Deprecated.
Represents a model function call handler. Implementations are registered with the
Models and called on prompts that trigger the function call.
- Author:
- Christian Tzolov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDeprecated.Use specific builder for the type of tool you need, e.g.static interfaceFunctionCallback.CommonCallbackInvokingSpec<B extends FunctionCallback.CommonCallbackInvokingSpec<B>>Deprecated.static interfaceDeprecated.Functioninvoking builder interface.static interfaceDeprecated.Method invoking builder interface.static enumDeprecated.Describes the type of the schema used to describe the input parameters of the function. -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionCallback.Builderbuilder()Deprecated.Creates a newFunctionCallback.Builderinstance used to build a defaultFunctionCallbackinstance.Deprecated.Called when a model detects and triggers a function call.default Stringcall(String functionInput, ToolContext tooContext) Deprecated.Called when a model detects and triggers a function call.Deprecated.Deprecated.getName()Deprecated.
-
Method Details
-
getName
String getName()Deprecated.- Returns:
- Returns the Function name. Unique within the model.
-
getDescription
String getDescription()Deprecated.- Returns:
- Returns the function description. This description is used by the model do decide if the function should be called or not.
-
getInputTypeSchema
String getInputTypeSchema()Deprecated.- Returns:
- Returns the JSON schema of the function input type.
-
call
Deprecated.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.- 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.
-
call
Deprecated.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. Additionally, the model can pass a context map to the function if available. The context is used to pass additional user provided state in addition to the arguments provided by the AI model.- 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. Arguments are provided by the AI model.tooContext- Map with the function context. The context is used to pass additional user provided state in addition to the arguments provided by the AI model.- Returns:
- String containing the function call response.
-
builder
Deprecated.Creates a newFunctionCallback.Builderinstance used to build a defaultFunctionCallbackinstance.- Returns:
- Returns a new
FunctionCallback.Builderinstance.
-
ToolCallback.