File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
services/video-search/src Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ export default function initialize({
5353 question,
5454 } ) ;
5555
56+ /**
57+ * Scores will be between 0 and 1, where 0 is most accurate and 1 is least accurate
58+ */
5659 const [ result ] = await answerVectorStore . similaritySearchWithScore (
5760 question ,
5861 1 ,
@@ -64,7 +67,7 @@ export default function initialize({
6467 score : result [ 1 ] ,
6568 } ) ;
6669
67- if ( result [ 1 ] < 0.2 ) {
70+ if ( result [ 1 ] < config . searches . maxSimilarityScore ) {
6871 log . debug ( `Found answer to question ${ question } ` , {
6972 location : `${ prefix } .search.getAnswer` ,
7073 } ) ;
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export default {
5252 } ,
5353 searches : {
5454 KNN : 3 ,
55+ maxSimilarityScore : 0.2 ,
5556 answerCache : true ,
5657 } ,
5758 log : {
You can’t perform that action at this time.
0 commit comments