_parse_json() — langchain Function Reference
Architecture documentation for the _parse_json() function in json_schema.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 17e51faf_bcc2_97a0_f42a_9ca542b6bfaf["_parse_json()"] 9babfe39_52f2_aa6b_17f6_a55234538495["JsonSchemaEvaluator"] 17e51faf_bcc2_97a0_f42a_9ca542b6bfaf -->|defined in| 9babfe39_52f2_aa6b_17f6_a55234538495 810f2cc6_5067_feaf_c5ea_268fbeb54aeb["_evaluate_strings()"] 810f2cc6_5067_feaf_c5ea_268fbeb54aeb -->|calls| 17e51faf_bcc2_97a0_f42a_9ca542b6bfaf style 17e51faf_bcc2_97a0_f42a_9ca542b6bfaf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/evaluation/parsing/json_schema.py lines 67–76
def _parse_json(self, node: Any) -> dict | list | None | float | bool | int | str:
if isinstance(node, str):
return parse_json_markdown(node)
if hasattr(node, "model_json_schema") and callable(node.model_json_schema):
# Pydantic v2 model
return node.model_json_schema()
if hasattr(node, "schema") and callable(node.schema):
# Pydantic v1 model
return node.schema()
return node
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does _parse_json() do?
_parse_json() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/parsing/json_schema.py.
Where is _parse_json() defined?
_parse_json() is defined in libs/langchain/langchain_classic/evaluation/parsing/json_schema.py at line 67.
What calls _parse_json()?
_parse_json() is called by 1 function(s): _evaluate_strings.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free