TemplateAutoFunctionDeclaration

class TemplateAutoFunctionDeclaration<I : Any, O : Any>


A function declaration for a template tool that can be called by the model automatically.

Summary

Public companion functions

TemplateAutoFunctionDeclaration<I, O>
<I : Any, O : Any> create(
    functionName: String,
    inputSchema: JsonSchema<I>,
    outputSchema: JsonSchema<O>,
    functionReference: (suspend (I) -> O)?
)

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

Public properties

(suspend (I) -> O)?
JsonSchema<I>
String
JsonSchema<O>?

Public companion functions

create

fun <I : Any, O : Any> create(
    functionName: String,
    inputSchema: JsonSchema<I>,
    outputSchema: JsonSchema<O>,
    functionReference: (suspend (I) -> O)? = null
): TemplateAutoFunctionDeclaration<I, O>

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

Parameters
functionName: String

the name of the function (to the model)

inputSchema: JsonSchema<I>

the object the model must provide to you as input

outputSchema: JsonSchema<O>

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

functionReference: (suspend (I) -> O)? = null

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

Public properties

functionReference

val functionReference: (suspend (I) -> O)?

inputSchema

val inputSchemaJsonSchema<I>

name

val nameString

outputSchema

val outputSchemaJsonSchema<O>?