Package com.google.adk.models.springai
Class SpringAiTool
java.lang.Object
com.google.adk.tools.BaseTool
com.google.adk.models.springai.SpringAiTool
Exposes a Spring AI
ToolCallback as an ADK BaseTool, so an existing Spring AI
tool can be used by any ADK agent and model. Name, description, and input schema come from the
callback's ToolDefinition; the schema is passed through as FunctionDeclaration.parametersJsonSchema(). The ADK ToolContext is passed to the
callback under ToolConverter.ADK_TOOL_CONTEXT_KEY, and a returnDirect callback
maps to ADK's skipSummarization.-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.adk.tools.BaseTool
BaseTool.ToolArgsConfig, BaseTool.ToolConfig -
Constructor Summary
ConstructorsConstructorDescriptionSpringAiTool(org.springframework.ai.tool.ToolCallback toolCallback) WrapstoolCallbackas an ADK tool. -
Method Summary
Methods inherited from class com.google.adk.tools.BaseTool
customMetadata, description, fromConfig, longRunning, name, processLlmRequest, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, setCustomMetadata
-
Constructor Details
-
SpringAiTool
public SpringAiTool(org.springframework.ai.tool.ToolCallback toolCallback) WrapstoolCallbackas an ADK tool.- Parameters:
toolCallback- The Spring AI tool to wrap
-
-
Method Details
-
declaration
Description copied from class:BaseToolGets theFunctionDeclarationrepresentation of this tool.- Overrides:
declarationin classBaseTool
-
runAsync
public io.reactivex.rxjava3.core.Single<Map<String,Object>> runAsync(@Nullable Map<String, Object> args, @Nullable ToolContext toolContext) Description copied from class:BaseToolCalls a tool.
-