NameError: name 'LCDocument' is not defined
が出るときの対応方法
原因:generate.pyのバグ
修正方法 :
from langchain_core.documents import Document as LCDocument を if t.TYPE_CHECKING: の外に出す
修正前
26 from ragas.testset.transforms import Transforms, apply_transforms, default_transforms 27 28 if t.TYPE_CHECKING: 29 from langchain_core.callbacks import Callbacks 30 from langchain_core.documents import Document as LCDocument
修正後
26 from ragas.testset.transforms import Transforms, apply_transforms, default_transforms 27 from langchain_core.documents import Document as LCDocument 28 29 if t.TYPE_CHECKING: 30 from langchain_core.callbacks import Callbacks
generate.py は ~/.local/lib/python3.12/site-packages/ragas/testset/synthesizers 等にある
ragas の バージョン Version: 0.2.10.dev3+ge732231