asToolsByClass
Converts all instance methods of class/interface T marked as Tool to a list of tools that will be called on object this.
See asTool for detailed description.
interface MyToolsetInterface : ToolSet {
@Tool
@LLMDescription("My best tool")
fun my_best_tool(arg1: String, arg2: Int)
}
class MyToolset : MyToolsetInterface {
@Tool
@LLMDescription("My best tool overridden description")
fun my_best_tool(arg1: String, arg2: Int) {
// ...
}
@Tool
@LLMDescription("My best tool 2")
fun my_best_tool_2(arg1: String, arg2: Int) {
// ...
}
}
val myToolset = MyToolset()
val tools = myToolset.asToolsByInterface<MyToolsetInterface>() // only interface methods will be addedContent copied to clipboard