エラー内容
GPTindexでChatGPTLLMPredictorを使おうと、するとエラーが出る
(いくつかの使用記事があるが、現在は使えないよう)
AttributeError: 'ChatGPTLLMPredictor' object has no attribute '_llm'
解決法
githubのissueを確認すると、製作者から以下のコメントがある
要するに、ChatGPTLLMPredictorはもうサポートしないとのこと。
代わりの方法が以下のnotebookに記載されている
要約すると大体以下の通り
from gpt_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor
from langchain.chat_models import ChatOpenAI
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo"))