code: from key1 import KEY
  from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader
  
  
  from llama_index import download_loader, StorageContext
  import os
  import openai
  
  os.environ['OPENAI_API_KEY'] = KEY
  
  
  def create_vector(dir):
      documents = SimpleDirectoryReader("data").load_data()
      index = GPTVectorStoreIndex.from_documents(documents)
  
      storage_context = StorageContext.from_defaults()
      index.storage_context.persist(f"./vector/{dir}")
      print ("Done")
  '''
  
  def create_vector():
      documents = SimpleDirectoryReader("data").load_data()
      index = GPTVectorStoreIndex([])
  
      for doc in documents:
          index.insert(doc)
  
      storage_context = StorageContext.from_defaults()
      print (dir(index.storage_context.index_store))
      index.storage_context.persist("./vectordatabase")
      print ("Done")
  
  
  '''
  
apis: llama_index.GPTVectorStoreIndex.from_documents llama_index.StorageContext.from_defaults llama_index.SimpleDirectoryReader
extract_api: [((302, 347), 'llama_index.GPTVectorStoreIndex.from_documents', 'GPTVectorStoreIndex.from_documents', (['documents'], {}), '(documents)\n', (336, 347), False, 'from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader\n'), ((371, 401), 'llama_index.StorageContext.from_defaults', 'StorageContext.from_defaults', ([], {}), '()\n', (399, 401), False, 'from llama_index import download_loader, StorageContext\n'), ((248, 277), 'llama_index.SimpleDirectoryReader', 'SimpleDirectoryReader', (['"""data"""'], {}), "('data')\n", (269, 277), False, 'from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader\n')]