Skip to content

Commit a2a6dc3

Browse files
authored
Fixed incorrect variable usage in MethodToolCallback.java
Signed-off-by: DaliangZhou <[email protected]>
1 parent 5864255 commit a2a6dc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-ai-model/src/main/java/org/springframework/ai/tool/method/MethodToolCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private void validateToolContextSupport(@Nullable ToolContext toolContext) {
119119
var isNonEmptyToolContextProvided = toolContext != null && !CollectionUtils.isEmpty(toolContext.getContext());
120120
var isToolContextAcceptedByMethod = Stream.of(toolMethod.getParameterTypes())
121121
.anyMatch(type -> ClassUtils.isAssignable(type, ToolContext.class));
122-
if (isToolContextAcceptedByMethod && !isNonEmptyToolContextProvided) {
122+
if (isNonEmptyToolContextProvided && !isToolContextAcceptedByMethod) {
123123
throw new IllegalArgumentException("ToolContext is required by the method as an argument");
124124
}
125125
}

0 commit comments

Comments
 (0)