From 1edbd217430ad490e5122707914aaf08d88647ab Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Thu, 17 Oct 2024 02:20:38 -0400 Subject: [PATCH] fix: inverted the scale on similarity threshold --- src/handlers/ask-llm.ts | 4 ++-- src/types/plugin-inputs.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/handlers/ask-llm.ts b/src/handlers/ask-llm.ts index fa8a883..cf6aeae 100644 --- a/src/handlers/ask-llm.ts +++ b/src/handlers/ask-llm.ts @@ -42,12 +42,12 @@ export async function askGpt(context: Context, question: string, formattedChat: let similarComments: CommentSimilaritySearchResult[] = []; let similarIssues: IssueSimilaritySearchResult[] = []; try { - similarComments = (await context.adapters.supabase.comment.findSimilarComments(question, similarityThreshold, "")) || []; + similarComments = (await context.adapters.supabase.comment.findSimilarComments(question, 1 - similarityThreshold, "")) || []; } catch (error) { context.logger.error(`Error fetching similar comments: ${(error as Error).message}`); } try { - similarIssues = (await context.adapters.supabase.issue.findSimilarIssues(question, similarityThreshold, "")) || []; + similarIssues = (await context.adapters.supabase.issue.findSimilarIssues(question, 1 - similarityThreshold, "")) || []; } catch (error) { context.logger.error(`Error fetching similar issues: ${(error as Error).message}`); } diff --git a/src/types/plugin-inputs.ts b/src/types/plugin-inputs.ts index 694bb50..a98f0be 100644 --- a/src/types/plugin-inputs.ts +++ b/src/types/plugin-inputs.ts @@ -22,7 +22,7 @@ export interface PluginInputs