aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-04-13 20:23:22 -0700
committerDhravya <[email protected]>2024-04-13 20:23:22 -0700
commitd70c0887d55356f745c985bb6a834a0fe9c06f30 (patch)
treea9c6dcb2e46f52982fd1a7b00ec7e528902be3f7 /apps/web/src
parentadd page data to vector db (diff)
downloadsupermemory-d70c0887d55356f745c985bb6a834a0fe9c06f30.tar.xz
supermemory-d70c0887d55356f745c985bb6a834a0fe9c06f30.zip
made pageToMemory work
Diffstat (limited to 'apps/web/src')
-rw-r--r--apps/web/src/actions/db.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/web/src/actions/db.ts b/apps/web/src/actions/db.ts
index 23f9a7ad..4d55d185 100644
--- a/apps/web/src/actions/db.ts
+++ b/apps/web/src/actions/db.ts
@@ -250,6 +250,8 @@ export async function addMemory(
const data = await resp.text();
+ console.log(data);
+
content.content = data;
}
@@ -257,6 +259,8 @@ export async function addMemory(
return null;
}
+ console.log({ ...content, user: user.email });
+
// Add to vectorDB
const res = (await Promise.race([
fetch("https://cf-ai-backend.dhravya.workers.dev/add", {
@@ -264,18 +268,18 @@ export async function addMemory(
headers: {
"X-Custom-Auth-Key": env.BACKEND_SECURITY_KEY,
},
- body: JSON.stringify({ ...content, user: user.email }),
+ body: JSON.stringify({
+ pageContent: content.content,
+ url: content.url,
+ spaces,
+ user: user.email,
+ }),
}),
new Promise((_, reject) =>
setTimeout(() => reject(new Error("Request timed out")), 40000),
),
])) as Response;
- if (res.status !== 200) {
- console.log(res.status, res.statusText);
- return null;
- }
-
const [addedMemory] = await db
.insert(storedContent)
.values({