value_sanitize#

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

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