test_json_schema_evaluator_invalid_prediction() — langchain Function Reference
Architecture documentation for the test_json_schema_evaluator_invalid_prediction() function in test_json_schema.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 0b29ea2e_576f_d1be_f8be_32e126ab716f["test_json_schema_evaluator_invalid_prediction()"] 54803af3_7979_cadf_df7b_bcd305ce919c["test_json_schema.py"] 0b29ea2e_576f_d1be_f8be_32e126ab716f -->|defined in| 54803af3_7979_cadf_df7b_bcd305ce919c style 0b29ea2e_576f_d1be_f8be_32e126ab716f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/evaluation/parsing/test_json_schema.py lines 49–62
def test_json_schema_evaluator_invalid_prediction(
json_schema_evaluator: JsonSchemaEvaluator,
) -> None:
prediction = '{"name": "John", "age": "30"}' # age is a string instead of integer
reference = {
"type": "object",
"properties": {"name": {"type": "string"}, "age": {"type": "integer"}},
}
result = json_schema_evaluator._evaluate_strings(
prediction=prediction,
reference=reference,
)
assert result["score"] is False
assert "reasoning" in result
Domain
Subdomains
Source
Frequently Asked Questions
What does test_json_schema_evaluator_invalid_prediction() do?
test_json_schema_evaluator_invalid_prediction() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/evaluation/parsing/test_json_schema.py.
Where is test_json_schema_evaluator_invalid_prediction() defined?
test_json_schema_evaluator_invalid_prediction() is defined in libs/langchain/tests/unit_tests/evaluation/parsing/test_json_schema.py at line 49.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free