Package dev.langchain4j.agent.tool
Class ToolSpecifications
java.lang.Object
dev.langchain4j.agent.tool.ToolSpecifications
Utility methods for
ToolSpecification
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic ToolSpecification
toolSpecificationFrom
(Method method) Returns theToolSpecification
for the given method annotated with @Tool
.static List
<ToolSpecification> toolSpecificationsFrom
(Class<?> classWithTools) ReturnsToolSpecification
s for all methods annotated with @Tool
within the specified class.static List
<ToolSpecification> toolSpecificationsFrom
(Object objectWithTools) ReturnsToolSpecification
s for all methods annotated with @Tool
within the class of the specified object.
-
Method Details
-
toolSpecificationsFrom
ReturnsToolSpecification
s for all methods annotated with @Tool
within the specified class.- Parameters:
classWithTools
- the class.- Returns:
- the
ToolSpecification
s.
-
toolSpecificationsFrom
ReturnsToolSpecification
s for all methods annotated with @Tool
within the class of the specified object.- Parameters:
objectWithTools
- the object.- Returns:
- the
ToolSpecification
s.
-
toolSpecificationFrom
Returns theToolSpecification
for the given method annotated with @Tool
.- Parameters:
method
- the method.- Returns:
- the
ToolSpecification
.
-