code: from typing import List
  import streamlit as st
  import os, shutil
  from llama_index import VectorStoreIndex, ServiceContext, Document
  from llama_index.llms import OpenAI
  from llama_index import SimpleDirectoryReader
  
  
  def load_data():
      reader = SimpleDirectoryReader(input_dir="src/data", recursive=True)
      docs = reader.load_data()
      return docs
  
  
  def RAG(_config, _docs):
      service_context = ServiceContext.from_defaults(
          llm=OpenAI(
              model=_config.gpt_model,
              temperature=_config.temperature,
              max_tokens=_config.max_tokens,
              system_prompt=_config.llm_system_role,
          ),
          chunk_size=_config.chunk_size,
      )
      index = VectorStoreIndex.from_documents(_docs, service_context=service_context)
      return index
  
  
  def delete_data():
      print("Cleaning the data folder")
      folder = "src/data"
      for filename in os.listdir(folder):
          if filename != ".gitignore":
              file_path = os.path.join(folder, filename)
              try:
                  if os.path.isfile(file_path) or os.path.islink(file_path):
                      os.unlink(file_path)
                  elif os.path.isdir(file_path):
                      shutil.rmtree(file_path)
              except Exception as e:
                  print("Failed to delete %s. Reason: %s" % (file_path, e))
  
apis: llama_index.VectorStoreIndex.from_documents llama_index.llms.OpenAI llama_index.SimpleDirectoryReader
extract_api: [((246, 305), 'llama_index.SimpleDirectoryReader', 'SimpleDirectoryReader', ([], {'input_dir': '"""src/data"""', 'recursive': '(True)'}), "(input_dir='src/data', recursive=True)\n", (267, 305), False, 'from llama_index import SimpleDirectoryReader\n'), ((695, 766), 'llama_index.VectorStoreIndex.from_documents', 'VectorStoreIndex.from_documents', (['_docs'], {'service_context': 'service_context'}), '(_docs, service_context=service_context)\n', (726, 766), False, 'from llama_index import VectorStoreIndex, ServiceContext, Document\n'), ((887, 905), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (897, 905), False, 'import os, shutil\n'), ((443, 582), 'llama_index.llms.OpenAI', 'OpenAI', ([], {'model': '_config.gpt_model', 'temperature': '_config.temperature', 'max_tokens': '_config.max_tokens', 'system_prompt': '_config.llm_system_role'}), '(model=_config.gpt_model, temperature=_config.temperature, max_tokens\n    =_config.max_tokens, system_prompt=_config.llm_system_role)\n', (449, 582), False, 'from llama_index.llms import OpenAI\n'), ((968, 998), 'os.path.join', 'os.path.join', (['folder', 'filename'], {}), '(folder, filename)\n', (980, 998), False, 'import os, shutil\n'), ((1035, 1060), 'os.path.isfile', 'os.path.isfile', (['file_path'], {}), '(file_path)\n', (1049, 1060), False, 'import os, shutil\n'), ((1064, 1089), 'os.path.islink', 'os.path.islink', (['file_path'], {}), '(file_path)\n', (1078, 1089), False, 'import os, shutil\n'), ((1111, 1131), 'os.unlink', 'os.unlink', (['file_path'], {}), '(file_path)\n', (1120, 1131), False, 'import os, shutil\n'), ((1153, 1177), 'os.path.isdir', 'os.path.isdir', (['file_path'], {}), '(file_path)\n', (1166, 1177), False, 'import os, shutil\n'), ((1199, 1223), 'shutil.rmtree', 'shutil.rmtree', (['file_path'], {}), '(file_path)\n', (1212, 1223), False, 'import os, shutil\n')]