code: import os 
  from llama_index.core import StorageContext, VectorStoreIndex, load_index_from_storage
  from llama_index.readers.file import PDFReader
  
  
  # def get_index(data, index_name):
  #     index = None 
  #     if not os.path.exists(index_name):
  #         print('Building index', index_name)
  #         index = VectorStoreIndex.from_documents(data, show_progress=True)
  #         index.storage_context.persist(persist_dir=index_name)
  #     else :
  #         index = load_index_from_storage(
  #             StorageContext.from_defaults(persist_dir=index_name)
  #             )
      
  #     return index
  
  # pdf_path = os.path.join('data', 'Malaysia.pdf')
  # malaysia_pdf = PDFReader().load_data(file=pdf_path)
  # malaysia_index = get_index(malaysia_pdf, 'malaysia')
  # malaysia_engine = malaysia_index.as_query_engine()
  # malaysia_engine.query()
  
  def get_index(data_files, index_name):
      index = None
      data = []
      for file_path in data_files:
          reader = PDFReader()
          data.extend(reader.load_data(file=file_path))
  
      if not os.path.exists(index_name):
          print(f'Building index {index_name}')
          index = VectorStoreIndex.from_documents(data, show_progress=True)
          index.storage_context.persist(persist_dir=index_name)
      else:
          index = load_index_from_storage(
              StorageContext.from_defaults(persist_dir=index_name)
          )
  
      return index
  
  file_paths = [
      os.path.join('data', 'Malaysia.pdf'),
      # Add more file paths here
  ]
  combined_index = get_index(file_paths, 'combined_index')
  combined_engine = combined_index.as_query_engine()
apis: llama_index.readers.file.PDFReader llama_index.core.StorageContext.from_defaults llama_index.core.VectorStoreIndex.from_documents
extract_api: [((1404, 1440), 'os.path.join', 'os.path.join', (['"""data"""', '"""Malaysia.pdf"""'], {}), "('data', 'Malaysia.pdf')\n", (1416, 1440), False, 'import os\n'), ((952, 963), 'llama_index.readers.file.PDFReader', 'PDFReader', ([], {}), '()\n', (961, 963), False, 'from llama_index.readers.file import PDFReader\n'), ((1030, 1056), 'os.path.exists', 'os.path.exists', (['index_name'], {}), '(index_name)\n', (1044, 1056), False, 'import os\n'), ((1120, 1177), 'llama_index.core.VectorStoreIndex.from_documents', 'VectorStoreIndex.from_documents', (['data'], {'show_progress': '(True)'}), '(data, show_progress=True)\n', (1151, 1177), False, 'from llama_index.core import StorageContext, VectorStoreIndex, load_index_from_storage\n'), ((1303, 1355), 'llama_index.core.StorageContext.from_defaults', 'StorageContext.from_defaults', ([], {'persist_dir': 'index_name'}), '(persist_dir=index_name)\n', (1331, 1355), False, 'from llama_index.core import StorageContext, VectorStoreIndex, load_index_from_storage\n')]