StringRunMapper Class — langchain Architecture
Architecture documentation for the StringRunMapper class in string_run_evaluator.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 6513456f_be2b_21ef_06af_21023f648595["StringRunMapper"] e3623fbf_23b3_a8fc_0b7c_43b53f33b606["Serializable"] 6513456f_be2b_21ef_06af_21023f648595 -->|extends| e3623fbf_23b3_a8fc_0b7c_43b53f33b606 2f0b23f2_7760_d68c_7feb_721c5231c4ec["string_run_evaluator.py"] 6513456f_be2b_21ef_06af_21023f648595 -->|defined in| 2f0b23f2_7760_d68c_7feb_721c5231c4ec 2270a289_d8d5_e578_682e_87d6e2193aa4["output_keys()"] 6513456f_be2b_21ef_06af_21023f648595 -->|method| 2270a289_d8d5_e578_682e_87d6e2193aa4 18ce5ec1_b967_6417_c994_9209a57f1c14["map()"] 6513456f_be2b_21ef_06af_21023f648595 -->|method| 18ce5ec1_b967_6417_c994_9209a57f1c14 ea8529de_857a_cafc_0859_f6156a883f15["__call__()"] 6513456f_be2b_21ef_06af_21023f648595 -->|method| ea8529de_857a_cafc_0859_f6156a883f15
Relationship Graph
Source Code
libs/langchain/langchain_classic/smith/evaluation/string_run_evaluator.py lines 38–55
class StringRunMapper(Serializable):
"""Extract items to evaluate from the run object."""
@property
def output_keys(self) -> list[str]:
"""The keys to extract from the run."""
return ["prediction", "input"]
@abstractmethod
def map(self, run: Run) -> dict[str, str]:
"""Maps the Run to a dictionary."""
def __call__(self, run: Run) -> dict[str, str]:
"""Maps the Run to a dictionary."""
if not run.outputs:
msg = f"Run {run.id} has no outputs to evaluate."
raise ValueError(msg)
return self.map(run)
Extends
Source
Frequently Asked Questions
What is the StringRunMapper class?
StringRunMapper is a class in the langchain codebase, defined in libs/langchain/langchain_classic/smith/evaluation/string_run_evaluator.py.
Where is StringRunMapper defined?
StringRunMapper is defined in libs/langchain/langchain_classic/smith/evaluation/string_run_evaluator.py at line 38.
What does StringRunMapper extend?
StringRunMapper extends Serializable.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free