Skip to content

Commit

Permalink
vectorize function
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhravya committed Apr 13, 2024
1 parent ee9c598 commit 38222b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/cf-ai-backend/src/routes/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export const queue = async (batch: MessageBatch, env: Env): Promise<void> => {
});
});

console.log(collectedDocsUUIDs);

await store.addDocuments(
collectedDocsUUIDs.map(({ document }) => document),
{
Expand All @@ -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');
}

Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/app/api/vectorizeTweets/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
{
Expand Down

0 comments on commit 38222b9

Please sign in to comment.