Q&A
実現したいこと
下記URLのようにWebページをスクレイビングしたうえで、AIを利用したいです。
https://dev.classmethod.jp/articles/llama-index-developersio-articles/
ここの「Indexロード+クエリコード」のところをしようとしていますが、エラーとなってしまいます。
環境
Windows11
Python 3.10.10
Llama-index 0.4.33
発生している問題・エラーメッセージ
AttributeError: 'ChatGPTLLMPredictor' object has no attribute '_llm'. Did you mean: 'llm'?
該当のソースコード
Python
1# query.py 2import os 3os.environ["OPENAI_API_KEY"] = 'sk-XXXXX' 4 5 6from llama_index import GPTSimpleVectorIndex 7from llama_index.langchain_helpers.chatgpt import ChatGPTLLMPredictor 8 9index = GPTSimpleVectorIndex.load_from_disk('tmp/index.json', llm_predictor=ChatGPTLLMPredictor()) 10answer = index.query("原神ってなに") 11print(answer)
試したこと
特に何をすればいいのか検討もつかず何も試してないです。
類似事象としてこんなものも紹介されていました。
https://github.com/jerryjliu/llama_index/issues/587
回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。