Query_PDFs / matt_function.py
Dylan-Kaneshiro's picture
Update matt_function.py
a15bc19
raw
history blame contribute delete
No virus
427 Bytes
from llama_index.llms import OpenAI
from llama_index import VectorStoreIndex, SimpleDirectoryReader
def create_VSI(files, index): #add vsi and filepaths
pathnames = [file.name for file in files]
documents = SimpleDirectoryReader(input_files=pathnames).load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
return query_engine, "Upload complete"