SpringAiTool

class SpringAiTool(toolCallback: ToolCallback) : BaseTool

Exposes a Spring AI ToolCallback as an ADK BaseTool, so an existing Spring AI tool can be used by any ADK Kotlin agent and model. Name, description, and input schema come from the callback's ToolDefinition; ADK owns the tool loop, so run serializes the arguments, invokes the callback on the IO dispatcher (the call is blocking), and decodes the JSON result. The ADK ToolContext is passed to the callback under ADK_TOOL_CONTEXT_KEY, and a returnDirect callback maps to ADK's skipSummarization.

Parameters

toolCallback

The Spring AI tool to wrap.

Constructors

Link copied to clipboard
constructor(toolCallback: ToolCallback)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun declaration(): FunctionDeclaration
Link copied to clipboard
open suspend fun processLlmRequest(toolContext: ToolContext, llmRequest: LlmRequest): LlmRequest
Link copied to clipboard
open suspend override fun run(context: ToolContext, args: Map<String, Any?>): Any