Skip to content

Commit

Permalink
updated similarity search logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Amruth-Vamshi committed Nov 7, 2023
1 parent 20ff87f commit 9759669
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/xstate/prompt/prompt.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Language } from "../../language";
import { CustomLogger } from "../../common/logger";
import { generalPrompt, restructureContentPrompt } from "../../common/constants";
import { flagsmith } from "../../common/flagsmith";
import { filterUnique } from "./prompt.utils";
import { filterUnique, uniqueUnion } from "./prompt.utils";
const fetch = require('node-fetch');
const { Headers } = fetch;

Expand Down Expand Up @@ -238,6 +238,10 @@ export const promptServices = {
if (intersectionSet.size === 0) {
intersectionSet = new Set([...C].filter((x) => A.includes(x)));
}
if(intersectionSet.size === 1){
for(const data of hitsContent)
relevantCorpus.push(data.id)
}
if (intersectionSet.size > 0) {
caseMatched = 4;
relevantCorpus.push(...intersectionSet);
Expand Down

0 comments on commit 9759669

Please sign in to comment.