_format_reference() — langchain Function Reference
Architecture documentation for the _format_reference() function in trajectory_eval_chain.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b7b9afe5_844f_287f_0e36_8a8d8d34e0a8["_format_reference()"] 9066f65c_c5a3_1534_5336_72609f4ff02b["TrajectoryEvalChain"] b7b9afe5_844f_287f_0e36_8a8d8d34e0a8 -->|defined in| 9066f65c_c5a3_1534_5336_72609f4ff02b ccca4de6_6251_ea13_1af1_84bd1b80a9d4["prep_inputs()"] ccca4de6_6251_ea13_1af1_84bd1b80a9d4 -->|calls| b7b9afe5_844f_287f_0e36_8a8d8d34e0a8 style b7b9afe5_844f_287f_0e36_8a8d8d34e0a8 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/evaluation/agents/trajectory_eval_chain.py lines 206–223
def _format_reference(reference: str | None) -> str:
"""Format the reference text.
Args:
reference: The reference text.
Returns:
The formatted reference text.
"""
if not reference:
return ""
return f"""
The following is the expected answer. Use this to measure correctness:
[GROUND_TRUTH]
{reference}
[END_GROUND_TRUTH]
"""
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does _format_reference() do?
_format_reference() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/agents/trajectory_eval_chain.py.
Where is _format_reference() defined?
_format_reference() is defined in libs/langchain/langchain_classic/evaluation/agents/trajectory_eval_chain.py at line 206.
What calls _format_reference()?
_format_reference() is called by 1 function(s): prep_inputs.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free