-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
57 lines (48 loc) · 1.84 KB
/
Copy path__init__.py
File metadata and controls
57 lines (48 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""evalwire — systematic evaluation of LangGraph nodes with Arize Phoenix."""
import logging
from importlib.metadata import version
from evalwire.evaluators import (
make_contains_evaluator,
make_exact_match_evaluator,
make_json_match_evaluator,
make_llm_judge_evaluator,
make_membership_evaluator,
make_numeric_tolerance_evaluator,
make_regex_evaluator,
make_schema_evaluator,
make_top_k_evaluator,
)
from evalwire.observability import setup_observability
from evalwire.runner import ExperimentRunner
from evalwire.uploader import DatasetUploader
__version__ = version("evalwire")
logging.getLogger("evalwire").addHandler(logging.NullHandler())
__all__ = [
"DatasetUploader",
"ExperimentRunner",
"make_contains_evaluator",
"make_exact_match_evaluator",
"make_json_match_evaluator",
"make_llm_judge_evaluator",
"make_membership_evaluator",
"make_numeric_tolerance_evaluator",
"make_regex_evaluator",
"make_schema_evaluator",
"make_top_k_evaluator",
"setup_observability",
# LangGraph helpers — available when the `evalwire[langgraph]` extra is
# installed. Importing from the top-level package is supported; if
# langgraph is absent the ImportError is raised at call time, not import time.
"build_subgraph",
"invoke_node",
]
def __getattr__(name: str): # noqa: ANN202
"""Lazily expose optional LangGraph helpers at the top-level package.
This allows ``from evalwire import build_subgraph`` to work when
``evalwire[langgraph]`` is installed, without importing langgraph at
package import time (which would fail if the extra is absent).
"""
if name in {"build_subgraph", "invoke_node"}:
from evalwire import langgraph as _lg
return getattr(_lg, name)
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")