Skip to content

Commit

Permalink
tutorial21
Browse files Browse the repository at this point in the history
  • Loading branch information
ronidas39 committed Dec 24, 2023
1 parent 3a08d1a commit 038a92e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tutorial21/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from langchain.document_loaders import UnstructuredExcelLoader
from langchain.chains.question_answering import load_qa_chain
from langchain.chat_models import ChatOpenAI
from langchain.indexes import VectorstoreIndexCreator
from langchain.chains import RetrievalQA
loader=UnstructuredExcelLoader("trending_football_players.xlsx")
index=VectorstoreIndexCreator()
doc=index.from_loaders([loader])
chain=RetrievalQA.from_chain_type(llm=ChatOpenAI(temperature=0,model="gpt-4"),chain_type="stuff",retriever=doc.vectorstore.as_retriever(),input_key="question")
query="who has the lowest total stats"
response=chain({"question":query})
print(response)
Binary file modified tutorial21/tutorial21.pptx
Binary file not shown.

0 comments on commit 038a92e

Please sign in to comment.