ReflectionFunctionCallingSchemaGenerator
class ReflectionFunctionCallingSchemaGenerator @JvmOverloads constructor(json: Json = Json) : AbstractSchemaGenerator<KCallable<*>, FunctionCallingSchema> (source)
Generates FunctionCallingSchema from Kotlin functions using reflection.
This generator analyzes function parameters at runtime and produces tool schemas suitable for LLM function calling APIs.
Example
fun greet(name: String, age: Int = 0): String = "Hello, $name!"
val generator = ReflectionFunctionCallingSchemaGenerator.Default
val schema = generator.generateSchema(::greet)Content copied to clipboard