mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-12 15:59:56 +00:00
langchain: Fix Evaluator's _check_evaluation_args (#31910)
Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
parent
a3e3fd20f2
commit
b8e2420865
@ -120,10 +120,10 @@ class _EvalArgsMixin:
|
|||||||
ValueError: If the evaluator requires an input string but none is provided,
|
ValueError: If the evaluator requires an input string but none is provided,
|
||||||
or if the evaluator requires a reference label but none is provided.
|
or if the evaluator requires a reference label but none is provided.
|
||||||
"""
|
"""
|
||||||
if self.requires_input and input is None:
|
if self.requires_input and input_ is None:
|
||||||
msg = f"{self.__class__.__name__} requires an input string."
|
msg = f"{self.__class__.__name__} requires an input string."
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
if input is not None and not self.requires_input:
|
if input_ is not None and not self.requires_input:
|
||||||
warn(self._skip_input_warning)
|
warn(self._skip_input_warning)
|
||||||
if self.requires_reference and reference is None:
|
if self.requires_reference and reference is None:
|
||||||
msg = f"{self.__class__.__name__} requires a reference string."
|
msg = f"{self.__class__.__name__} requires a reference string."
|
||||||
|
Loading…
Reference in New Issue
Block a user