ChainStringRunMapper#
- class langchain.smith.evaluation.string_run_evaluator.ChainStringRunMapper[source]#
Bases:
StringRunMapper
Extract items to evaluate from the run object from a chain.
- param input_key: str | None = None#
The key from the model Run’s inputs to use as the eval input. If not provided, will use the only input key or raise an error if there are multiple.
- param prediction_key: str | None = None#
The key from the model Run’s outputs to use as the eval prediction. If not provided, will use the only output key or raise an error if there are multiple.
- __call__(run: Run) Dict[str, str] #
Maps the Run to a dictionary.
- Parameters:
run (Run)
- Return type:
Dict[str, str]
- map(run: Run) Dict[str, str] [source]#
Maps the Run to a dictionary.
- Parameters:
run (Run)
- Return type:
Dict[str, str]
- property output_keys: List[str]#
The keys to extract from the run.