Annotation Interface Tool
Marks a method as a tool in Spring AI.
- Since:
- 1.0.0
- Author:
- Thomas Vitale
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThe description of the tool.The name of the tool.Class<? extends ToolCallResultConverter>
The class to use to convert the tool call result to a String.boolean
Whether the tool result should be returned directly or passed back to the model.
-
Element Details
-
name
String nameThe name of the tool. If not provided, the method name will be used.- Default:
- ""
-
description
String descriptionThe description of the tool. If not provided, the method name will be used.- Default:
- ""
-
returnDirect
boolean returnDirectWhether the tool result should be returned directly or passed back to the model.- Default:
- false
-
resultConverter
Class<? extends ToolCallResultConverter> resultConverterThe class to use to convert the tool call result to a String.- Default:
- org.springframework.ai.tool.execution.DefaultToolCallResultConverter.class
-