Skip to content

Instantly share code, notes, and snippets.

@hwchase17
Created May 6, 2023 21:37
Show Gist options
  • Save hwchase17/aa78ad6fcb43d84665bdf2cf03afbc8e to your computer and use it in GitHub Desktop.
Save hwchase17/aa78ad6fcb43d84665bdf2cf03afbc8e 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