langchain_community.callbacks.utils
.flatten_dictΒΆ
- langchain_community.callbacks.utils.flatten_dict(nested_dict: Dict[str, Any], parent_key: str = '', sep: str = '_') Dict[str, Any] [source]ΒΆ
Flattens a nested dictionary into a flat dictionary.
- Parameters
nested_dict (dict) β The nested dictionary to flatten.
parent_key (str) β The prefix to prepend to the keys of the flattened dict.
sep (str) β The separator to use between the parent key and the key of the flattened dictionary.
- Returns
A flat dictionary.
- Return type
(dict)