value_sanitize#

langchain_community.graphs.neo4j_graph.value_sanitize(d: Any) → Any[source]#

Deprecated since version 0.3.8: Use :meth:`~langchain_neo4j.graphs.neo4j_graph.value_sanitize` instead. It will be removed in None==1.0.

Sanitize the input dictionary or list.

Sanitizes the input by removing embedding-like values, lists with more than 128 elements, that are mostly irrelevant for generating answers in a LLM context. These properties, if left in results, can occupy significant context space and detract from the LLM’s performance by introducing unnecessary noise and cost.

Parameters:

d (Any) – The input dictionary or list to sanitize.

Returns:

The sanitized dictionary or list.

Return type:

Any