Skip to content

Commit

Permalink
Fixed a bug that prevented using @Usermessage in AI Services (langcha…
Browse files Browse the repository at this point in the history
  • Loading branch information
langchain4j authored Jul 16, 2023
1 parent 120c6a0 commit 77a767a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ private static void validateParameters(Method method) {
for (Parameter parameter : parameters) {
V v = parameter.getAnnotation(V.class);
UserMessage userMessage = parameter.getAnnotation(UserMessage.class);
if (v == null && userMessage == null) {
throw illegalConfiguration("Parameter '%s' of method '%s' should be annotated either with @V or @UserMessage", parameter.getName(), method.getName());
UserName userName = parameter.getAnnotation(UserName.class);
if (v == null && userMessage == null && userName == null) {
throw illegalConfiguration("Parameter '%s' of method '%s' should be annotated either with @V or @UserMessage or @UserName", parameter.getName(), method.getName());
}
}
}
Expand Down

0 comments on commit 77a767a

Please sign in to comment.