diff options
| author | Kush Thaker <[email protected]> | 2024-07-27 22:11:10 +0530 |
|---|---|---|
| committer | Kush Thaker <[email protected]> | 2024-07-27 22:11:10 +0530 |
| commit | e8b623333def214e0ed55609f6c0b80deae17f48 (patch) | |
| tree | 63e4c845d65e7b34d9d578f7c00ba56c82dad5d0 /apps/cf-ai-backend/src/helper.ts | |
| parent | Merge pull request #140 from supermemoryai/kush/experimental-thread (diff) | |
| download | archived-supermemory-kush/fix-threads.tar.xz archived-supermemory-kush/fix-threads.zip | |
fix tweets and sourceskush/fix-threads
Diffstat (limited to 'apps/cf-ai-backend/src/helper.ts')
| -rw-r--r-- | apps/cf-ai-backend/src/helper.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/cf-ai-backend/src/helper.ts b/apps/cf-ai-backend/src/helper.ts index 3a15ac4d..2a68879a 100644 --- a/apps/cf-ai-backend/src/helper.ts +++ b/apps/cf-ai-backend/src/helper.ts @@ -203,7 +203,7 @@ export async function batchCreateChunksAndEmbeddings({ { const commonMetaData = { type: body.type ?? "tweet", - title: body.title, + title: body.title?.slice(0, 50) ?? "", description: body.description ?? "", url: body.url, [sanitizeKey(`user-${body.user}`)]: 1, @@ -225,6 +225,7 @@ export async function batchCreateChunksAndEmbeddings({ return { pageContent: chunk, metadata: { + content: chunk, links: tweetLinks, videos: tweetVids, tweetId: tweetId, @@ -254,7 +255,7 @@ export async function batchCreateChunksAndEmbeddings({ { const commonMetaData = { type: body.type ?? "page", - title: body.title, + title: body.title?.slice(0, 50) ?? "", description: body.description ?? "", url: body.url, [sanitizeKey(`user-${body.user}`)]: 1, @@ -271,6 +272,7 @@ export async function batchCreateChunksAndEmbeddings({ return { pageContent: chunk, metadata: { + content: chunk, ...commonMetaData, ...spaceMetadata, }, @@ -290,6 +292,7 @@ export async function batchCreateChunksAndEmbeddings({ case "note": { const commonMetaData = { + title: body.title?.slice(0, 50) ?? "", type: body.type ?? "page", description: body.description ?? "", url: body.url, @@ -307,6 +310,7 @@ export async function batchCreateChunksAndEmbeddings({ return { pageContent: chunk, metadata: { + content: chunk, ...commonMetaData, ...spaceMetadata, }, |