Vadim Briliantov
09/26/2025, 10:23 AMandylamax
09/27/2025, 5:51 AMMichael Wills
09/28/2025, 10:06 PMabstract class ListMenuTool : Tool<ListMenuTool.Empty, ListMenuTool.Result>() {
override val description: String =
"Lists all contacts of the current user with their names, emails, and other information"
The ListMenuTool
description
needs to be updated to match the context for menu instead of contacts.Vadim Briliantov
09/28/2025, 10:21 PMVadim Briliantov
09/28/2025, 10:22 PM0.5.0
where I didn’t have to specify a ToolDescriptor
explicitly on KMP (it’s now generated automatically)
0.5.0 is coming out this week 🙂Michael Wills
09/29/2025, 2:30 AMoverride val argsSerializer: KSerializer<OrderProposal> = OrderProposal.serializer()
override val resultSerializer: KSerializer<FinalOrderResult> = FinalOrderResult.serializer()
So that might somehow be picked up from Tool<OrderProposal, FinalOrderResult>
. I'm still on the early road to learning Kotlin though...Vadim Briliantov
09/29/2025, 3:00 AM0.5.0
> So that might somehow be picked up from Tool<OrderProposal, FinalOrderResult>
. I’m still on the early road to learning Kotlin though... (edited)
For a class — unfortunately no 😞
you can do that from inline fun <reified T> f() { … T.serializer() is OK to call here … }
but without inline
+ reified
— no.
I think @simon.vergauwen had some proposal of making Tools from functions for multiplatform (though, only functions with a single class-parameter would work) — then it will be possible I think. And also with some ::yourFunction.asTool(name = "name", description = "description")
function that would convert them.
Still, class-based approach remains valid for dependency injection + inheritance. And you can’t avoid type serializers there for now