aboutsummaryrefslogtreecommitdiff
path: root/apps/cf-ai-backend/src/queueConsumer
diff options
context:
space:
mode:
authorDhravya Shah <[email protected]>2024-08-06 11:51:54 -0700
committerDhravya Shah <[email protected]>2024-08-06 11:51:54 -0700
commite652d3a10e0d0a0733a97bc96891361a8a64a007 (patch)
tree21dd173f53e4b8e747dd78175e11784a1400dac4 /apps/cf-ai-backend/src/queueConsumer
parentmake use of the promise-based thingy we're doing (diff)
downloadsupermemory-e652d3a10e0d0a0733a97bc96891361a8a64a007.tar.xz
supermemory-e652d3a10e0d0a0733a97bc96891361a8a64a007.zip
uncomment
Diffstat (limited to 'apps/cf-ai-backend/src/queueConsumer')
-rw-r--r--apps/cf-ai-backend/src/queueConsumer/index.ts36
1 files changed, 20 insertions, 16 deletions
diff --git a/apps/cf-ai-backend/src/queueConsumer/index.ts b/apps/cf-ai-backend/src/queueConsumer/index.ts
index 393f1fbf..761aeb56 100644
--- a/apps/cf-ai-backend/src/queueConsumer/index.ts
+++ b/apps/cf-ai-backend/src/queueConsumer/index.ts
@@ -202,22 +202,26 @@ export async function queue(
//add to mem0, abstract
- // const mem0Response = fetch('https://api.mem0.ai/v1/memories/', {
- // method: 'POST',
- // headers: {
- // 'Content-Type': 'application/json',
- // Authorization: `Token ${process.env.MEM0_API_KEY}`,
- // },
- // body: JSON.stringify({
- // messages: [
- // {
- // role: 'user',
- // content: query,
- // },
- // ],
- // user_id: user?.user?.email,
- // }),
- // });
+ const mem0Response = fetch("https://api.mem0.ai/v1/memories/", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Token ${env.MEM0_API_KEY}`,
+ },
+ body: JSON.stringify({
+ messages: [
+ {
+ role: "system",
+ content: `Extract information about the user based on this saved content provided, remember that the date was ${new Date().toUTCString()} in utc time zone`,
+ },
+ {
+ role: "user",
+ content: pageContent,
+ },
+ ],
+ user_id: body.user,
+ }),
+ });
// see what's up with the storedToSpaces in this block
const { store } = await initQuery(env);