aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/app
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-04-08 18:39:32 -0700
committerDhravya <[email protected]>2024-04-08 18:39:32 -0700
commitafd14a5dcdea26b98463dc8d643dabc9a4a16255 (patch)
treef74c859a81a81a582e77446e5ccf9866a1aefb73 /apps/web/src/app
parentsetup for multi chat (diff)
downloadsupermemory-afd14a5dcdea26b98463dc8d643dabc9a4a16255.tar.xz
supermemory-afd14a5dcdea26b98463dc8d643dabc9a4a16255.zip
messages streaminug
Diffstat (limited to 'apps/web/src/app')
-rw-r--r--apps/web/src/app/api/chat/route.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/web/src/app/api/chat/route.ts b/apps/web/src/app/api/chat/route.ts
index 2cb03186..ef59fd43 100644
--- a/apps/web/src/app/api/chat/route.ts
+++ b/apps/web/src/app/api/chat/route.ts
@@ -31,22 +31,25 @@ export async function POST(req: NextRequest) {
chatHistory: ChatHistory[]
};
+ console.log("CHathistory", chatHistory)
if (!query) {
return new Response(JSON.stringify({ message: "Invalid query" }), { status: 400 });
}
+
const resp = await fetch(`https://cf-ai-backend.dhravya.workers.dev/chat?q=${query}&user=${session.user.email ?? session.user.name}&sourcesOnly=${sourcesOnly}`, {
headers: {
"X-Custom-Auth-Key": env.BACKEND_SECURITY_KEY,
},
method: "POST",
body: JSON.stringify({
- chatHistory
+ chatHistory: chatHistory.chatHistory ?? []
})
})
console.log(resp.status)
+ console.log(resp.statusText)
if (resp.status !== 200 || !resp.ok) {
const errorData = await resp.json();