getToolDescriptor

fun getToolDescriptor(argsType: TypeToken, toolName: String, toolDescription: String? = null, jsonSchemaConfig: JsonSchemaConfig = defaultJsonSchemaConfig): ToolDescriptor(source)

Generates a ToolDescriptor by generating and converting the JSON schema for the type defined by the provided argsType

Parameters

argsType

Type token representing arguments type.

toolName

Name of the tool.

toolDescription

Optional custom description. If not provided, the description will be obtained from the generated JSON schema for the argsType

jsonSchemaConfig

Optional custom JsonSchemaConfig for the JSON schema generation.

fun getToolDescriptor(callable: KCallable<*>, toolName: String? = null, toolDescription: String? = null, jsonSchemaConfig: JsonSchemaConfig = defaultJsonSchemaConfig): ToolDescriptor(source)

Generates a ToolDescriptor by generating and converting the function calling schema for the provided callable

Parameters

callable

The callable to generate the schema for.

toolName

Optional custom name. If not provided, KCallable.name will be used.

toolDescription

Optional custom description. If not provided, ai.koog.agents.core.tools.annotations.LLMDescription.description will be used if the callable is annotated with it.

jsonSchemaConfig

Optional custom JsonSchemaConfig for the JSON schema generation.