diff --git a/apps/cf-ai-backend/src/routes/add.ts b/apps/cf-ai-backend/src/routes/add.ts index 940287e3..173c12b9 100644 --- a/apps/cf-ai-backend/src/routes/add.ts +++ b/apps/cf-ai-backend/src/routes/add.ts @@ -17,6 +17,10 @@ export async function POST(request: Request, store: CloudflareVectorizeStore, _: if (!body.pageContent || !body.url) { return new Response(JSON.stringify({ message: 'Invalid Page Content' }), { status: 400 }); } + + // TODO: FIX THIS,BUT TEMPERORILY TRIM page content to 1000 words + body.pageContent = body.pageContent.split(' ').slice(0, 1000).join(' '); + const newPageContent = `Title: ${body.title}\nDescription: ${body.description}\nURL: ${body.url}\nContent: ${body.pageContent}`; const ourID = `${body.url}-${body.user}`; @@ -31,7 +35,7 @@ export async function POST(request: Request, store: CloudflareVectorizeStore, _: { pageContent: newPageContent, metadata: { - title: body.title ?? '', + title: body.title?.slice(0, 50) ?? '', description: body.description ?? '', space: body.space ?? '', url: body.url, diff --git a/apps/cf-ai-backend/src/routes/chat.ts b/apps/cf-ai-backend/src/routes/chat.ts index 93bdd7ab..54676d70 100644 --- a/apps/cf-ai-backend/src/routes/chat.ts +++ b/apps/cf-ai-backend/src/routes/chat.ts @@ -122,6 +122,8 @@ export async function POST(request: Request, _: CloudflareVectorizeStore, embedd `You are an agent that summarizes a page based on the query. don't say 'based on the context'. I expect you to be like a 'Second Brain'. you will be provided with the context (old saved posts) and questions. Answer accordingly. Answer in markdown format` + `Context:\n${preparedContext ?? 'No context'}\n\nQuestion: ${query}\nAnswer:`; + console.log('Prompt', prompt); + // const output = await chat.sendMessageStream(prompt); // const response = new Response( diff --git a/apps/web/public/android-chrome-192x192.png b/apps/web/public/android-chrome-192x192.png new file mode 100644 index 00000000..5e57b282 Binary files /dev/null and b/apps/web/public/android-chrome-192x192.png differ diff --git a/apps/web/public/android-chrome-512x512.png b/apps/web/public/android-chrome-512x512.png new file mode 100644 index 00000000..2553425e Binary files /dev/null and b/apps/web/public/android-chrome-512x512.png differ diff --git a/apps/web/public/apple-touch-icon.png b/apps/web/public/apple-touch-icon.png new file mode 100644 index 00000000..d55c6339 Binary files /dev/null and b/apps/web/public/apple-touch-icon.png differ diff --git a/apps/web/public/favicon-16x16.png b/apps/web/public/favicon-16x16.png new file mode 100644 index 00000000..67fbac93 Binary files /dev/null and b/apps/web/public/favicon-16x16.png differ diff --git a/apps/web/public/favicon-32x32.png b/apps/web/public/favicon-32x32.png new file mode 100644 index 00000000..2fc8f0b3 Binary files /dev/null and b/apps/web/public/favicon-32x32.png differ diff --git a/apps/web/public/favicon.ico b/apps/web/public/favicon.ico new file mode 100644 index 00000000..163c3627 Binary files /dev/null and b/apps/web/public/favicon.ico differ diff --git a/apps/web/public/site.webmanifest b/apps/web/public/site.webmanifest new file mode 100644 index 00000000..fa99de77 --- /dev/null +++ b/apps/web/public/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/apps/web/src/actions/db.ts b/apps/web/src/actions/db.ts index cd1a0f1d..2c56725d 100644 --- a/apps/web/src/actions/db.ts +++ b/apps/web/src/actions/db.ts @@ -272,7 +272,7 @@ export async function addMemory( }, body: JSON.stringify({ pageContent: content.content, - title: content.title, + title: content.title?.slice(0, 50), url: content.url, user: user.email, }), diff --git a/apps/web/src/app/favicon.ico b/apps/web/src/app/favicon.ico deleted file mode 100644 index 718d6fea..00000000 Binary files a/apps/web/src/app/favicon.ico and /dev/null differ diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 42485461..81fe8f99 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -6,8 +6,8 @@ const roboto = Roboto({ weight: ["300", "400", "500"], subsets: ["latin"] }); const inter = Inter({ weight: ["300", "400", "500"], subsets: ["latin"] }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "Supermemory - Your second brain", + description: "Save your memories forever, build your own second brain.", }; export default function RootLayout({