Interface FunctionCallback.Builder
- All Known Implementing Classes:
DefaultFunctionCallbackBuilder
- Enclosing interface:
- FunctionCallback
public static interface FunctionCallback.Builder
Builder for creating a
FunctionCallback instance. This is a hierarchical
builder with the following structure:
FunctionCallback.Builder- The root builder interface.FunctionCallback.FunctionInvokingSpec- The function invoking builder interface.FunctionCallback.MethodInvokingSpec- The method invoking builder interface.
-
Method Summary
Modifier and TypeMethodDescriptiondescription(String description) Function description.<I,O> FunctionCallback.FunctionInvokingSpec<I, O> function(String name, BiFunction<I, ToolContext, O> biFunction) Builds aBiFunctioninvokingFunctionCallbackinstance.Builds aConsumerinvokingFunctionCallbackinstance.<I,O> FunctionCallback.FunctionInvokingSpec<I, O> Builds aFunctioninvokingFunctionCallbackinstance.Builds aSupplierinvokingFunctionCallbackinstance.inputTypeSchema(String inputTypeSchema) You can provide the Input Type Schema directly.Builds a Method invokingFunctionCallbackinstance.objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Custom object mapper for JSON operations.responseConverter(Function<Object, String> responseConverter) Function response converter.schemaType(FunctionCallbackContext.SchemaType schemaType) Specifies whatFunctionCallbackContext.SchemaTypeis used by the AI model to validate the function input arguments.
-
Method Details
-
description
Function description. This description is used by the model do decide if the function should be called or not. -
schemaType
Specifies whatFunctionCallbackContext.SchemaTypeis used by the AI model to validate the function input arguments. Most models use JSON Schema, except Vertex AI that uses OpenAPI types. -
responseConverter
Function response converter. The default implementation converts the output into String before sending it to the Model. Provide a custom function responseConverter implementation to override this. -
inputTypeSchema
You can provide the Input Type Schema directly. In this case it won't be generated from the inputType. -
objectMapper
Custom object mapper for JSON operations. -
function
Builds aFunctioninvokingFunctionCallbackinstance. -
function
<I,O> FunctionCallback.FunctionInvokingSpec<I,O> function(String name, BiFunction<I, ToolContext, O> biFunction) Builds aBiFunctioninvokingFunctionCallbackinstance. -
function
Builds aSupplierinvokingFunctionCallbackinstance. -
function
Builds aConsumerinvokingFunctionCallbackinstance. -
method
Builds a Method invokingFunctionCallbackinstance.
-