Skip to content

Commit

Permalink
Update run eval imports in init
Browse files Browse the repository at this point in the history
  • Loading branch information
vowelparrot committed Jun 7, 2023
1 parent ce7c116 commit 6f342bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
14 changes: 8 additions & 6 deletions langchain/evaluation/run_evaluators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
"""Evaluation classes that interface with traced runs and datasets."""


from langchain.evaluation.run_evaluators.base import (
RunEvalInputMapper,
RunEvaluator,
RunEvaluatorInputMapper,
RunEvaluatorChain,
RunEvaluatorOutputParser,
)
from langchain.evaluation.run_evaluators.implementations import (
ChoicesOutputParser,
StringRunEvalInputMapper,
get_criteria_evaluator,
get_qa_evaluator,
)

__all__ = [
"RunEvaluator",
"RunEvalInputMapper",
"RunEvaluatorChain",
"RunEvaluatorInputMapper",
"RunEvaluatorOutputParser",
"get_qa_evaluator",
"get_criteria_evaluator",
"StringRunEvalInputMapper",
"ChoicesOutputParser",
]
4 changes: 2 additions & 2 deletions langchain/evaluation/run_evaluators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from langchain.schema import BaseOutputParser


class RunEvalInputMapper:
class RunEvaluatorInputMapper:
"""Map the inputs of a run to the inputs of an evaluation."""

@abstractmethod
Expand All @@ -34,7 +34,7 @@ def parse_chain_output(self, output: Dict[str, Any]) -> EvaluationResult:
class RunEvaluatorChain(Chain, RunEvaluator):
"""Evaluate Run and optional examples."""

input_mapper: RunEvalInputMapper
input_mapper: RunEvaluatorInputMapper
"""Maps the Run and Optional example to a dictionary for the eval chain."""
eval_chain: LLMChain
"""The evaluation chain."""
Expand Down
4 changes: 2 additions & 2 deletions langchain/evaluation/run_evaluators/implementations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from langchain.evaluation.qa.eval_prompt import PROMPT as QA_DEFAULT_PROMPT
from langchain.evaluation.qa.eval_prompt import SQL_PROMPT
from langchain.evaluation.run_evaluators.base import (
RunEvalInputMapper,
RunEvaluatorInputMapper,
RunEvaluatorChain,
RunEvaluatorOutputParser,
)
Expand All @@ -25,7 +25,7 @@
}


class StringRunEvalInputMapper(RunEvalInputMapper, BaseModel):
class StringRunEvalInputMapper(RunEvaluatorInputMapper, BaseModel):
"""Maps the Run and Optional[Example] to a dictionary."""

prediction_map: Mapping[str, str]
Expand Down

0 comments on commit 6f342bc

Please sign in to comment.