Closed
Description
private boolean isFunctionalType(Method toolMethod) {
var isFunction = ClassUtils.isAssignable(toolMethod.getReturnType(), Function.class)
|| ClassUtils.isAssignable(toolMethod.getReturnType(), Supplier.class)
|| ClassUtils.isAssignable(toolMethod.getReturnType(), Consumer.class);
if (isFunction) {
logger.warn("Method {} is annotated with @Tool but returns a functional type. "
+ "This is not supported and the method will be ignored.", toolMethod.getName());
}
return isFunction;
}
The isFunctionalType method of class MethodToolCallbackProvider has a bug ( Unable to correctly determine function type ),fixed:
private boolean isFunctionalType(Method toolMethod) {
var isFunction = ClassUtils.isAssignable(Function.class, toolMethod.getReturnType())
|| ClassUtils.isAssignable(Supplier.class, toolMethod.getReturnType())
|| ClassUtils.isAssignable(Consumer.class, toolMethod.getReturnType());
if (isFunction) {
log.warn("Method {} is annotated with @Tool but returns a functional type. "
+ "This is not supported and the method will be ignored.", toolMethod.getName());
}
return isFunction;
}
Metadata
Metadata
Assignees
Labels
No labels