Find answers from the community

Updated 2 years ago

Json files

At a glance

The community member is working with GPTPineconeIndex and wondering if it's possible to provide JSON files as a parameter to create new documents for an index. The comments suggest that the community member can use the SimpleDirectoryReader and the insert function to achieve this. Specifically, the community members can load the JSON data using SimpleDirectoryReader(input_files=["my_json_path.json"]).load_data() and then insert the documents into the index using index.insert(doc).

Hi, I'm currently working with GPTPineconeIndex. I was wondering if it's possible to provide JSON files as a parameter to create new documents for an index?
L
2 comments
You can use the SimpleDirectoryReader and the insert function for this I think

Plain Text
documents = SimpleDirectoryReader(input_files=["my_json_path.json"]).load_data()

for doc in documents:
    index.insert(doc)
Basically, get the document objects, and then call insert πŸ’ͺ
Add a reply
Sign up and join the conversation on Discord