Open dividor opened 4 weeks ago
Hey @dividor! 👋 I'm here to help you out with any bugs or questions you have. I'm a bot that can assist with problem-solving and answering queries while you wait for a human maintainer.
The ImportError
occurs because context_precision
is not defined as a module-level variable in ragas.metrics
. Instead, it is defined within src/ragas/metrics/_context_precision.py
.
To resolve this issue, you can import context_precision
directly from ragas.metrics._context_precision
:
from ragas.metrics._context_precision import context_precision
Alternatively, you can import it directly from ragas.metrics
as it is included in the __all__
list in the src/ragas/metrics/__init__.py
file:
from ragas.metrics import context_precision
This should resolve the ImportError
you are encountering [1][2].
To continue talking to Dosu, mention @dosu.
[X ] I have checked the documentation and related resources and couldn't resolve my bug.
Describe the bug I am trying to follow this documentation, but it doesn't work because
context_precision
seems to be missing.Ragas version: ragas-0.1.14 Python version: 3.11.4
Code to Reproduce The code from Ragas' documentation ...
Error trace
Expected behavior The documented code should work.
Additional context RAGAs is great, thanks!