32 public Object
apply(Map<String, Object> arguments) {
33 LinkedHashMap<String, Object> argumentsCopy =
new LinkedHashMap<>(this.propertyDefinition);
34 for (Map.Entry<String, String> param :
this.propertyDefinition.entrySet()) {
35 argumentsCopy.replace(
36 param.getKey(), typeCast(arguments.get(param.getKey()), param.getValue()));
39 return function.invoke(functionHolder, argumentsCopy.values().toArray());
40 }
catch (Exception e) {
41 throw new RuntimeException(
"Failed to invoke tool: " +
function.getName(), e);