Skip to content

Instantly share code, notes, and snippets.

View anand-mukul's full-sized avatar

Mukul Anand anand-mukul

  • 15:05 (UTC +05:30)
View GitHub Profile
@anand-mukul
anand-mukul / core.ts
Created October 8, 2023 06:33
Remember to replace PINECONE INDEX NAME AND ENVIRONMENT, also check .env with app.pinecone.io
import { db } from '@/db';
import { getKindeServerSession } from '@kinde-oss/kinde-auth-nextjs/server';
import { createUploadthing, type FileRouter } from 'uploadthing/next';
import { PDFLoader } from 'langchain/document_loaders/fs/pdf';
import { OpenAIEmbeddings } from 'langchain/embeddings/openai';
import { PineconeStore } from 'langchain/vectorstores/pinecone';
import { pinecone } from '@/lib/pinecone';
import { getUserSubscriptionPlan } from '@/lib/stripe';
import { PLANS } from '@/config/stripe';