Skip to content

Instantly share code, notes, and snippets.

@Cdaprod
Forked from hwchase17/langchain-youtube.py
Created December 5, 2023 16:08
Show Gist options
  • Save Cdaprod/fbfc638bd8ed20aa006e9eade85ad4f2 to your computer and use it in GitHub Desktop.
Save Cdaprod/fbfc638bd8ed20aa006e9eade85ad4f2 to your computer and use it in GitHub Desktop.
from langchain.document_loaders import YoutubeLoader
from langchain.indexes import VectorstoreIndexCreator
loader = YoutubeLoader.from_youtube_url("https://www.youtube.com/watch?v=fLn-WqliEQU&lc=UgyOc6oNr_4-YLGCL2R4AaABAg", add_video_info=False)
docs = loader.load()
index = VectorstoreIndexCreator()
index = index.from_documents(docs)
index.query("how can i ensure the output of an llm is in a certain format?")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment