This is a Streamlit app for chatting with YouTube videos using Langchain, a Python library for building AI-powered chatbots that can answer questions based on documents. The app allows users to input a YouTube video URL, which is then transcribed and indexed to allow users to ask questions about the video. The app uses OpenAI for text embeddings and Langchain for question-answering with context.
- Python 3.7 or above
- Required packages:
langchain
,streamlit
,openai
- A valid OpenAI API key
- Clone the repository
- Install the required packages using
pip install -r requirements.txt
- Set your OpenAI API key by running the command
streamlit run main.py
and entering your key in the sidebar. - Run the app using
streamlit run main.py
- Enter a YouTube video URL in the sidebar and click submit.
- Ask a question about the video in the text area and click submit.
main.py
: The main file containing the Streamlit app.yt_loader.py
: Contains the functioningest_youtube_video_url
for transcribing YouTube videos.utils.py
: Contains helper functions for processing the video transcript and embedding the text.template.py
: Contains the prompt template used for Langchain's question-answering model.