FunctionDeclarationsKt

public final class FunctionDeclarationsKt


Summary

Public methods

static final @NonNull NoParameterFunction
defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull SuspendFunction0<@NonNull JSONObject> function
)

Defines a function with zero parameters, including its implementation, that a model can be given access to in order to gain info or complete tasks.

static final @NonNull OneParameterFunction<@NonNull T>
<T extends Object> defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull Schema<@NonNull T> arg1,
    @NonNull SuspendFunction1<@NonNull T, @NonNull JSONObject> function
)

Defines a function with one parameter, including its implementation, that a model can be given access to in order to gain info or complete tasks.

static final @NonNull TwoParameterFunction<@NonNull T, @NonNull U>
<T extends Object, U extends Object> defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull Schema<@NonNull T> arg1,
    @NonNull Schema<@NonNull U> arg2,
    @NonNull SuspendFunction2<@NonNull T, @NonNull U, @NonNull JSONObject> function
)

Defines a function with two parameters, including its implementation, that a model can be given access to in order to gain info or complete tasks.

static final @NonNull ThreeParameterFunction<@NonNull T, @NonNull U, @NonNull W>
<T extends Object, U extends Object, W extends Object> defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull Schema<@NonNull T> arg1,
    @NonNull Schema<@NonNull U> arg2,
    @NonNull Schema<@NonNull W> arg3,
    @NonNull SuspendFunction3<@NonNull T, @NonNull U, @NonNull W, @NonNull JSONObject> function
)

Defines a function with three parameters, including its implementation, that a model can be given access to in order to gain info or complete tasks.

static final @NonNull FourParameterFunction<@NonNull T, @NonNull U, @NonNull W, @NonNull Z>
<T extends Object, U extends Object, W extends Object, Z extends Object> defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull Schema<@NonNull T> arg1,
    @NonNull Schema<@NonNull U> arg2,
    @NonNull Schema<@NonNull W> arg3,
    @NonNull Schema<@NonNull Z> arg4,
    @NonNull SuspendFunction4<@NonNull T, @NonNull U, @NonNull W, @NonNull Z, @NonNull JSONObject> function
)

Defines a function with four parameters, including its implementation, that a model can be given access to in order to gain info or complete tasks.

Public methods

defineFunction

public static final @NonNull NoParameterFunction defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull SuspendFunction0<@NonNull JSONObject> function
)

Defines a function with zero parameters, including its implementation, that a model can be given access to in order to gain info or complete tasks.

Parameters
@NonNull String name

The name of the function call, this should be clear and descriptive for the model

@NonNull String description

A description of what the function does and its output.

@NonNull SuspendFunction0<@NonNull JSONObject> function

the function implementation

defineFunction

public static final @NonNull OneParameterFunction<@NonNull T> <T extends Object> defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull Schema<@NonNull T> arg1,
    @NonNull SuspendFunction1<@NonNull T, @NonNull JSONObject> function
)

Defines a function with one parameter, including its implementation, that a model can be given access to in order to gain info or complete tasks.

Parameters
@NonNull String name

The name of the function call, this should be clear and descriptive for the model

@NonNull String description

A description of what the function does and its output.

@NonNull Schema<@NonNull T> arg1

A description of the first function parameter

@NonNull SuspendFunction1<@NonNull T, @NonNull JSONObject> function

the function implementation

defineFunction

public static final @NonNull TwoParameterFunction<@NonNull T, @NonNull U> <T extends Object, U extends Object> defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull Schema<@NonNull T> arg1,
    @NonNull Schema<@NonNull U> arg2,
    @NonNull SuspendFunction2<@NonNull T, @NonNull U, @NonNull JSONObject> function
)

Defines a function with two parameters, including its implementation, that a model can be given access to in order to gain info or complete tasks.

Parameters
@NonNull String name

The name of the function call, this should be clear and descriptive for the model

@NonNull String description

A description of what the function does and its output.

@NonNull Schema<@NonNull T> arg1

A description of the first function parameter

@NonNull Schema<@NonNull U> arg2

A description of the second function parameter

@NonNull SuspendFunction2<@NonNull T, @NonNull U, @NonNull JSONObject> function

the function implementation

defineFunction

public static final @NonNull ThreeParameterFunction<@NonNull T, @NonNull U, @NonNull W> <T extends Object, U extends Object, W extends Object> defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull Schema<@NonNull T> arg1,
    @NonNull Schema<@NonNull U> arg2,
    @NonNull Schema<@NonNull W> arg3,
    @NonNull SuspendFunction3<@NonNull T, @NonNull U, @NonNull W, @NonNull JSONObject> function
)

Defines a function with three parameters, including its implementation, that a model can be given access to in order to gain info or complete tasks.

Parameters
@NonNull String name

The name of the function call, this should be clear and descriptive for the model

@NonNull String description

A description of what the function does and its output.

@NonNull Schema<@NonNull T> arg1

A description of the first function parameter

@NonNull Schema<@NonNull U> arg2

A description of the second function parameter

@NonNull Schema<@NonNull W> arg3

A description of the third function parameter

@NonNull SuspendFunction3<@NonNull T, @NonNull U, @NonNull W, @NonNull JSONObject> function

the function implementation

defineFunction

public static final @NonNull FourParameterFunction<@NonNull T, @NonNull U, @NonNull W, @NonNull Z> <T extends Object, U extends Object, W extends Object, Z extends Object> defineFunction(
    @NonNull String name,
    @NonNull String description,
    @NonNull Schema<@NonNull T> arg1,
    @NonNull Schema<@NonNull U> arg2,
    @NonNull Schema<@NonNull W> arg3,
    @NonNull Schema<@NonNull Z> arg4,
    @NonNull SuspendFunction4<@NonNull T, @NonNull U, @NonNull W, @NonNull Z, @NonNull JSONObject> function
)

Defines a function with four parameters, including its implementation, that a model can be given access to in order to gain info or complete tasks.

Parameters
@NonNull String name

The name of the function call, this should be clear and descriptive for the model

@NonNull String description

A description of what the function does and its output.

@NonNull Schema<@NonNull T> arg1

A description of the first function parameter

@NonNull Schema<@NonNull U> arg2

A description of the second function parameter

@NonNull Schema<@NonNull W> arg3

A description of the third function parameter

@NonNull Schema<@NonNull Z> arg4

A description of the fourth function parameter

@NonNull SuspendFunction4<@NonNull T, @NonNull U, @NonNull W, @NonNull Z, @NonNull JSONObject> function

the function implementation