Skip to content

Commit ec94f4e

Browse files
authored
chore: added ragas.experimental and cleaned dependencies (#2119)
1 parent 9ca3074 commit ec94f4e

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

experimental/pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ classifiers = [
2222
"Programming Language :: Python :: 3.12",
2323
]
2424
dependencies = [
25-
"fastcore",
2625
"tqdm",
27-
"langfuse",
2826
"instructor",
2927
"pydantic",
3028
"numpy",
31-
"plotly",
32-
"mlflow",
3329
"gitpython",
34-
"httpx",
30+
"typer",
31+
"rich",
3532
]
3633
# Only version remains dynamic (managed by setuptools_scm)
3734
dynamic = ["version"]
@@ -40,6 +37,7 @@ readme = "README.md"
4037
[project.optional-dependencies]
4138
all = ["pandas"]
4239
examples = ["openai>=1.0.0"]
40+
tracing = ["langfuse", "mlflow"]
4341

4442
[project.entry-points."ragas.backends"]
4543
"local/csv" = "ragas_experimental.backends.local_csv:LocalCSVBackend"

ragas/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies = [
1818
dynamic = ["version", "readme"]
1919

2020
[project.optional-dependencies]
21+
experimental = ["ragas-experimental"]
2122
all = [
2223
"sentence-transformers",
2324
"transformers",
@@ -27,7 +28,8 @@ all = [
2728
"pandas",
2829
"datacompy",
2930
"llama_index",
30-
"r2r"
31+
"r2r",
32+
"ragas-experimental"
3133
]
3234
docs = [
3335
"mkdocs>=1.6.1",

ragas/src/ragas/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,17 @@
2020
"CacheInterface",
2121
"DiskCacheBackend",
2222
]
23+
24+
25+
def __getattr__(name):
26+
if name == "experimental":
27+
try:
28+
import ragas_experimental as experimental # type: ignore
29+
30+
return experimental
31+
except ImportError:
32+
raise ImportError(
33+
"ragas.experimental requires installation: "
34+
"pip install ragas[experimental]"
35+
)
36+
raise AttributeError(f"module 'ragas' has no attribute '{name}'")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
try:
2+
from ragas_experimental import * # noqa: F403, F401 # type: ignore
3+
except ImportError:
4+
raise ImportError(
5+
"ragas_experimental is required for experimental features. "
6+
"Install with: pip install ragas_experimental"
7+
)

0 commit comments

Comments
 (0)