mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
prepare statement
This commit is contained in:
parent
93c49b6560
commit
22effd214c
3 changed files with 6 additions and 3 deletions
|
|
@ -60,8 +60,9 @@ export async function POST(request: Request, _: CloudflareVectorizeStore, embedd
|
|||
// if (responses.count === 0) {
|
||||
// return new Response(JSON.stringify({ message: "No Results Found" }), { status: 404 });
|
||||
// }
|
||||
console.log(responses.matches);
|
||||
|
||||
const highScoreIds = responses.matches.filter(({ score }) => score > 0.35).map(({ id }) => id);
|
||||
const highScoreIds = responses.matches.filter(({ score }) => score > 0.3).map(({ id }) => id);
|
||||
|
||||
if (sourcesOnly === 'true') {
|
||||
return new Response(JSON.stringify({ ids: highScoreIds }), { status: 200 });
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ CREATE TABLE `session` (
|
|||
--> statement-breakpoint
|
||||
CREATE TABLE `space` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`name` text DEFAULT 'all' NOT NULL,
|
||||
`name` text DEFAULT 'none' NOT NULL,
|
||||
`user` text(255),
|
||||
FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
|
||||
);
|
||||
|
|
@ -47,6 +47,7 @@ CREATE TABLE `storedContent` (
|
|||
`url` text NOT NULL,
|
||||
`savedAt` integer NOT NULL,
|
||||
`baseUrl` text(255),
|
||||
`type` text DEFAULT 'page',
|
||||
`image` text(255),
|
||||
`user` text(255),
|
||||
FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
|
||||
|
|
@ -69,6 +70,7 @@ CREATE TABLE `verificationToken` (
|
|||
--> statement-breakpoint
|
||||
CREATE INDEX `account_userId_idx` ON `account` (`userId`);--> statement-breakpoint
|
||||
CREATE INDEX `session_userId_idx` ON `session` (`userId`);--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `space_name_unique` ON `space` (`name`);--> statement-breakpoint
|
||||
CREATE INDEX `spaces_name_idx` ON `space` (`name`);--> statement-breakpoint
|
||||
CREATE INDEX `spaces_user_idx` ON `space` (`user`);--> statement-breakpoint
|
||||
CREATE INDEX `storedContent_url_idx` ON `storedContent` (`url`);--> statement-breakpoint
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ export async function POST(req: NextRequest) {
|
|||
let storeToSpace = data.space;
|
||||
|
||||
if (!storeToSpace) {
|
||||
storeToSpace = "all";
|
||||
storeToSpace = "none";
|
||||
}
|
||||
|
||||
const storedContentId = await db.insert(storedContent).values({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue