from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader | |
from pathlib import Path | |
from llama_index import download_loader | |
import os | |
os.environ["OPENAI_API_KEY"] = "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" | |
PandasCSVReader = download_loader("PandasCSVReader") | |
loader = PandasCSVReader() | |
documents = loader.load_data(file=Path('./input.csv')) | |
index = GPTSimpleVectorIndex(documents) | |
index.save_to_disk('./output.json') |