code: # My OpenAI Key
  import logging
  import os
  import sys
  
  from IPython.display import Markdown, display
  from llama_index import GPTTreeIndex, SimpleDirectoryReader
  
  logging.basicConfig(stream=sys.stdout, level=logging.INFO)
  logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
  
  os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY")
  
  documents = SimpleDirectoryReader("data").load_data()
  index = GPTTreeIndex.from_documents(documents)
  
  index.save_to_disk("index.json")
  
  # try loading
  new_index = GPTTreeIndex.load_from_disk("index.json")
  
  # set Logging to DEBUG for more detailed outputs
  response = new_index.query("What did the author do growing up?")
  
  print(response)
  
  # set Logging to DEBUG for more detailed outputs
  response = new_index.query("What did the author do after his time at Y Combinator?")
  
  print(response)
  
apis: llama_index.SimpleDirectoryReader llama_index.GPTTreeIndex.load_from_disk llama_index.GPTTreeIndex.from_documents
extract_api: [((160, 218), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO'}), '(stream=sys.stdout, level=logging.INFO)\n', (179, 218), False, 'import logging\n'), ((324, 351), 'os.getenv', 'os.getenv', (['"""OPENAI_API_KEY"""'], {}), "('OPENAI_API_KEY')\n", (333, 351), False, 'import os\n'), ((415, 453), 'llama_index.GPTTreeIndex.from_documents', 'GPTTreeIndex.from_documents', (['documents'], {}), '(documents)\n', (442, 453), False, 'from llama_index import GPTTreeIndex, SimpleDirectoryReader\n'), ((515, 556), 'llama_index.GPTTreeIndex.load_from_disk', 'GPTTreeIndex.load_from_disk', (['"""index.json"""'], {}), "('index.json')\n", (542, 556), False, 'from llama_index import GPTTreeIndex, SimpleDirectoryReader\n'), ((250, 290), 'logging.StreamHandler', 'logging.StreamHandler', ([], {'stream': 'sys.stdout'}), '(stream=sys.stdout)\n', (271, 290), False, 'import logging\n'), ((219, 238), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (236, 238), False, 'import logging\n'), ((365, 394), 'llama_index.SimpleDirectoryReader', 'SimpleDirectoryReader', (['"""data"""'], {}), "('data')\n", (386, 394), False, 'from llama_index import GPTTreeIndex, SimpleDirectoryReader\n')]