mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-09 03:18:04 +00:00
vectorize function
This commit is contained in:
parent
ee9c598013
commit
38222b91be
2 changed files with 7 additions and 0 deletions
|
|
@ -66,6 +66,8 @@ export const queue = async (batch: MessageBatch, env: Env): Promise<void> => {
|
|||
});
|
||||
});
|
||||
|
||||
console.log(collectedDocsUUIDs);
|
||||
|
||||
await store.addDocuments(
|
||||
collectedDocsUUIDs.map(({ document }) => document),
|
||||
{
|
||||
|
|
@ -81,7 +83,10 @@ export const queue = async (batch: MessageBatch, env: Env): Promise<void> => {
|
|||
body: JSON.stringify(messages),
|
||||
});
|
||||
|
||||
console.log(res.status, res.statusText);
|
||||
|
||||
if (res.status !== 200) {
|
||||
console.log(await res.json());
|
||||
console.error('Error adding tweets to db');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ export async function POST(req: NextRequest) {
|
|||
|
||||
const body = (await req.json()) as TweetData[];
|
||||
|
||||
console.log(body);
|
||||
|
||||
const resp = await fetch(
|
||||
`https://cf-ai-backend.dhravya.workers.dev/batchUploadTweets`,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue