import openai openai.api_key = ".."
from llama_index.embeddings.openai import OpenAIEmbedding emebd_model = OpenAIEmbedding(api_key="....") service_context = ServiceContext.from_defaults(emebd_model=embed_model)
from llama_index import set_global_service_context set_global_service_context(service_context)