aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKush Thaker <[email protected]>2024-07-10 00:10:28 +0530
committerKush Thaker <[email protected]>2024-07-10 00:10:28 +0530
commit0f4453616d9ba684fb53c359cf775718f4ba938b (patch)
tree72c9d51bbc9b92676cb249760a5b8f53ed9d255e
parentchore: add prettier config (diff)
downloadsupermemory-kush/misc-be-improvements.tar.xz
supermemory-kush/misc-be-improvements.zip
update Error messages and handlingkush/misc-be-improvements
-rw-r--r--apps/cf-ai-backend/src/index.ts2
-rw-r--r--apps/web/app/actions/doers.ts8
2 files changed, 3 insertions, 7 deletions
diff --git a/apps/cf-ai-backend/src/index.ts b/apps/cf-ai-backend/src/index.ts
index a434d5b5..0844c22e 100644
--- a/apps/cf-ai-backend/src/index.ts
+++ b/apps/cf-ai-backend/src/index.ts
@@ -66,7 +66,7 @@ app.post("/api/add", zValidator("json", vectorObj), async (c) => {
console.log(body.spaces);
const chunks = chunkText(body.pageContent, 1536);
if (chunks.length > 20) {
- return c.json({ status: "error", message: "no chunks over 20" });
+ return c.json({ status: "error", message: "We are unable to process documents this size just yet, try something smaller" });
}
const chunkedInput = await batchCreateChunksAndEmbeddings({
store,
diff --git a/apps/web/app/actions/doers.ts b/apps/web/app/actions/doers.ts
index 6ce8c230..fcbab0f8 100644
--- a/apps/web/app/actions/doers.ts
+++ b/apps/web/app/actions/doers.ts
@@ -270,15 +270,11 @@ export const createMemory = async (input: {
try {
if (response.status !== "ok") {
- if (
- response.status === "error" &&
- response.message === "no chunks over 20"
- ) {
+ if (response.status === "error") {
return {
success: false,
data: 0,
- error:
- "We are unable to process documents this size just yet, try something smaller",
+ error: response.message,
};
} else {
return {