Skip to content

Commit a07e22c

Browse files
vikhyat90HavenDV
andauthored
fix: bug fix for VectorSearchType.SimilarityScoreThreshold (#290)
* bug fix for VectorSearchType.SimilarityScoreThreshold initializing ScoreThreshold value * Update VectorStoreRetriever.cs --------- Co-authored-by: Konstantin S <havendv@gmail.com>
1 parent 9e46ac5 commit a07e22c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Core/src/Retrievers/VectorStoreRetriever.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@ public VectorStoreRetriever(
3636
float? scoreThreshold = null)
3737
{
3838
SearchType = searchType;
39+
ScoreThreshold = scoreThreshold;
3940

4041
if (SearchType == VectorSearchType.SimilarityScoreThreshold && ScoreThreshold == null)
4142
throw new ArgumentException($"ScoreThreshold required for {SearchType}");
4243

4344
EmbeddingModel = embeddingModel;
4445
VectorCollection = vectorCollection;
45-
SearchType = searchType;
46-
ScoreThreshold = scoreThreshold;
4746
}
4847

4948
/// <inheritdoc/>
@@ -71,4 +70,4 @@ public Task<IReadOnlyCollection<string>> AddDocumentsAsync(IReadOnlyCollection<D
7170
{
7271
return VectorCollection.AddDocumentsAsync(EmbeddingModel, documents);
7372
}
74-
}
73+
}

0 commit comments

Comments
 (0)