Skip to content

Commit

Permalink
[chore]: Using class_name by kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
keenborder786 committed Sep 19, 2024
1 parent 1c4db33 commit d890bac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/core/langchain_core/callbacks/stdout.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ def on_chain_start(
inputs (Dict[str, Any]): The inputs to the chain.
**kwargs (Any): Additional keyword arguments.
"""
class_name = serialized.get("name", serialized.get("id", ["<unknown>"])[-1])
print(f"\n\n\033[1m> Entering new {class_name} chain...\033[0m") # noqa: T201
chain_name = (
kwargs.get("class_name")
if kwargs.get("class_name")
else kwargs.get("lc_id", ["<unknown>"])[-1]
)
print(f"\n\n\033[1m> Entering new {chain_name} chain...\033[0m") # noqa: T201

def on_chain_end(self, outputs: dict[str, Any], **kwargs: Any) -> None:
"""Print out that we finished a chain.
Expand Down

0 comments on commit d890bac

Please sign in to comment.