executeUnsafe

suspend fun <TResult> SafeTool<ERROR CLASS: Symbol not found for ToolFromCallable.Args, TResult>.executeUnsafe(serializer: JSONSerializer, vararg args: Any?): SafeTool.Result<TResult>(source)

Helper function for SafeTool that is created from ToolFromCallable. Allows a simpler execution by passing the ToolFromCallable.callable positional arguments directly as args instead of creating ToolFromCallable.Args manually.

It is unsafe since it doesn't validate types of the args, so it can throw type mismatch related exceptions.

Example:

// Sample tool function
fun myTool(a: String, b: Int): String = "$a=$b"

// Environment-aware safe tool instance
val safeTool = SafeTool(::myTool.asTool(), environment, clock)

// Can trigger tool execution manually without creating Args object by hand
val result = safeTool.executeUnsafe(serializer, "test", 123)