mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-13 16:36:06 +00:00
parent
f7f3c02585
commit
57e2de2077
@ -82,6 +82,8 @@ class TestResult(dict):
|
||||
_quantiles = df[feedback_cols].quantile(
|
||||
quantiles or [0.25, 0.5, 0.75], numeric_only=True
|
||||
)
|
||||
_quantiles.loc["mean"] = df[feedback_cols].mean()
|
||||
_quantiles.loc["mode"] = df[feedback_cols].mode().iloc[0]
|
||||
return _quantiles.transpose()
|
||||
|
||||
def to_dataframe(self) -> pd.DataFrame:
|
||||
|
@ -1,6 +1,7 @@
|
||||
"""Generic utility functions."""
|
||||
import contextlib
|
||||
import datetime
|
||||
import functools
|
||||
import importlib
|
||||
import warnings
|
||||
from importlib.metadata import version
|
||||
@ -14,7 +15,8 @@ def xor_args(*arg_groups: Tuple[str, ...]) -> Callable:
|
||||
"""Validate specified keyword args are mutually exclusive."""
|
||||
|
||||
def decorator(func: Callable) -> Callable:
|
||||
def wrapper(*args: Any, **kwargs: Any) -> Callable:
|
||||
@functools.wraps(func)
|
||||
def wrapper(*args: Any, **kwargs: Any) -> Any:
|
||||
"""Validate exactly one arg in each group is not None."""
|
||||
counts = [
|
||||
sum(1 for arg in arg_group if kwargs.get(arg) is not None)
|
||||
|
Loading…
Reference in New Issue
Block a user