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