langchain_core.runnables.graph.node_data_json¶

langchain_core.runnables.graph.node_data_json(node: Node, *, with_schemas: bool = False) Dict[str, Union[str, Dict[str, Any]]][source]¶

Convert the data of a node to a JSON-serializable format.

Parameters
  • node (Node) – The node to convert.

  • with_schemas (bool) – Whether to include the schema of the data if it is a Pydantic model.

Returns

A dictionary with the type of the data and the data itself.

Return type

Dict[str, Union[str, Dict[str, Any]]]