aboutsummaryrefslogtreecommitdiff
path: root/apps/web
diff options
context:
space:
mode:
authorKush Thaker <[email protected]>2024-07-27 22:11:10 +0530
committerKush Thaker <[email protected]>2024-07-27 22:11:10 +0530
commite8b623333def214e0ed55609f6c0b80deae17f48 (patch)
tree63e4c845d65e7b34d9d578f7c00ba56c82dad5d0 /apps/web
parentMerge pull request #140 from supermemoryai/kush/experimental-thread (diff)
downloadsupermemory-kush/fix-threads.tar.xz
supermemory-kush/fix-threads.zip
fix tweets and sourceskush/fix-threads
Diffstat (limited to 'apps/web')
-rw-r--r--apps/web/app/actions/doers.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/web/app/actions/doers.ts b/apps/web/app/actions/doers.ts
index da2bfb5f..eaaaafbd 100644
--- a/apps/web/app/actions/doers.ts
+++ b/apps/web/app/actions/doers.ts
@@ -236,7 +236,6 @@ export const createMemory = async (input: {
try {
const cf_thread_endpoint = process.env.THREAD_CF_WORKER;
const authKey = process.env.THREAD_CF_AUTH;
-
const threadRequest = await fetch(cf_thread_endpoint, {
method: "POST",
headers: {
@@ -253,6 +252,12 @@ export const createMemory = async (input: {
}
thread = await threadRequest.text();
+ if (thread.trim().length === 2) {
+ console.log("Thread is an empty array");
+ throw new Error(
+ "[THREAD FETCHING SERVICE] Got no content form thread worker",
+ );
+ }
} catch (e) {
console.log("[THREAD FETCHING SERVICE] Failed to fetch the thread", e);
errorOccurred = true;
@@ -263,7 +268,7 @@ export const createMemory = async (input: {
pageContent = tweetToMd(tweet);
console.log("THis ishte page content!!", pageContent);
//@ts-ignore
- vectorData = errorOccurred ? pageContent : thread;
+ vectorData = errorOccurred ? JSON.stringify(pageContent) : thread;
metadata = {
baseUrl: input.content,
description: tweet.text.slice(0, 200),