_validate_input_vars() — langchain Function Reference
Architecture documentation for the _validate_input_vars() function in eval_chain.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 5e40a8d3_ac36_a29a_8969_75ee97f0c328["_validate_input_vars()"] 6b783916_2e41_8d2a_dba2_81813096b7c4["ContextQAEvalChain"] 5e40a8d3_ac36_a29a_8969_75ee97f0c328 -->|defined in| 6b783916_2e41_8d2a_dba2_81813096b7c4 909f249d_6333_28c0_ed05_2bfa8676c170["from_llm()"] 909f249d_6333_28c0_ed05_2bfa8676c170 -->|calls| 5e40a8d3_ac36_a29a_8969_75ee97f0c328 80297720_85ce_00c4_c038_befbdc6c8ea0["from_llm()"] 80297720_85ce_00c4_c038_befbdc6c8ea0 -->|calls| 5e40a8d3_ac36_a29a_8969_75ee97f0c328 style 5e40a8d3_ac36_a29a_8969_75ee97f0c328 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/evaluation/qa/eval_chain.py lines 242–249
def _validate_input_vars(cls, prompt: PromptTemplate) -> None:
expected_input_vars = {"query", "context", "result"}
if expected_input_vars != set(prompt.input_variables):
msg = (
f"Input variables should be {expected_input_vars}, "
f"but got {prompt.input_variables}"
)
raise ValueError(msg)
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does _validate_input_vars() do?
_validate_input_vars() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/qa/eval_chain.py.
Where is _validate_input_vars() defined?
_validate_input_vars() is defined in libs/langchain/langchain_classic/evaluation/qa/eval_chain.py at line 242.
What calls _validate_input_vars()?
_validate_input_vars() is called by 2 function(s): from_llm, from_llm.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free