pinecone.init(api_key=os.getenv("PINECONE_API_KEY"), environment=os.getenv("PINECONE_ENV")) openai.api_key = os.getenv("OPENAI_API_KEY") pinecone_index = pinecone.Index("messe-chatbot") index_store = MongoIndexStore.from_uri(uri=os.getenv( "MONGODB_URI"), db_name=os.getenv("MONGODB_DATABASE")) vector_store = PineconeVectorStore(pinecone_index=pinecone_index) llm_predictor = LLMPredictor(llm=ChatOpenAI( temperature=0, model_name='gpt-3.5-turbo')) llama_debug = LlamaDebugHandler(print_trace_on_end=True) callback_manager = CallbackManager([llama_debug]) service_context = ServiceContext.from_defaults( llm_predictor=llm_predictor, num_output=512, callback_manager=callback_manager )