aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/components/QueryAI.tsx
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-03-31 22:44:22 -0700
committerDhravya <[email protected]>2024-03-31 22:44:22 -0700
commitc40202fd04cb2541d88d2a25f2fc5dfc2128508c (patch)
tree1fa82723b3d1d25b694cfa9e64f67308e815fb69 /apps/web/src/components/QueryAI.tsx
parentMerge branch 'main' of https://github.com/Dhravya/supermemory into new-ui (diff)
downloadsupermemory-c40202fd04cb2541d88d2a25f2fc5dfc2128508c.tar.xz
supermemory-c40202fd04cb2541d88d2a25f2fc5dfc2128508c.zip
added gemini streaming in cf-ai-backend
Diffstat (limited to 'apps/web/src/components/QueryAI.tsx')
-rw-r--r--apps/web/src/components/QueryAI.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/web/src/components/QueryAI.tsx b/apps/web/src/components/QueryAI.tsx
index 811dd899..3cb14178 100644
--- a/apps/web/src/components/QueryAI.tsx
+++ b/apps/web/src/components/QueryAI.tsx
@@ -82,6 +82,11 @@ function QueryAI() {
const response = await fetch(`/api/query?q=${input}`);
+ if (response.status !== 200) {
+ setIsAiLoading(false);
+ return;
+ }
+
if (response.body) {
let reader = response.body.getReader();
let decoder = new TextDecoder('utf-8');