mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-06 02:47:54 +00:00
added category support: add and search
This commit is contained in:
parent
4380ea824a
commit
70d66b6ce7
1 changed files with 7 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ export async function GET(request: Request, _: CloudflareVectorizeStore, embeddi
|
|||
const query = queryparams.get("q");
|
||||
const topK = parseInt(queryparams.get("topK") ?? "5");
|
||||
const user = queryparams.get("user")
|
||||
const category = queryparams.get("category")
|
||||
|
||||
const sourcesOnly = (queryparams.get("sourcesOnly") ?? "false")
|
||||
|
||||
|
|
@ -25,6 +26,12 @@ export async function GET(request: Request, _: CloudflareVectorizeStore, embeddi
|
|||
}
|
||||
}
|
||||
|
||||
if (category) {
|
||||
filter.category = {
|
||||
$eq: category
|
||||
}
|
||||
}
|
||||
|
||||
const queryAsVector = await embeddings.embedQuery(query);
|
||||
|
||||
const resp = await env!.VECTORIZE_INDEX.query(queryAsVector, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue