Class MethodToolCallback
java.lang.Object
org.springframework.ai.tool.method.MethodToolCallback
- All Implemented Interfaces:
- ToolCallback
A 
ToolCallback implementation to invoke methods as tools.- Since:
- 1.0.0
- Author:
- Thomas Vitale
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionMethodToolCallback(ToolDefinition toolDefinition, ToolMetadata toolMetadata, Method toolMethod, Object toolObject, ToolCallResultConverter toolCallResultConverter) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic MethodToolCallback.Builderbuilder()Execute tool with the given input and return the result to send back to the AI model.call(String toolInput, ToolContext toolContext) Execute tool with the given input and context, and return the result to send back to the AI model.Definition used by the AI model to determine when and how to call the tool.Metadata providing additional information on how to handle the tool.toString()
- 
Constructor Details- 
MethodToolCallbackpublic MethodToolCallback(ToolDefinition toolDefinition, @Nullable ToolMetadata toolMetadata, Method toolMethod, @Nullable Object toolObject, @Nullable ToolCallResultConverter toolCallResultConverter) 
 
- 
- 
Method Details- 
getToolDefinitionDescription copied from interface:ToolCallbackDefinition used by the AI model to determine when and how to call the tool.- Specified by:
- getToolDefinitionin interface- ToolCallback
 
- 
getToolMetadataDescription copied from interface:ToolCallbackMetadata providing additional information on how to handle the tool.- Specified by:
- getToolMetadatain interface- ToolCallback
 
- 
callDescription copied from interface:ToolCallbackExecute tool with the given input and return the result to send back to the AI model.- Specified by:
- callin interface- ToolCallback
 
- 
callDescription copied from interface:ToolCallbackExecute tool with the given input and context, and return the result to send back to the AI model.- Specified by:
- callin interface- ToolCallback
 
- 
toString
- 
builder
 
-