Skip to content

Commit

Permalink
fix: inverted the scale on similarity threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Oct 17, 2024
1 parent baec08a commit 1edbd21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/handlers/ask-llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/plugin-inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface PluginInputs<T extends SupportedEventsU = SupportedEventsU, TU
export const pluginSettingsSchema = T.Object({
model: T.String({ default: "o1-mini" }),
openAiBaseUrl: T.Optional(T.String()),
similarityThreshold: T.Number({ default: 0.1 }),
similarityThreshold: T.Number({ default: 0.9 }),
});

export const pluginSettingsValidator = new StandardValidator(pluginSettingsSchema);
Expand Down

0 comments on commit 1edbd21

Please sign in to comment.