Tool

constructor(argsType: TypeToken, resultType: TypeToken, descriptor: ToolDescriptor, metadata: Map<String, String> = emptyMap())(source)

Type Parameters

TArgs

The type of arguments the tool accepts.

TResult

The type of result the tool returns.


constructor(argsType: TypeToken, resultType: TypeToken, name: String, description: String, jsonSchemaConfig: JsonSchemaConfig = defaultJsonSchemaConfig)(source)

Convenience constructor for the base tool class that generates ToolDescriptor from the provided name, description and argsType.

Parameters

argsType

Type token representing arguments type TArgs.

resultType

Type token representing result type TResult.

name

The name of the tool.

description

Textual explanation of what the tool does and how it can be used (for the LLM).

jsonSchemaConfig

Optional custom JsonSchemaConfig for the tool schema generation.


constructor(argsSerializer: KSerializer<TArgs>, resultSerializer: KSerializer<TResult>, descriptor: ToolDescriptor)(source)
constructor(argsSerializer: KSerializer<TArgs>, resultSerializer: KSerializer<TResult>, name: String, description: String)(source)

Deprecated

Use TypeToken constructors instead