_list_to_dict_preprocessing() — langchain Function Reference
Architecture documentation for the _list_to_dict_preprocessing() function in json.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc["_list_to_dict_preprocessing()"] 6fcdab9c_3ecd_51f0_a2ae_3b0c8bfac048["RecursiveJsonSplitter"] ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc -->|defined in| 6fcdab9c_3ecd_51f0_a2ae_3b0c8bfac048 ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc["_list_to_dict_preprocessing()"] ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc -->|calls| ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc e3fb30a1_bf0b_b803_4160_e962db65ecfe["split_json()"] e3fb30a1_bf0b_b803_4160_e962db65ecfe -->|calls| ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc["_list_to_dict_preprocessing()"] ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc -->|calls| ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc style ab35e0b0_5a75_02e6_13a4_6e87c8da8bfc fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/text-splitters/langchain_text_splitters/json.py lines 69–83
def _list_to_dict_preprocessing(
self,
data: Any, # noqa: ANN401
) -> Any: # noqa: ANN401
if isinstance(data, dict):
# Process each key-value pair in the dictionary
return {k: self._list_to_dict_preprocessing(v) for k, v in data.items()}
if isinstance(data, list):
# Convert the list to a dictionary with index-based keys
return {
str(i): self._list_to_dict_preprocessing(item)
for i, item in enumerate(data)
}
# Base case: the item is neither a dict nor a list, so return it unchanged
return data
Domain
Subdomains
Source
Frequently Asked Questions
What does _list_to_dict_preprocessing() do?
_list_to_dict_preprocessing() is a function in the langchain codebase, defined in libs/text-splitters/langchain_text_splitters/json.py.
Where is _list_to_dict_preprocessing() defined?
_list_to_dict_preprocessing() is defined in libs/text-splitters/langchain_text_splitters/json.py at line 69.
What does _list_to_dict_preprocessing() call?
_list_to_dict_preprocessing() calls 1 function(s): _list_to_dict_preprocessing.
What calls _list_to_dict_preprocessing()?
_list_to_dict_preprocessing() is called by 2 function(s): _list_to_dict_preprocessing, split_json.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free