Skip to content

Commit

Permalink
add missing size validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed Dec 13, 2024
1 parent 9634945 commit 54458e3
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,17 @@ public ActionRequestValidationException validate(
for (RetrieverSource innerRetriever : innerRetrievers) {
validationException = innerRetriever.retriever().validate(source, validationException, isScroll, allowPartialSearchResults);
if (innerRetriever.retriever() instanceof CompoundRetrieverBuilder<?> compoundChild) {
String errorMessage = String.format(
Locale.ROOT,
"[%s] requires [rank_window_size: %d] to be smaller than or equal to its sub retriever's %s [rank_window_size: %d]",
this.getName(),
rankWindowSize,
compoundChild.getName(),
compoundChild.rankWindowSize
);
validationException = addValidationError(errorMessage, validationException);
if (rankWindowSize > compoundChild.rankWindowSize) {
String errorMessage = String.format(
Locale.ROOT,
"[%s] requires [rank_window_size: %d] to be smaller than or equal to its sub retriever's %s [rank_window_size: %d]",
this.getName(),
rankWindowSize,
compoundChild.getName(),
compoundChild.rankWindowSize
);
validationException = addValidationError(errorMessage, validationException);
}
}
}
return validationException;
Expand Down

0 comments on commit 54458e3

Please sign in to comment.