modify_serialized_iterative#

langchain_community.callbacks.tracers.wandb.modify_serialized_iterative(runs: List[Dict[str, Any]], exact_keys: Tuple[str, ...] = (), partial_keys: Tuple[str, ...] = ()) โ†’ List[Dict[str, Any]][source]#

Utility to modify the serialized field of a list of runs dictionaries. removes any keys that match the exact_keys and any keys that contain any of the partial_keys. recursively moves the dictionaries under the kwargs key to the top level. changes the โ€œidโ€ field to a string โ€œ_kindโ€ field that tells WBTraceTree how to visualize the run. promotes the โ€œserializedโ€ field to the top level. :param runs: The list of runs to modify. :param exact_keys: A tuple of keys to remove from the serialized field. :param partial_keys: A tuple of partial keys to remove from the serialized

field.

Returns:

The modified list of runs.

Parameters:
  • runs (List[Dict[str, Any]])

  • exact_keys (Tuple[str, ...])

  • partial_keys (Tuple[str, ...])

Return type:

List[Dict[str, Any]]