text-embedding-ada-002
from OpenAI)import os import openai os.environ["OPENAI_API_KEY"] = "sk-..." openai.api_key = os.environ["OPENAI_API_KEY"]
import os
import openai
from llama_index import SimpleDirectoryReader, VectorStoreIndex
os.environ["OPENAI_API_KEY"] = "sk-"
openai.api_key = "sk-"
documents = SimpleDirectoryReader('data').load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("What did the author do growing up?")
print(response)