Home / Function/ map() — langchain Function Reference

map() — langchain Function Reference

Architecture documentation for the map() function in string_run_evaluator.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  975f5b09_3562_1764_4468_c7cb070bbfd3["map()"]
  715da39e_ae7e_bf18_46f6_cebdd3d81437["ToolStringRunMapper"]
  975f5b09_3562_1764_4468_c7cb070bbfd3 -->|defined in| 715da39e_ae7e_bf18_46f6_cebdd3d81437
  eeef200b_d96b_43d0_3074_30604390fe0c["map()"]
  975f5b09_3562_1764_4468_c7cb070bbfd3 -->|calls| eeef200b_d96b_43d0_3074_30604390fe0c
  style 975f5b09_3562_1764_4468_c7cb070bbfd3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/smith/evaluation/string_run_evaluator.py lines 218–222

    def map(self, run: Run) -> dict[str, str]:
        if not run.outputs:
            msg = f"Run {run.id} has no outputs to evaluate."
            raise ValueError(msg)
        return {"input": run.inputs["input"], "prediction": run.outputs["output"]}

Domain

Subdomains

Calls

Frequently Asked Questions

What does map() do?
map() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/smith/evaluation/string_run_evaluator.py.
Where is map() defined?
map() is defined in libs/langchain/langchain_classic/smith/evaluation/string_run_evaluator.py at line 218.
What does map() call?
map() calls 1 function(s): map.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free