code: import os, streamlit as st
  
  # 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 GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor, PromptHelper
  from langchain import OpenAI
  
  # This example uses text-davinci-003 by default; feel free to change if desired
  llm_predictor = LLMPredictor(llm=OpenAI(temperature=0, model_name="text-davinci-003"))
  
  # Configure prompt parameters and initialise helper
  max_input_size = 4096
  num_output = 256
  max_chunk_overlap = 20
  
  prompt_helper = PromptHelper(max_input_size, num_output, max_chunk_overlap)
  
  # Load documents from the 'data' directory
  documents = SimpleDirectoryReader('data').load_data()
  index = GPTSimpleVectorIndex(
      documents, llm_predictor=llm_predictor, prompt_helper=prompt_helper
  )
  
  # Define a simple Streamlit app
  st.title("Ask Llama")
  query = st.text_input("What would you like to ask?", "")
  
  if st.button("Submit"):
      response = index.query(query)
      st.write(response)
  
apis: llama_index.PromptHelper llama_index.GPTSimpleVectorIndex llama_index.SimpleDirectoryReader
extract_api: [((635, 694), 'llama_index.PromptHelper', 'PromptHelper', (['max_input_size', 'num_output', 'max_chunk_overlap'], {}), '(max_input_size, num_output, max_chunk_overlap)\n', (647, 694), False, 'from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor, PromptHelper\n'), ((801, 895), 'llama_index.GPTSimpleVectorIndex', 'GPTSimpleVectorIndex', (['documents'], {'llm_predictor': 'llm_predictor', 'prompt_helper': 'prompt_helper'}), '(documents, llm_predictor=llm_predictor, prompt_helper=\n    prompt_helper)\n', (821, 895), False, 'from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor, PromptHelper\n'), ((930, 951), 'streamlit.title', 'st.title', (['"""Ask Llama"""'], {}), "('Ask Llama')\n", (938, 951), True, 'import os, streamlit as st\n'), ((960, 1008), 'streamlit.text_input', 'st.text_input', (['"""What would you like to ask?"""', '""""""'], {}), "('What would you like to ask?', '')\n", (973, 1008), True, 'import os, streamlit as st\n'), ((1013, 1032), 'streamlit.button', 'st.button', (['"""Submit"""'], {}), "('Submit')\n", (1022, 1032), True, 'import os, streamlit as st\n'), ((1072, 1090), 'streamlit.write', 'st.write', (['response'], {}), '(response)\n', (1080, 1090), True, 'import os, streamlit as st\n'), ((449, 501), 'langchain.OpenAI', 'OpenAI', ([], {'temperature': '(0)', 'model_name': '"""text-davinci-003"""'}), "(temperature=0, model_name='text-davinci-003')\n", (455, 501), False, 'from langchain import OpenAI\n'), ((751, 780), 'llama_index.SimpleDirectoryReader', 'SimpleDirectoryReader', (['"""data"""'], {}), "('data')\n", (772, 780), False, 'from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor, PromptHelper\n')]