TemplateAutoFunctionDeclaration.Companion

public static class TemplateAutoFunctionDeclaration.Companion


Summary

Public methods

static final @NonNull TemplateAutoFunctionDeclaration<@NonNull I, @NonNull O>
<I extends Object, O extends Object> create(
    @NonNull String functionName,
    @NonNull JsonSchema<@NonNull I> inputSchema,
    @NonNull JsonSchema<@NonNull O> outputSchema,
    SuspendFunction1<@NonNull I, @NonNull O> functionReference
)

Creates a strongly typed function declaration with an associated function reference.

Public methods

create

public static final @NonNull TemplateAutoFunctionDeclaration<@NonNull I, @NonNull O> <I extends Object, O extends Object> create(
    @NonNull String functionName,
    @NonNull JsonSchema<@NonNull I> inputSchema,
    @NonNull JsonSchema<@NonNull O> outputSchema,
    SuspendFunction1<@NonNull I, @NonNull O> functionReference
)

Creates a strongly typed function declaration with an associated function reference.

Parameters
@NonNull String functionName

the name of the function (to the model)

@NonNull JsonSchema<@NonNull I> inputSchema

the object the model must provide to you as input

@NonNull JsonSchema<@NonNull O> outputSchema

the type that will be return to the model when the function is executed

SuspendFunction1<@NonNull I, @NonNull O> functionReference

the function that will be executed when requested by the model.