This is a Next.js API route that summarizes content from YouTube videos and web pages using LangChain and OpenAI embeddings. The API accepts a URL and generates a concise summary of the content, which is particularly useful for quickly understanding large bodies of text or video transcripts.
demo.mov
- YouTube Video Summarization: Extracts and summarizes transcripts from YouTube videos.
- Web Page Summarization: Extracts and summarizes content from web pages using Playwright.
- OpenAI Integration: Uses OpenAI embeddings to vectorize content for retrieval and summarization.
- Flexible Content Handling: Automatically detects whether the provided link is a YouTube video or a standard web page.
- LangChain: Used for creating retrieval and summarization chains.
- Next.js: The framework used for building the API.
- React: Used for building any front-end components or pages.
- Playwright: Used for web scraping to load and extract content from web pages.
- axios: Used for making HTTP requests within the application.
- Tailwind CSS: Used for styling front-end components with utility-first CSS.
- Node.js: Ensure you have Node.js installed.
- API Key: Obtain an API key from OpenAI to use for embeddings and language model processing.
- Clone the repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name
- Install dependencies:
npm install
- Set up environment variables:
OPENAI_API_KEY=your_openai_api_key
- Start the Next.js development server:
npm run dev
This will start the application on http://localhost:3000.
-
Groq API Key: You will need to enter your Groq API key in the provided input field on the UI to generate content summaries.
-
Use the provided UI to input the link of a YouTube video or a web page and obtain a summarized version of the content.