Skip to content

Commit bbec975

Browse files
author
Milder Hernandez Cagua
committed
Merge branch 'main' of https://github.com/microsoft/semantic-kernel-java into sql-query-formatting
2 parents 9a04ada + 0fd0ce5 commit bbec975

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

  • semantickernel-experimental/src/main/java/com/microsoft/semantickernel/data/vectorstorage/options

semantickernel-experimental/src/main/java/com/microsoft/semantickernel/data/vectorstorage/options/VectorSearchOptions.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public VectorSearchOptions(BasicVectorSearchFilter basicVectorSearchFilter,
3434
String vectorFieldName, int limit, int offset, boolean includeVectors) {
3535
this.basicVectorSearchFilter = basicVectorSearchFilter;
3636
this.vectorFieldName = vectorFieldName;
37-
this.limit = limit;
38-
this.offset = offset;
37+
this.limit = Math.max(1, limit);
38+
this.offset = Math.max(0, offset);
3939
this.includeVectors = includeVectors;
4040
}
4141

@@ -134,10 +134,6 @@ public Builder withIncludeVectors(boolean includeVectors) {
134134

135135
@Override
136136
public VectorSearchOptions build() {
137-
if (limit < 1) {
138-
throw new SKException("The limit must be greater than 0.");
139-
}
140-
141137
return new VectorSearchOptions(basicVectorSearchFilter, vectorFieldName, limit, offset,
142138
includeVectors);
143139
}

0 commit comments

Comments
 (0)