langchain.callbacks.tracers.wandb.RunProcessor¶
class langchain.callbacks.tracers.wandb.RunProcessor(wandb_module: Any, trace_module: Any)[source]¶
Handles the conversion of a LangChain Runs into a WBTraceTree.
Methods
__init__(wandb_module, trace_module)
build_tree(runs)
Builds a nested dictionary from a list of runs. :param runs: The list of runs to build the tree from. :return: The nested dictionary representing the langchain Run in a tree     structure compatible with WBTraceTree.
flatten_run(run)
Utility to flatten a nest run object into a list of runs.
modify_serialized_iterative(runs[, ...])
Utility to modify the serialized field of a list of runs dictionaries.
process_model(run)
Utility to process a run for wandb model_dict serialization.
process_span(run)
Converts a LangChain Run into a W&B Trace Span.
truncate_run_iterative(runs[, keep_keys])
Utility to truncate a list of runs dictionaries to only keep the specified
__init__(wandb_module: Any, trace_module: Any)[source]¶
build_tree(runs: List[Dict[str, Any]]) → Dict[str, Any][source]¶
Builds a nested dictionary from a list of runs.
:param runs: The list of runs to build the tree from.
:return: The nested dictionary representing the langchain Run in a tree
structure compatible with WBTraceTree.
flatten_run(run: Dict[str, Any]) → List[Dict[str, Any]][source]¶
Utility to flatten a nest run object into a list of runs.
:param run: The base run to flatten.
:return: The flattened list of runs.