diff options
| author | Dhravya <[email protected]> | 2024-04-10 00:11:59 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-04-10 00:11:59 -0700 |
| commit | 338e4f378c0752e298f2a2021feda953830ddd02 (patch) | |
| tree | 534747073b32c7ec3d6ae8b54a2bf65c79b8bf87 /apps/web/src/app/api | |
| parent | removed all pnpm-lock files (diff) | |
| download | supermemory-338e4f378c0752e298f2a2021feda953830ddd02.tar.xz supermemory-338e4f378c0752e298f2a2021feda953830ddd02.zip | |
spaces in the API
Diffstat (limited to 'apps/web/src/app/api')
| -rw-r--r-- | apps/web/src/app/api/chat/route.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/web/src/app/api/chat/route.ts b/apps/web/src/app/api/chat/route.ts index ef59fd43..aec5b0ea 100644 --- a/apps/web/src/app/api/chat/route.ts +++ b/apps/web/src/app/api/chat/route.ts @@ -25,6 +25,8 @@ export async function POST(req: NextRequest) { const session = { session: sessionData[0], user: user[0] } const query = new URL(req.url).searchParams.get("q"); + const spaces = new URL(req.url).searchParams.get("spaces"); + const sourcesOnly = new URL(req.url).searchParams.get("sourcesOnly") ?? "false"; const chatHistory = await req.json() as { @@ -38,7 +40,7 @@ export async function POST(req: NextRequest) { } - const resp = await fetch(`https://cf-ai-backend.dhravya.workers.dev/chat?q=${query}&user=${session.user.email ?? session.user.name}&sourcesOnly=${sourcesOnly}`, { + const resp = await fetch(`https://cf-ai-backend.dhravya.workers.dev/chat?q=${query}&user=${session.user.email ?? session.user.name}&sourcesOnly=${sourcesOnly}&spaces=${spaces}`, { headers: { "X-Custom-Auth-Key": env.BACKEND_SECURITY_KEY, }, |