code: import os
  
  # Uncomment to specify your OpenAI API key here (local testing only, not in production!), or add corresponding environment variable (recommended)
  # os.environ['OPENAI_API_KEY']= ""
  
  from llama_index import   LLMPredictor, PromptHelper, ServiceContext
  from langchain.llms.openai import OpenAI
  from llama_index import StorageContext, load_index_from_storage
  
  base_path = os.environ.get('OPENAI_API_BASE', 'http://localhost:8080/v1')
  
  # This example uses text-davinci-003 by default; feel free to change if desired
  llm_predictor = LLMPredictor(llm=OpenAI(temperature=0, model_name="gpt-3.5-turbo", openai_api_base=base_path))
  
  # Configure prompt parameters and initialise helper
  max_input_size = 500
  num_output = 256
  max_chunk_overlap = 0.2
  
  prompt_helper = PromptHelper(max_input_size, num_output, max_chunk_overlap)
  
  # Load documents from the 'data' directory
  service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, prompt_helper=prompt_helper)
  
  # rebuild storage context
  storage_context = StorageContext.from_defaults(persist_dir='./storage')
  
  # load index
  index = load_index_from_storage(storage_context,     service_context=service_context,    )
  
  query_engine = index.as_query_engine()
  
  data = input("Question: ")
  response = query_engine.query(data)
  print(response)
  
apis: llama_index.PromptHelper llama_index.ServiceContext.from_defaults llama_index.StorageContext.from_defaults llama_index.load_index_from_storage
extract_api: [((380, 441), 'os.environ.get', 'os.environ.get', (['"""OPENAI_API_BASE"""', '"""http://localhost:8080/v1"""'], {}), "('OPENAI_API_BASE', 'http://localhost:8080/v1')\n", (394, 441), False, 'import os\n'), ((766, 825), 'llama_index.PromptHelper', 'PromptHelper', (['max_input_size', 'num_output', 'max_chunk_overlap'], {}), '(max_input_size, num_output, max_chunk_overlap)\n', (778, 825), False, 'from llama_index import LLMPredictor, PromptHelper, ServiceContext\n'), ((888, 979), 'llama_index.ServiceContext.from_defaults', 'ServiceContext.from_defaults', ([], {'llm_predictor': 'llm_predictor', 'prompt_helper': 'prompt_helper'}), '(llm_predictor=llm_predictor, prompt_helper=\n    prompt_helper)\n', (916, 979), False, 'from llama_index import LLMPredictor, PromptHelper, ServiceContext\n'), ((1020, 1073), 'llama_index.StorageContext.from_defaults', 'StorageContext.from_defaults', ([], {'persist_dir': '"""./storage"""'}), "(persist_dir='./storage')\n", (1048, 1073), False, 'from llama_index import StorageContext, load_index_from_storage\n'), ((1096, 1169), 'llama_index.load_index_from_storage', 'load_index_from_storage', (['storage_context'], {'service_context': 'service_context'}), '(storage_context, service_context=service_context)\n', (1119, 1169), False, 'from llama_index import StorageContext, load_index_from_storage\n'), ((556, 632), 'langchain.llms.openai.OpenAI', 'OpenAI', ([], {'temperature': '(0)', 'model_name': '"""gpt-3.5-turbo"""', 'openai_api_base': 'base_path'}), "(temperature=0, model_name='gpt-3.5-turbo', openai_api_base=base_path)\n", (562, 632), False, 'from langchain.llms.openai import OpenAI\n')]