Skip to content

Commit 6a3b21f

Browse files
authored
adding Supabase default assumptions
1 parent 22e2b73 commit 6a3b21f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

examples/src/retrievers/supabase_hybrid.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ export const run = async () => {
1212

1313
const retriever = new SupabaseHybridSearch(embeddings, {
1414
client,
15+
// Below are the defaults, expecting that you set up your supabase table and functions according to the guide above. Please change if necessary.
1516
similarityK: 2,
1617
keywordK: 2,
18+
tableName: "documents",
19+
similarityQueryName: "match_documents",
20+
keywordQueryName: "kw_match_documents",
1721
});
1822

1923
const results = await retriever.getRelevantDocuments("hello bye");

langchain/src/retrievers/supabase-hybrid-search.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,24 @@ type SearchResult = [Document, number, number];
2424

2525
export interface SupabaseLibArgs {
2626
client: SupabaseClient;
27+
/**
28+
* The table name on Supabase. Defaults to "documents".
29+
*/
2730
tableName?: string;
31+
/**
32+
* The name of the Similarity search function on Supabase. Defaults to "match_documents".
33+
*/
2834
similarityQueryName?: string;
35+
/**
36+
* The name of the Keyword search function on Supabase. Defaults to "kw_match_documents".
37+
*/
2938
keywordQueryName?: string;
3039
/**
31-
* The number of documents to return from the similarity search
40+
* The number of documents to return from the similarity search. Defaults to 2.
3241
*/
3342
similarityK?: number;
3443
/**
35-
* The number of documents to return from the keyword search
44+
* The number of documents to return from the keyword search. Defaults to 2.
3645
*/
3746
keywordK?: number;
3847
}

0 commit comments

Comments
 (0)